Commit 192c0a6
committed
feat(dashboards): resumable chat across navigation/reload + editable Source view
Generation state (chat, streaming steps, the built config) moves out of
DashboardWorkspace's component-local useState into a new
useDashboardChatStore, keyed by dashboard id (or new:<connectionId> before
the first save, with an alias/rekey scheme for the transition). Navigating
away no longer aborts the in-flight SSE stream, and on mount, if the
persisted dashboard's generationStatus is RUNNING (a turn was in flight
when this tab wasn't around, per the paired backend commit), the store
polls until it resolves instead of assuming nothing is happening.
Also adds:
- A Source/Preview toggle with an uncontrolled Monaco HTML editor
(defaultValue + remount key, not a controlled value — a controlled value
rewrites Monaco's model on every keystroke, resetting the caret mid-word).
Apply re-derives the dashboard's title from the edited <title>/<h1> so a
manual rename actually propagates to the breadcrumb/gallery, and is
disabled while a generation is in flight to avoid racing the backend's
own write of the same config.
- A Queries panel: DashboardArtifact now reports every query the artifact
runs (SQL, row count or error, timing) via a new onQuery prop, wired to a
side panel with copy-to-clipboard. dashboardQueryAPI.run now surfaces the
backend's actual error message instead of axios's generic "Request failed
with status code 400" (the interceptor only reads response.data.message;
this endpoint's payload uses `error`).
- generateStream's fetch is aborted proactively on the page's `pagehide`
event and the resulting failure is dropped rather than surfaced as a
chat-history error: a reload/close tears down the request as a bare
TypeError, indistinguishable in shape from a dead backend, which would
otherwise get permanently written into the saved chat on every reopen.1 parent c325b5b commit 192c0a6
6 files changed
Lines changed: 849 additions & 148 deletions
File tree
- src
- components
- sections
- lib
- api
- stores
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
| |||
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| 133 | + | |
127 | 134 | | |
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
133 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
134 | 145 | | |
135 | 146 | | |
136 | 147 | | |
| |||
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
148 | 161 | | |
149 | 162 | | |
150 | 163 | | |
| |||
0 commit comments