Skip to content

feat(dashboard): cross-session stability, persistent URL, polish pass#1599

Merged
esengine merged 2 commits into
mainfrom
feat/dashboard-polish-stability
May 23, 2026
Merged

feat(dashboard): cross-session stability, persistent URL, polish pass#1599
esengine merged 2 commits into
mainfrom
feat/dashboard-polish-stability

Conversation

@esengine

Copy link
Copy Markdown
Owner

Summary

A chain of fixes prompted by post-#1418 user feedback on the live web dashboard. The unifying themes: nothing should change when you don't expect it to (token, port, URL, SSE stream) and everything should give visible feedback when you do change it.

Server

  • POST /api/sessions/new echoes the new session name so the bridge can update state.currentSession without diffing the list.
  • parseTranscript surfaces reasoning_content, tool_calls, and tool results (linked by tool_call_id) so historical replays render what the model actually did — not just bare text turns.
  • serveAsset injects ?token=… into CSS url() font refs (the missing JS-import rewrite cousin). Fixes the 401 storm on every Geist / KaTeX font.
  • New GET /api/browse?path= — lists immediate subdirectories, Windows drive letters auto-included on first call. Backs the new directory picker.
  • startDashboardServer exposes updateContext(ctx). The handle now outlives a chat.tsx-driven App remount; the new App rewires its loop/refs in place instead of forcing a port rebind the OS hadn't released (EADDRINUSE → ephemeral fallback → new URL was the user-visible symptom).
  • Dashboard token + actual bound port persist to config.json on first run via ensureDashboardToken / saveDashboardPort. EADDRINUSE on the persisted port falls back to ephemeral. New /dashboard reset-token slash subcommand rotates the token and restarts.

CLI

  • listSessions workspace filter now reaches the dashboard's GET /api/sessions, cutting sidebar entries from "every subagent transcript on disk" (10 000+ for active users) to the current workspace's chats.
  • getDashboardUrl appends &session=<name> so the printed URL points at the attached session and survives copy/paste.

Dashboard UI

  • Module-level singleton for the DashboardServerHandle and the SSE-subscriber Set — React App remounts (session swap) no longer tear the server down or drop subscribers on the floor. Fixed the "send a message after switching, web stays silent" desync.
  • session_load bridge handler emits $session_loaded with the new name and full segments (text + reasoning + tool calls stitched to results), replacing the old $session_empty error-card path.
  • AssistantMsg keys by message index — replayed transcripts arrive with turn=0 for every assistant row, so the turn-keyed list was collapsing every assistant message into one stale slot on every session switch (= "the content is the same after I clicked a different session").
  • Sidebar gets a per-row loading spinner + "Loading…" subtitle; thread shows a centered overlay during the swap so big sessions don't look dead.
  • CSS containment on .session-item, .msg, and .thread; dropped a needless backdrop-filter on the loading overlay. Together these cut Paint / Layout / pointerover budget noticeably on long transcripts.
  • New <WorkdirInputModal> backed by /api/browse — the web build previously stub'd openDialog to "" so clicking Browse did nothing.
  • Removed the "+ new tab" affordance from the tab bar (web has no multi-tab story).
  • URL session mirror from feat(dashboard): persist active session in URL for shareable links #1586 reverted to read-on-mount only so clicking a session doesn't churn the address bar.

i18n

statusbar.themeStyle{Graphite,Sandstone,Porcelain,Midnight}, settings.themeStyle* + Desc, settings.page* Label + Desc for all 8 pages, sidebarPanel.loading, workdir.{cancel,go,goTip,loading,emptyDir,openHere,pathPlaceholder}, handlers.dashboard.tokenReset* — en and zh-CN where relevant.

Test plan

  • tests/dashboard-token-persistence.test.ts — 9 cases for ensureDashboardToken / saveDashboardPort / clearDashboardToken.
  • dashboard-sessions-ops gains workspace-filter + name-echo coverage.
  • dashboard-smoke verifies CSS font url() token injection alongside the JS chunk-import rewrite.
  • npx tsc --noEmit + npx tsc --noEmit -p dashboard clean.
  • npm run build clean.

reasonix added 2 commits May 22, 2026 21:27
…t flow

Two related sidebar bugs:

1. The session list was unfiltered — users with thousands of subagent
   transcripts (`subagent-sub-*.jsonl`) and cross-workspace sessions
   in `~/.reasonix/sessions/` saw 10 000+ entries. The CLI's session
   picker already uses `listSessionsForWorkspace(currentRootDir)`;
   the dashboard's GET /api/sessions handler now does the same when
   `ctx.getCurrentCwd()` is wired. Also surface `meta.summary` in the
   listing so the bridge stops falling back to bare session names.

2. Clicking "new chat" pushed an error card into the transcript via
   `$session_empty` ("loaded with no messages") and never updated
   state.currentSession, which left #1586's URL mirror pointing at
   the old session. The new endpoint echoes the freshly-minted
   session name, and the bridge fires a real `$session_loaded` with
   empty messages so the reducer resets cleanly and the URL flips.

Sessions-ops test grows by two cases covering each behaviour.
Squash-merges a chain of fixes prompted by post-#1418 user feedback on
the live web dashboard. The unifying themes: nothing should change
when you don't expect it to (token, port, URL, SSE stream), and
everything should give visible feedback when you do change it.

