bayan-api / src

Commit History

ui: Clean up editor placeholder text and alignment (top-right)
3c20b28
Running

youssefreda9 commited on

fix: Green traffic light (fullscreen) now works - Wrong selector: .editor-main-layout → .editor-layout - Grid override: grid-template-columns: 1fr !important - Hide both docs-panel and sidebar-desktop
b3bd37c

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 ✅
2d00cd6

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
772d314

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.
b7efad8

youssefreda9 commited on

feat: NLP-3.5 Hardening Sprint — Performance + Overlap Resolver TASK 2: Per-stage timing instrumentation (spelling_ms, grammar_ms, punctuation_ms, total_ms) TASK 3: Smart text processing — skip AraSpell for texts > 300 chars TASK 4+5: Global overlap resolver with priority system grammar(3) > punctuation(2) > spelling(1) > autocomplete(0) Full span collision detection (exact + partial overlaps) TASK 6: AutoComplete priority hook prepared (priority=0)
25c1f6c

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
d572747

youssefreda9 commited on

feat: NLP-3 PuncAra-v1 Integration — Local punctuation model - Created src/nlp/punctuation/ package (rules + service) - Extracted from PuncAra.py: preprocessing, postprocessing, chunking logic - PunctuationChecker: lazy-loaded EncoderDecoderModel from bayan10/PuncAra-v1 - Wired into /api/analyze as Step 3 (Spelling -> Grammar -> Punctuation) - Updated /api/punctuation standalone endpoint - Updated /api/health to report punctuation status - Dockerfile pre-downloads PuncAra-v1 weights during build - Increased gunicorn timeout to 300s for full pipeline
a5c0c1c

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
475707f

youssefreda9 commited on

fix: Grammar rules false positive - الامتحان was incorrectly matched - Increased minimum stem length from 2 to 4 in fix_prepositions_advanced - Prevents root-level ان endings (الامتحان, الإنسان) from being treated as grammatical ون/ان
f0cb2a5

youssefreda9 commited on

fix: Deduplicate spelling/grammar overlap - grammar wins - When spelling and grammar both flag the same word position, keep only grammar suggestion - Prevents double-highlighting on conjugation errors like يعملوا
6d45a5c

youssefreda9 commited on

feat: NLP-2 Grammar Integration — dependency-aware pipeline - Add grammar_rules.py (ArabicGrammarGuard from Grammer_Rules.py with camel-tools) - Add grammar_service.py (lazy-loaded Gradio Client + rules pipeline) - Wire /api/grammar endpoint to real grammar service - Wire /api/analyze Step 2 to grammar (receives AraSpell output) - Update /api/health to report grammar status - Add gradio_client to requirements.txt - Add camel_data download to Dockerfile - Frontend unchanged (already supports grammar-error yellow highlighting)
e813517

youssefreda9 commited on

ui: Better hero demo text - natural sentences with few clear errors
f41abbc

youssefreda9 commited on

ui: Update hero section - Remove 'مدعوم بالذكاء الاصطناعي' badge - Replace demo text with real spelling/grammar errors - Update error counts: 8 إملائي, 3 نحوي, 2 ترقيم, score 45
58e60c9

youssefreda9 commited on

fix: PDF dropdown visible + verify spelling context + araspell audit - Fix summary export dropdown clipping (overflow: visible + opens upward) - Verify: use_contextual=True in araspell_service.py (line 83) ✓ - Verify: ContextualCorrector fully initialized and used in pipeline ✓ - Verify: All araspell_rules.py classes used: AraSpellPostProcessor, ErrorClassifier, RulesBasedCorrector, OutputValidator, VocabularyManager, WordAligner, SplitMergeSpecialist, EditDistanceCorrector, ContextualCorrector, ArabicSpellChecker ✓ - Fix misleading comment about contextual=False
3b72352

youssefreda9 commited on

fix: Make all editor footer buttons equal size (40x40px)
e4e2c11

youssefreda9 commited on

fix: Remove double-inversion of summary length - Browser already reverses range slider in RTL - Sending raw value now matches correctly: طويل→3, قصير→1
e4b9fa3

youssefreda9 commited on

fix: Keep summary length label fixed as متوسط
87784c1

youssefreda9 commited on

fix: Invert summary length slider value for RTL - RTL slider: min=1 is RIGHT (طويل), max=3 is LEFT (قصير) - API expects: 1=short, 3=long - Fix: send (4 - value) to API so طويل→3 (long), قصير→1 (short)
4a6150d

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
aa46ddf

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
8089832

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
03245b2

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
c377894

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)
af1d49d

youssefreda9 commited on

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
5aabdae

youssefreda9 commited on

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
9f00a5c

youssefreda9 commited on

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
18b6aef

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
0b836e7

youssefreda9 commited on

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
45c81cf

youssefreda9 commited on

fix: Cancel on create document prompt now actually cancels
c4c3933

youssefreda9 commited on

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

youssefreda9 commited on

fix: Use Arabic numerals for word goal percentage
10115f1

youssefreda9 commited on

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
484d994

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
5d19ad0

youssefreda9 commited on

audit-v4-fix: Finally replace footer with multi-column layout via Python
301453d

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
90c6b33

youssefreda9 commited on

fix: Clear format icon - T with diagonal strikethrough
7aebcf1

youssefreda9 commited on

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
0756acc

youssefreda9 commited on

audit-v3-fix: Replace all 8 Unicode feature icons with SVGs + enhanced footer with multi-column layout
708a1d2

youssefreda9 commited on

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
3346d38

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
a9c2dcb

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
996cef9

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
dbd8b7b

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
316ac75

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()
3eb5085

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
2846649

youssefreda9 commited on

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
9088e80

youssefreda9 commited on

ui: Replace أ with بيان in font size dropdown preview
4bab5d1

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
76e759e

youssefreda9 commited on

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
3e28ff6

youssefreda9 commited on