Repository navigation
fix(examples): edit the dashboard that is open, and keep its panel across an edit - #1599
Merged
ankit-thesys merged 1 commit intoNov 10, 2026
Conversation
…ross an edit Two fixes to editing in assistant-ui-dashboards. An edit went to the latest dashboard in the thread, not the one open beside the chat: the chat route only received the messages, so the model could not know which dashboard the user was looking at. Each chat request now carries the open dashboard's artifact id, the route validates it and names it in the system prompt, and the prompt reads "it", "this" or "the dashboard" as the open one when there is one. A dashboard opened from the list beside a new chat can now be edited too. Every edit rebuilt the panel, which reset its filters and scroll position: the edit's card reopened the panel under its own tool call id, and the panel is keyed by that. An edit to the dashboard already in the panel now leaves it mounted; it follows the edit through the stream it shares with the card. All of a dashboard's cards read as open while the panel shows it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
AbhinRustagi
approved these changes
Nov 10, 2026
Contributor
Author
|
Before / after recording (4 min 10 s). First half is the base branch (#1595 head pr1599-before-after.mp4Steps: build dashboard A (npm downloads with a Package filter), build B (zod) in the same chat, reopen A, set the filter to
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1595 (base branch
abhin/dashboards-example-fixes). Two fixes to editing inexamples/miscellaneous/assistant-ui-dashboards, found while testing that PR on dev.1. An edit went to the wrong dashboard
Before: a thread has dashboard A, then B. Open A and ask "add a subtitle to this dashboard". B is edited and the panel switches to B. A dashboard opened from the Dashboards list beside a new chat could not be edited at all.
Why:
/api/chatreceived onlymessages, so the model could not know which dashboard was open, and the prompt said "the dashboard" means the latest one.Now:
components/dashboard.tsxkeeps the open panel's artifact id in a ref (openDashboardId).components/app.tsxsends it with each chat request throughAssistantChatTransport({ body }).app/api/chat/route.tsvalidates it (art_…) and names it in the system prompt.lib/prompt.ts: "it", "this" or "the dashboard" means the open one when there is one, otherwise the latest.2. Every edit reset the panel's filters and scroll position
Before: set a selector to a non-default value, scroll down, send any edit. When the edit lands the selector is back to its default and the scroll is at the top.
Why: the edit's card called
setOpen({ key: toolCallId, … }), and the panel is keyed by that key, so it remounted.Now: an edit to the dashboard already in the panel leaves the panel mounted. It follows the edit through the stream it shares with the card. All of a dashboard's cards read as open ("Close") while the panel shows it.
Verified
On the dev backend, in the browser:
tsc --noEmitis clean for the example.Not tested
🤖 Generated with Claude Code