Commit History

  1. docs: Complete Architecture Documentation (12 files) - 01-system-overview: High-level architecture diagram - 02-class-diagram: UML class diagram (Frontend + Backend) - 03-component-diagram: All modules and connections - 04-sequence-diagrams: 5 flows (Analysis, AutoComplete, Summarize, Save, Offline) - 05-dataflow-diagram: DFD Level 0 + Level 1 - 06-deployment-diagram: Docker + HF Spaces + CI/CD - 07-database-schema: ERD + RLS policies + triggers - 08-nlp-pipeline-diagram: Final NLP pipeline with all 5 models - 09-sync-engine-diagram: State machine + conflict resolution - 10-project-dependency-map: Full dependency graph - 11-production-architecture: Final production system diagram - 12-architecture-audit-report: Stats, risks, future expansion

    81d06a3
  2. fix: Use capture phase on editor for Ctrl+Z/Y to intercept before browser native undo - Listener now on editor element with capture:true instead of document - Added stopPropagation to prevent browser native undo from also firing - Ensures corrections/dismissals can be properly undone

    50ae2d7
  3. feat: Add custom Undo/Redo for corrections and dismissals - Ctrl+Z undoes correction/dismiss (restores previous editor state) - Ctrl+Y or Ctrl+Shift+Z redoes - pushUndoState() called before every applyCorrection, applyAlternative, dismissSuggestion, applyAll - 50-level undo stack - Only intercepts when custom stack has entries (falls through to browser native otherwise)

    0f88e4f
  4. UI: Restructure editor layout - Import/export buttons moved to editor footer (next to save/delete/copy) - Removed separate import/export sidebar card (merged into footer) - Suggestions card now ABOVE writing score in sidebar

    afb0c39
  5. UI: Add 3 macOS window dots to editor toolbar + move save to footer - Red/yellow/green dots on right side of toolbar (like screenshot) - Save button moved next to delete and copy in editor-actions - Doc name + tabs remain in toolbar

    978c7f9
  6. UI: Remove footer logo + restructure editor toolbar - Footer: removed ب gradient icon, just shows 'بيان' text - Editor toolbar: save btn + doc name + كتابة/تلخيص all on left side - Analyzing indicator stays on right side

    07ab5d8
  7. UI: Remove logo icon from header + replace guest avatar with profile silhouette SVG - Header now shows just 'بيان' text (no ب icon) - Guest avatar shows person silhouette instead of 'ض' letter - Both HTML default and JS auth-ui.js updated

    aaf360a
  8. fix: Stabilize hover animation on external nav link (bayyinah) - ::after underline from .nav-link was conflicting with arrow from .nav-link-external - Added !important on width and transition:none to prevent flickering

    c31fca0
  9. fix: Cancel on create document prompt now actually cancels

    2ba8ffb
  10. fix: Document search was using wrong selector '.doc-item' instead of '.doc-list-item'

    ddea1ca
  11. fix: Use Arabic numerals for word goal percentage

    d1caf7b
  12. fix: Move word count to bottom bar + add clickable UI to set word goal - Word count now in status bar next to chars and sentences - Click on 'كلمة' to set word goal via prompt - Badge shows progress e.g. '50% من 500' - Green when goal reached

    cf3dbe8
  13. audit-v5: Complete ALL remaining green items - #8: Nav logo uses favicon.svg + clickable to home - #9: CTA button arrow indicator - #12: Word count goal (localStorage bayan_word_goal) - #13: Export summary as .txt file - #14: Character limit warning (already existed) - #15: Auto-save indicator in toolbar - #16: 404 page with Arabic numerals - #17: Loading skeleton animation for suggestions

    1bc4049
  14. audit-v4-fix: Finally replace footer with multi-column layout via Python

    b69dc30
  15. audit-v4: 10 fixes and improvements - FIX: Footer replaced with multi-column layout (Product + Resources) - FIX: cta_primary config now matches button text - FIX: Enterprise 'contact sales' button navigates to editor - FIX: Mock editor 'الكتابه' now has spelling-error class (3 errors) - FIX: Status bar updated to '٣ إملائي' - FIX: Scroll-to-top fallback to window.scrollY - FIX: Remove @view-transition experimental CSS - FIX: Remove injected Cloudflare challenge script - ADD: Toast on applyCorrection + applyAllSuggestions - ADD: confirm() on applyAllSuggestions - ADD: Smart empty state (no text vs no errors) - ADD: Toggle switch HTML for summary checkbox

    5f053cc
  16. fix: Clear format icon - T with diagonal strikethrough

    2988a73
  17. hotfix: Fix unclosed SVG path tag that broke editor and summarizer - Missing '/>' on clear-format icon SVG caused browser to fail parsing all HTML after it

    0294c3c
  18. audit-v3-fix: Replace all 8 Unicode feature icons with SVGs + enhanced footer with multi-column layout

    828b7be
  19. audit-v3: Complete remaining 5 items - SVG feature icons: Replace Unicode (✎◉⸲⊞) with proper SVGs - Clear format icon: Replace triangle with text-strikethrough icon - Enhanced footer: Multi-column with Product + Resources sections - Favicon: SVG with Arabic 'ب' on gradient background - Meta description added for SEO - Logo generated for brand reference

    d35f115
  20. audit-v2: Major UI overhaul — 12 improvements - HERO: Fix broken stats HTML, real Arabic errors in mock editor - HERO: Floating card shows actual correction (الصحيحه→الصحيحة) - HERO: Status bar matches shown errors (2 spelling, 1 grammar, 2 punctuation) - CSS: Custom gradient range slider (replaces browser default) - CSS: Toast notification system with animations - CSS: Scroll-to-top button with fade-in on scroll - JS: Toast notifications for copy actions - JS: Scroll-to-top button logic - PRICING: 'إضافة المتصفح'→'تصدير PDF و Word' (real feature) - EDITOR: copyText uses toast instead of button text change

    7db066a
  21. audit: Fix 15+ issues across entire website - BUGS: Fix copySummary event.target crash, viewbox→viewBox SVGs - HERO: Replace fake stats (10M/99%/50K) with real features (3 types/instant/free) - HERO: 'شاهد العرض التوضيحي'→'استكشف الميزات' with onclick - HERO: Fix mock editor hardcoded light colors→CSS variables - HERO: animate-pulse→animate-fade-in on floating card - PRICING: All 3 buttons now have onclick (go to editor) - FOOTER: Replace dead #links with working page navigation - EDITOR: Confirm dialog before clearing content - CODE: Remove empty style tag and old comments

    bb9cb5f
  22. remove: List buttons + indent + all related CSS/JS - Remove bullet list and ordered list buttons from toolbar - Remove formatList() function from format.js - Remove blockquote/ul/ol/li CSS from components.css - Keep clear format button

    3d687b8
  23. fix: Rewrite list creation with manual DOM manipulation - execCommand('insertUnorderedList/OrderedList') doesn't work with pre-wrap - New approach: manually creates ul/ol + li elements from selected text - Splits text by newlines, creates proper li for each line - Toggle support: click again to remove list - Empty editor: inserts empty list item ready to type - Works regardless of white-space mode

    5d4c0cc
  24. fix: Lists now work with pre-wrap editor - formatList() temporarily switches white-space to normal - Executes insertUnorderedList/insertOrderedList - Restores pre-wrap via requestAnimationFrame - Buttons now call formatList() instead of execFormat()

    993d144
  25. feat: Remove indent buttons + dismissed words whitelist - Remove indent/outdent buttons from toolbar (keep lists) - 'إبقاء كما هي' now saves word to localStorage whitelist - Whitelisted words are filtered out from future analysis - Persists across page reloads via bayan_dismissed_words key

    158da8f
  26. fix: Restore pre-wrap for correct RTL cursor position - Revert white-space to pre-wrap (fixes cursor starting from center) - Override with white-space:normal only for blockquote, ul, ol, li - Lists and indent still render properly

    4a2e131
  27. ui: Replace أ with بيان in font size dropdown preview

    8689984
  28. fix: Sentence count + reading time stats - Sentences: split by . ! ? ؟ and newlines (not just periods) - At least 1 sentence if text exists, 0 if empty - Reading time: 180 words/min for Arabic, shows 0 when empty - Minimum 1 minute when text exists

    59895be
  29. fix: Lists, indent, and keep button - Change white-space from pre-wrap to normal (fixes lists + indent) - Redesign keep button: centered, cleaner, separated from corrections - Keep button always renders last with clear 'إبقاء كما هي' label - Blockquote/list styling for RTL editor

    55ce477
  30. fix: Indent/outdent visible styling - blockquote gets right padding + blue border for RTL - Lists (ul/ol) get proper RTL padding - Each indent level nests another blockquote

    d21afbd
  31. fix: Critical editor bugs - Dropdowns now visible (remove overflow:hidden from editor-shell) - Font/size/color menus z-index 200 (above editor) - Selection collapses after formatting (no more blue highlight) - Spelling overlay uses textContent for consistent offsets - Correction preserves formatting (replaces inside parent node) - Alt correction same fix - Fallback finds span by matching original text

    189a51b
  32. feat: 12 UI improvements batch - 1. Editor surface flush (no margin/border, Google Docs style) - 2. Custom styled summary slider (gradient thumb) - 3. Empty states with icons for suggestions - 4. Enhanced status bar (chars, sentences, reading time) - 5. Mobile scrollable formatting toolbar - 6. Summary word count + compression ratio - 7. Document search bar with filter - 8. Text color + highlight color pickers - 9. Lists (bullet/ordered) + indent/outdent + clear format - 10. Animated sun/moon theme toggle - 11. Summary bullet points mode toggle - 12. Print styles (only editor content)

    ecec9e1
  33. feat: Premium formatting toolbar redesign - Custom dropdown menus for font family and size (animated, styled) - Pill-shaped button groups with gradient active states - Alignment applies to paragraph with selection (standard behavior) - Undo/Redo works for typing + formatting (browser native stack) - Font preview in size dropdown - Professional visual polish

    5866864
  34. feat: Rich text formatting toolbar + formatting-preserving renderer - Bold, Italic, Underline, Strikethrough, Alignment, Undo/Redo - Font family and font size dropdowns - New DOM-level overlay renderer (preserves formatting during analysis) - Apply/dismiss corrections keep original formatting

    120440f
  35. feat: Professional editor UI redesign - 3-column layout (docs | editor | sidebar) - Documents panel always visible on desktop - Import/export moved to left sidebar - Removed CTA button from nav - Replaced all emojis with SVG icons - Clean toolbar with separator - Mobile: docs stay as overlay sidebar

    b57e9cf
  36. fix: Remove 'Apply All' button - conflicts with spelling+grammar pipeline

    7f0ddc6
  37. fix: Word-level grammar suggestions + robust grammar model validation⁠

    b0bed28
  38. fix: Proper grammar suggestion generation — keep spelling suggestions, add grammar on top⁠

    63587df
  39. fix: Add missing SequenceMatcher import

    0f10098
  40. fix: Rewrite suggestion system — unified diff eliminates text duplication - Instead of mapping grammar offsets back through OffsetMapper (broken), now: - Run full pipeline: spelling -> grammar -> punctuation - Do ONE clean diff: original_text vs final_text - Classify each change as spelling/grammar based on what spelling changed - Guarantees non-overlapping suggestions with correct offsets

    1a2449a
  41. fix: Prevent overlapping spelling+grammar suggestions from duplicating text - Backend: Skip grammar suggestions that overlap with existing spelling ranges - Frontend: applyAllSuggestions skips overlapping ranges to prevent duplication

    02d51b7
  42. revert: Restore ORIGINAL grammar params that were working (num_beams=4, max_length=512) - Remove all hallucination checks that were blocking valid corrections - The model WAS correcting ذهب→ذهبت before, only highlight was wrong - Keep word-level diff fix (in app.py) + raw output logging

    9eee80b
  43. fix: Switch grammar to greedy decoding + stronger anti-hallucination - num_beams=1 (greedy, most stable for seq2seq correction) - repetition_penalty=2.0 (strong anti-repeat) - Log raw model output before hallucination check - Tightened bigram duplicate detection

    ea6d242
  44. fix: Prevent grammar model hallucination (rearranging/duplicating text) - Dynamic max_length (1.3x input instead of fixed 512) - repetition_penalty=1.5 to discourage repeating - Reduce beams 4→2 (less hallucination on CPU) - Add _is_hallucinated() safety checker: output length, word count, repeated phrases, sentence rearrangement

    964adc9
  45. debug: Add grammar diff logging to diagnose missing suggestions

    7520375
  46. fix: Grammar shows word-level suggestions instead of sentence chunks - Break grammar diffs into individual word changes - Skip grammar suggestions overlapping with spelling - Add alternatives to grammar suggestions - Prevents duplication on Apply All

    291a28f
  47. feat: NLP-2 Grammar model integration (Bayan_Arabic_Grammar T5) - New: src/nlp/grammar/grammar_service.py (lazy T5 loading) - Dockerfile: pre-download grammar model (2.14GB safetensors) - Wire /api/analyze Step 2 to grammar service - Update /api/grammar standalone endpoint - Add _grammar_available() health check

    4ec8363

  1. perf: Reduce debounce from 1500ms to 1000ms for faster response

    4540c4b
  2. fix: Increase analyze debounce to 1.5s to prevent text overwrite while typing - Debounce 500ms -> 1500ms - Abort in-flight requests when user starts typing again - Double-check no new input before running analysis

    9a1be04
  3. feat: Show 3 spelling alternatives + keep-as-is option - Backend: Generate alternatives via EditDistanceCorrector - Tooltip: Multiple clickable correction buttons - Sidebar cards: Alt chips for each suggestion - Dismiss button removes error highlight (keep original word)

    3f8001b