Server
- POST /api/sessions/new now echoes the new session name so the bridge
  can update state.currentSession without diffing the list.
- parseTranscript surfaces reasoning_content, tool_calls, and tool
  results (by tool_call_id) so historical replays show what the model
  actually did, not just the raw text turns.
- serveAsset injects ?token=... into CSS url() font references in
  addition to the existing JS-import rewrite — the previous gap 401'd
  every Geist / KaTeX font fetch.
- New /api/browse?path= lists immediate subdirectories (Windows drive
  letters included on first call) so the web runtime can ship a real
  directory picker.
- startDashboardServer exposes updateContext(ctx) — the handle now
  outlives a chat.tsx-driven App remount, and the new App rewires its
  loop/refs in place instead of forcing a port rebind that the OS
  hadn't released yet (EADDRINUSE -> ephemeral fallback -> new URL).
- Dashboard token + actual bound port are persisted to config.json on
  first run via ensureDashboardToken / saveDashboardPort, with an
  EADDRINUSE fallback to ephemeral. /dashboard reset-token rotates
  the token and restarts the server.

CLI
- listSessions workspace filter now reaches the dashboard's GET
  /api/sessions, cutting sidebar entries from "every subagent
  transcript on disk" (10 000+ for active users) down to the current
  workspace's chats.
- getDashboardUrl appends &session=<name> so the printed URL points
  at the attached session and survives copy/paste.

Dashboard UI
- Persistent module-level dashboardHandle + eventSubscribers Set so
  React App remounts (session swap) don't tear the server down and
  don't drop SSE subscribers on the floor — fixed the "send a message
  after switching, web stays silent" desync.
- session_load bridge handler emits $session_loaded with the new
  name and full segments (text + reasoning + tool calls stitched to
  results), instead of pushing an error card via $session_empty.
- Thread renders use index-based React keys for AssistantMsg —
  replayed transcripts arrive with turn=0 for every assistant row,
  so the turn-keyed list was collapsing every assistant message into
  one stale slot on every session switch.
- Sidebar gets a per-row loading spinner; thread shows a centered
  overlay during the swap so big sessions don't look dead.
- CSS containment on .session-item, .msg, and .thread; dropped a
  needless backdrop-filter on the loading overlay. Together these cut
  the Paint/Layout/pointerover budget noticeably on long transcripts.
- New WorkdirInputModal backed by /api/browse — the web build
  previously stub'd openDialog to "" so clicking Browse did nothing.
- Removed the "+ new tab" affordance from the tab bar (web has no
  multi-tab story).
- URL session mirror from #1586 reverted to read-on-mount only so
  clicking a session doesn't churn the address bar.

i18n
- statusbar.themeStyle{Graphite,Sandstone,Porcelain,Midnight}
- settings.themeStyle* + Desc, settings.page* Label + Desc for all 8
  pages, sidebarPanel.loading, workdir.{cancel,go,goTip,loading,
  emptyDir,openHere,pathPlaceholder}, handlers.dashboard.tokenReset*
  (en and zh-CN where relevant).

Tests
- tests/dashboard-token-persistence.test.ts (9 cases) for
  ensureDashboardToken / saveDashboardPort / clearDashboardToken.
- dashboard-sessions-ops gains coverage for the workspace filter
  and the new POST /sessions/new name echo.
- dashboard-smoke verifies CSS font url() token injection in
  addition to the existing JS chunk-import rewrite.
@esengine esengine merged commit ff4032c into main May 23, 2026
4 checks passed
@esengine esengine deleted the feat/dashboard-polish-stability branch May 23, 2026 08:00
esengine pushed a commit that referenced this pull request May 24, 2026
…moved, persisted usage stats, plan dispatch gate

Headline themes:
- Desktop: bundle the CLI-hosted React dashboard, retire Tauri+Preact duplicate (#1418)
- Config: drop preset abstraction; flash/pro are direct model selections (#1657, #1630)
- Stats: persist cumulative usage to session meta + auto-restore on startup (#1667, #1680, #1643, #1628)
- Plans: editMode="plan" enforced at the ToolRegistry dispatch gate (#1681); step advance fix (#1629)
- Context: fold once at turn start, drop pre-flight + byte-ceiling (#1642, #1646); collapsible compacted card (#1649)
- Subagents: per-skill flash/pro override + Settings UI (#1632)
- Desktop polish: sidebar drag-resize (#1688), responsive collapse (#1585), copy/edit overlay + msg-history nav (#1645), Esc closes modal not turn (#1685), QQ tab isolation (#1672), DiffCard for edits (#1662), theme-aware highlighting (#1655), system events toggle (#1654/#1650), macOS TCC inheritance (#1614), dashboard.enabled (#1612)
- Dashboard polish: persistent session URL (#1586, #1589, #1599), theme-aware highlighting (#1664), IME confirm-enter guard (#1689), code-fence lang fix (#1677), vendor chunk split (#1587), markdown table h-scroll (#1562)
- TUI: Alt+S input stash/recall; static history isolated from input rerenders (#1635); legacy mouse drop (#1637, #1648); multi-edit gated in review (#1647)
- Diff: SplitDiff column border holds under CJK (#1686)
- MCP: workspace roots passed to servers (#1625); codeCommand honors mcpServers (#1603)
- Config plumbing: (baseUrl, apiKey) resolved as a tuple (#1658); stale model id self-heal (#1663)

See CHANGELOG for the full list.
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