feat: Dashboard v2: Svelte rewrite + new Code, Stats, and Timeline views#1526
feat: Dashboard v2: Svelte rewrite + new Code, Stats, and Timeline views#1526paul-basanets wants to merge 9 commits into
Conversation
| """ | ||
| candidate_paths: list[str] = [] | ||
| truncated = False | ||
| for dirpath, dirnames, filenames in os.walk(walk_root, followlinks=False): |
| return _err(400, str(e)) | ||
| except FileNotFoundError: | ||
| return _err(404, "directory not found") | ||
| if not os.path.isdir(resolved): |
|
|
||
| entries: list[_DirEntry] = [] | ||
| try: | ||
| with os.scandir(resolved) as it: |
8f51bf9 to
727d702
Compare
|
I believe those two types of issues from the security bot are actually false positives as we deal with local tool here:
|
|
The biggest issue with this is that it is against our contribution guidelines. Please read them. If we had wanted the dashboard to be implemented with Svelte, we would have done so. |
|
@opcode81 Anyway it's up to you, fell free to close the PR if you find it irrelevant. |
|
It is not primarily about the new features, some of which we think are useful; it is about the switch to Svelte. We greatly appreciate the work you have put into trying to improve Serena, but it is important that changes this large (and especially changes to the tech stack) be discussed in an issue prior to implementation - in order to produce a PR that aligns with the goals of the project and avoid unnecessary work. Please be sure to read our contribution guidelines. We will further discuss this internally and get back to you. |
631d6ad to
367d7ac
Compare
| candidate = os.path.realpath(os.path.join(root_real, path)) | ||
| if candidate != root_real and not candidate.startswith(root_real + os.sep): | ||
| raise ValueError(f"path escapes project root: {path!r}") | ||
| if not os.path.exists(candidate): |
|
Hi @paul-basanets , I appreciate that you continue improving this. We have not forgotten about the overhaul of the dashboard, just that other things are more urgent. Just FYI, we will definitely get back to you about this. |
|
@MischaPanch , no problem, thank you. To be honest i do it for myself and couple of other guys :) |
Replace the legacy jQuery dashboard with a Svelte 5 + TypeScript app. - New Vite-based build pipeline + CI; remove the legacy jQuery dashboard. - Banners, "What's New", and config-modal wiring; restore legacy visual parity. - Shared modal-action / Confirm primitives, token-driven styles, a11y and a header menu. - Test scaffolding (shared fetch/fixture helpers) and broadened store/component coverage. - Single-pass highlightTools and escapeHtml hardening. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bug fixes and minor improvements on top of the Svelte rewrite. - Swap frappe-charts for Chart.js (+ datalabels); render pies and a dual-axis token bar via dedicated spec builders; in-place theme/data updates. - F1: surface config/memory editor load errors and block Save until loaded. - F2: logs viewer tails the newest line on first load. - F3: mark the active view tab with aria-current=page. - F4: add a title heading to the Create Memory modal. - Stats polish: inline KPI strip, pie/bar tuning, card-style toolbar, icon-only theme/shutdown buttons, thousands-separated totals. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cy branch Port the legacy-branch feature set and its follow-on changes. - analytics: ToolCallRecord ring buffer, Entry timing/error/last_called_at fields, 8KB truncation helper, cursor-based reads. - Instrument agent tool dispatch (timing + error capture) and task-executor TaskInfo timing with a race fix around future resolution. - Backend endpoints: timeline, totals, queued-exec timing; /code/* routes (list_dir, file_symbols, workspace_symbol_search, diagnostics_summary). - Frontend: Timeline, SummaryCards, FilterDropdown, Stats charts (sort selector, duration, rate, drilldown), and the Code tab (store, FileTree, Symbols, Search). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-on feature work building on the Code tab. - Code tab redesign with a lucide icon system (Icon wrapper plus icons across FileTree, Timeline, shell, logs, modals and drilldown). - symbolTree utilities (KIND_META, countByKind, filterTree, flattenForDisplay, symbolKey) and a rebuilt FileSymbols (breadcrumb, filter, copy). - Tri-state theme switcher, drilldown redesign, 2-col CodePage with Diagnostics as a 3rd middle pane, severity chips and slow-warning. - Scoped file/directory diagnostics: scope selector, per-row Run action, scope-aware text, pinned explicit scope. - Code-tab file-icon mapping module, type icons, indent guides and a how-it-works explainer popover (reusable Popover primitive). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Final correctness and quality pass. - Route diagnostics per-file to the correct language server. - Functional + a11y bug sweep across all tabs. - Resolve poe type-check (mypy) errors. - Enforce Svelte 5 patterns in CLAUDE.md and add a Serena memory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
os.path.relpath returns backslash-separated paths on Windows, which broke the /code/* endpoints there: the relative path is used as the language-server lookup key and as the returned f["path"], so "pkg\inside.py" failed to match the posix-keyed diagnostics map and the test's "pkg/inside.py" assertion. Normalize all four relpath sites with .replace(os.sep, "/") (a no-op on posix), matching the existing repo idiom (file_system.py, memory_manager, clojure_lsp): - diagnostics_summary dir/project candidate paths - diagnostics_summary file-scope rel0 - file_symbols rel (was mis-routing the LS on Windows) - list_dir rel (defensive; should_ignore already normalizes) Fixes test_diagnostics_summary_directory_scope_limits_to_subtree on Windows CI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
_workspace_match built the returned match path with str(Path(file_path).relative_to(root)), which yields backslash separators on Windows. The existing test only asserts the response shape, not the separator, so Windows CI didn't catch it. Normalize with .replace(os.sep, "/"), matching the sibling /code/* fixes. No-op on posix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ling Test fixes (22 failing tests on all CI platforms): - Add register_config_changed_callback to the _DummyAgent and _AgentNoProject doubles in test_dashboard_code.py, which drifted from SerenaDashboardAPI's agent contract (added in __init__). - Fix renamed accessor: _get_config_overview -> _compute_config_overview. CodeQL hardening: - Rewrite resolve_project_path to os.path.realpath()+startswith() containment, the only sanitizer form CodeQL py/path-injection models, clearing the "uncontrolled data in path expression" alerts while still guarding traversal. - Return generic client error messages instead of str(e) and log details server-side, clearing the "information exposure through an exception" alerts. - Log rejected paths (traversal/NUL/absolute/escape) at warning for visibility. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
_DummyAgent.get_active_modes() returned a bare list, but the real SerenaAgent.get_active_modes() returns an ActiveModes instance and dashboard._compute_config_overview() calls .get_modes() on it, so test_config_overview_includes_tool_stats_totals raised AttributeError. Return a stub exposing get_modes() to mirror the real API. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
c3a06e9 to
d9798c7
Compare
Dashboard v2: Svelte rewrite + new Code, Stats, and Timeline views
A full rewrite of the Serena dashboard with a refreshed look, three new top-level
views, and a much richer picture of what the agent is doing in real time.
What's new
Modern dashboard
A rewritten from legacy single-page app with a consistent visual language.
Live activity Timeline
A scrolling timeline of recent tool calls and queued executions, with per-row
duration, status, and error details, plus filtering and summary cards
("calls today", "active tools", "error rate", etc.) at the top of the page.
Stats view
Interactive charts of tool usage: sortable bar charts, duration and call-rate
views, a dual-axis token/call chart, and a drill-down panel for any single
tool showing its full call history, timing distribution, and error breakdown.
Code view
A new file-explorer experience powered by the language servers Serena already
runs:
the correct language server, with a "how it works" explainer.
Better internals (user-visible)
feeds the Timeline, Stats, and drill-down views.
while still in progress.
This PR consists actually from 2 parts: rewrite of the dashboard to Svelte app so it's easier maintainable and extendable and couple of new features (Code tab, Stats updates, UI updates)