Skip to content

♻️ Frontend Refactoring: Safety, UX & Code Quality (50 files) - #32

Merged
frack113 merged 15 commits into
mainfrom
review-front
Jul 2, 2026
Merged

♻️ Frontend Refactoring: Safety, UX & Code Quality (50 files)#32
frack113 merged 15 commits into
mainfrom
review-front

Conversation

@frack113

@frack113 frack113 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

Comprehensive frontend refactoring across 50 files with 1885 insertions and 2262 deletions. Focus on save function safety, UX improvements, code organization, and quality fixes.

Key Changes

🔒 Save Function Safety

  • Added _isSaving flag to prevent concurrent save clicks
  • Protected saveBackendConfig, saveLoggingConfig, saveBackendServiceConfig
  • Prevents race conditions and duplicate API calls

⏱️ API Timeout Helper

  • Added fetchWithTimeout helper with 10s AbortController timeout
  • Improves error handling for slow/unresponsive API calls

✅ UX Improvements

  • Replaced native confirm() with custom showConfirm() in prompts.js and repo-browser.js
  • Consistent confirmation dialog UX across the application
  • Added auto-refresh for VectorDB status every 30s

📦 Code Organization

  • Extracted inline JS from templates into external files (prompts.js, github.js, sigma-spec.js)
  • Reorganized JS: static/js/external/ for libs, static/js/internal/ for first-party
  • Extracted shared repo_router factory from github/spec routers

🎨 Style & CSS

  • Removed hardcoded colors from logs.css and progress-bar.js
  • Replaced inline styles with CSS classes (btn, card, etc.)
  • Added color-scheme: light dark meta tag

🐛 Bug Fixes

  • Fixed XSS vulnerability in admin.js
  • Fixed URL handling for delete operations
  • Fixed spec_discovery polling
  • Cleaned up dead code and legacy files

📝 Documentation

  • Updated gitignore, removed internal planning docs
  • Added proper type hints and docstrings

Testing

  • ✅ Linting passed (Biome, Ruff)
  • ✅ No syntax errors
  • ✅ All scripts load in correct order
  • ✅ Pre-commit hooks passed

Stats

50 files changed, 1885 insertions(+), 2262 deletions(-)

frack113 added 15 commits June 30, 2026 12:59
C1: _esc undefined → escHtml dans notifications.js
C2: onchange déplacé de <label> vers <input> (4 toggles)
C3: --border-color → --border-card (variable inexistante)
H1: static_path → url_for (JS 404)
H2: null guard sur llama buttons dans config.js
Dead: supprime chat.html.j2, _release-selector.html.j2, components/
logs.css: #666 → --log-text-muted; supprime .log-level-* dupliqués
(déjà dans theme.css avec variables CSS dark-mode); .logs-error utilise
--color-danger avec color-mix
progress-bar.js: #4caf50 → classe .progress-fill.complete + --color-success
- Python: create_repo_router() factory in src/api/v1/base/repo_router.py
  github.py and spec.py slimmed to ~5 lines each
  include_outdated_check toggle (False for spec repos)
- JS: shared RepoBrowser class in repo-browser.js
  github.js and sigma-spec.js slimmed to config-only
- UX: split Save & Close into separate buttons
  Save: save selections + trigger scan
  Close: just close (no scan)
- Remove List document button (scan automatic on Save)
- Add Index button to GitHub page (group: docs)
- Replace alert() in Index with inline button feedback
- Fix Qdrant downloader: use .tar.gz for Linux/macOS
- Null-safe DOM bindings in _init()
- Fix qdrant.js function names (remove _ prefix)
- persist() call in save_selected_dirs()
- Update tests for new module paths
- Add _isSaving flag to prevent concurrent save clicks
- Add fetchWithTimeout helper with 10s AbortController timeout
- Replace confirm() with showConfirm() in prompts.js and repo-browser.js
- Add auto-refresh for VectorDB status every 30s
- Update refactor.md with Phase 1-3 completion status
@frack113 frack113 changed the title ♻️ Frontend Refactoring: Safety, UX & Code Quality Improvements ♻️ Frontend Refactoring: Safety, UX & Code Quality (50 files) Jul 1, 2026
@frack113
frack113 merged commit 054caa6 into main Jul 2, 2026
2 checks passed
@frack113
frack113 deleted the review-front branch July 2, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant