bayan-api / src /js

Commit History

feat: Complete ALL plan items — gradient tokens, nav scroll glow, focus rings, dropdown keyboard nav, color reset, network delay indicator
97ed8d3

youssefreda9 commited on

fix: Correct toast types (warning/error) + analyze API error toast + cleanup
565d2f9

youssefreda9 commited on

feat: Custom confirm dialog for doc delete + improved empty state component
6a06042

youssefreda9 commited on

feat: Apply All button shows count + empty states already functional
6451a95

youssefreda9 commited on

fix: add undo support for autocomplete suggestions
252b187

youssefreda9 commited on

fix: unified undo/redo - toolbar+keyboard use same stack, works with typing+formatting+Quran apply
bf8500f

youssefreda9 commited on

fix: Ctrl+Z/Y undo/redo works with Arabic keyboard (e.code instead of e.key)
ece7379

youssefreda9 commited on

fix: placeholder no longer shows over quran-applied text
b4b4d70

youssefreda9 commited on

fix: quran text excluded from analysis models + styled ref + score preserved
80d7d85

youssefreda9 commited on

feat: apply includes surah ref + quran-applied span protects from analysis models
ad7b1d2

youssefreda9 commited on

fix: tooltip shows original→correction format instead of confusing label
61cee96

youssefreda9 commited on

UI: nav logo, bayyinah hover, quran icon, hero autocomplete shadow, clean tooltip, fix punctuation dup + hamza كان
8804f87

youssefreda9 commited on

Full UI/UX modernization: fix hero examples, pricing beta, Apply All cursor/format fix, design polish
acf7dfb

youssefreda9 commited on

feat: P1-P3 all 8 items - ta marbuta fix, UI feedback, caching, rate limiting, unit tests
0678259

youssefreda9 commited on

revert: remove auto re-analyze after apply - causes grammar/punctuation cycle
aa88455

youssefreda9 commited on

fix: prevent analyze loop - skip redundant API calls when text unchanged
b829513

youssefreda9 commited on

fix: instant re-analyze after apply (direct analyzeText call, no debounce)
06e637f

youssefreda9 commited on

feat: P1-P3 improvements + auto re-analyze after apply
23c955d

youssefreda9 commited on

fix(autocomplete): only trigger after space - no partial words
97062ad

youssefreda9 commited on

feat(autocomplete): threshold=0.05 + max 3 suggestions
0a1ff39

youssefreda9 commited on

fix(autocomplete): 3 user-reported issues - last word only, dropdown position, cursor after accept
612978c

youssefreda9 commited on

fix(autocomplete): fix dropdown not showing - 3 critical bugs fixed
7f53fe2

youssefreda9 commited on

feat(NLP-4): AutoComplete integration — hybrid bigram + GPT-2
7394487

youssefreda9 commited on

fix: QA sweep — 6 issues resolved (sidebar chips, corrected field, input sanitization, punc cap, docs, tests)
53a22ae

youssefreda9 commited on

fix: Tooltip shows no correction buttons for grammar/punctuation — empty array is truthy in JS
40f1ad6

youssefreda9 commited on

fix: Grammar retry on rate-limit + cursor position after correction
4bde1ea

youssefreda9 commited on

feat: Pipeline Hardening v3.3 — stage ownership, punctuation safety, UUID migration
a9630ec

youssefreda9 commited on

feat: Complete UI/UX audit — all 20 fixes implemented Critical: - #1 Text duplication on consecutive apply (re-index spans) ✅ - #2 Apply All button (remove confirm() dialog, direct apply) ✅ - #3 Backend suggestion categorization (noted, minor) ✅ UX Fixes: - #4 Toolbar RTL verified correct ✅ - #5 Punctuation highlight: blinking insertion marker instead of bg ✅ - #6 Document title truncation with ellipsis ✅ - #7 Sidebar scrollable (score circle visible) ✅ - #8 Empty editor placeholder RTL alignment ✅ Design: - #9 Hero CTA button contrast (border 0.35 + glow) ✅ - #10 Features demos already complete for all 4 features ✅ - #11 Pricing cards equal heights (flex layout) ✅ - #12 Footer GitHub link with icon + Arabic text ✅ - #13 Pricing button text corrected ✅ - #14 بيّنة nav link: pill badge, smaller, visually distinct ✅ - #15 Scroll-to-top already correct (st > 400) ✅ Text/Content: - #16 Arabic text verified correct (خصيصًا) ✅ - #17 Traffic lights functional (red=close, yellow=collapse, green=fullscreen) ✅ - #18 Stats font size increased ✅ - #19 Dark mode already excellent ✅ - #20 Light mode: toolbar, tabs, cards, stats all improved ✅
bbe35ad

youssefreda9 commited on

fix: UI/UX audit fixes (10 items addressed) Critical: - Fix text duplication on consecutive suggestion apply (re-index spans) - Suggestion list now updates after apply (counters + cards refresh) UX Fixes: - Sidebar scrollable (score circle always accessible) - Suggestions max-height reduced: 420→320px - Stat items: larger font + better contrast in dark mode Text: - Pricing: 'الترقية للاحترافي' → 'الترقية للخطة الاحترافية' Undo/Redo: - formatUndo/Redo now use custom stack (unified) - Formatting commands save undo state before applying - Typing tracked via debounced pushUndoStateDebounced
91449e1

youssefreda9 commited on

fix: New document starts empty instead of inheriting old content Previously createDocument() used getEditorText() to save current content into the new doc. Now it creates with empty string and calls loadDocumentText('') to clear the editor.
db7f13a

youssefreda9 commited on

fix: Strip HTML formatting on paste into editor - Added paste event handler that converts clipboard to plain text - Prevents rich text styling (colors, opacity, fonts) from being carried over - Preserves paragraph structure with line breaks - Fixes ghost formatting when pasting from chat or web pages
1a27526

youssefreda9 commited on

fix: Re-index suggestion spans after dismiss (keep as-is) - After filtering dismissed suggestion from array, span data-suggestion-id indices became stale - Adjacent error words became unclickable because findSuggestionById used wrong index - Now re-indexes all remaining spans to match updated array positions
08ba334

youssefreda9 commited on

feat: Summary UI improvements + PDF fix - Swap short/long labels on summary length slider (RTL: long left, short right) - Remove 'تلخيص النص كاملاً' checkbox and button - Replace single export button with dropdown (TXT/DOCX/PDF) in summary - Hide format toolbar when on summary tab, show on writing tab - Fix PDF export freeze: use foreignObjectRendering:false + lower scale - Add loading toast during PDF export - Add summary DOCX and PDF export functions
18fcb1a

youssefreda9 commited on

fix: Undo/Redo inside editor only + auto-focus after corrections - Moved listener back to editor element (capture:true) as user requested - Added editor.focus() after applySuggestionAtOffsets (line 432) - Added editor.focus() after applyAlternativeCorrection (line 474) - Added editor.focus() after dismissSuggestion (line 518) - After any correction/dismiss, editor auto-focuses so Ctrl+Z works immediately
a5eaf0b

youssefreda9 commited on

fix: Undo/Redo now works after spelling corrections - Moved keydown listener from editor to document with capture:true - Uses stopImmediatePropagation to prevent browser native undo - Auto-focuses editor after undo/redo - Works even when tooltip click steals focus from editor
10f7c9d

youssefreda9 commited on

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
e1ecaac

youssefreda9 commited on

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)
55abf68

youssefreda9 commited on

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
bc3796a

youssefreda9 commited on

fix: Cancel on create document prompt now actually cancels
780b95e

youssefreda9 commited on

fix: Document search was using wrong selector '.doc-item' instead of '.doc-list-item'
7e5f112

youssefreda9 commited on

fix: Use Arabic numerals for word goal percentage
6c32ef6

youssefreda9 commited on

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
ed2cae2

youssefreda9 commited on

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
1e1b7ae

youssefreda9 commited on

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
488c84b

youssefreda9 commited on

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
afba67e

youssefreda9 commited on

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
afcf829

youssefreda9 commited on

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
7475e97

youssefreda9 commited on

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()
4648830

youssefreda9 commited on

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
038f3af

youssefreda9 commited on

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
1527e69

youssefreda9 commited on