Repository navigation
feat(dashboard): keep or discard a staged dashboard page from the tab - #19922
Conversation
8ecd055 to
cadef9a
Compare
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] a99996a Description read[DESCRIPTION-READ] 8d1959fd21b2a6af745d67b07474cc7855d896f5c55cd3bbe4e3910d22f0f87f That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The person-facing Keep button reverses a recorded "no Apply control here" decision, and the only support offered is a maintainer request nobody can check. Not justified as shipped
What this change shipsInventory (8 items) — 7 justifiedIntent: let a person keep or drop a crewmate's staged dashboard page from the tab, then see the live page. ADDITION, plus a FIX for the stuck "preview closed" notice.
[FIRST-PRINCIPLES-REVIEWED] a99996a Description read[DESCRIPTION-READ] b793d49b18d55751b6ef11ab4de303ff7bd14823d60f980725ba62dfb94069e3 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Keep and Discard look dead until the page has loaded, and "Preview ended" doesn't say whether the draft was kept. Both left the blind reader unsure what had happened. Watch
Suggestions
[UX-REVIEWED] a99996a Description read[DESCRIPTION-READ] 9101958de819835a647d79d17501ad3b969a83d45c4238149022cc1916578481 That sha256 names everything this verdict read: the PR description, plus the 16 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
cadef9a to
beec013
Compare
beec013 to
5bc96a9
Compare
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
5bc96a9 to
70ab632
Compare
70ab632 to
19062b1
Compare
be758ef to
827790d
Compare
|
span=9ee7cf952f89 · disposition: rebutted
|
|
span=32ba8c05f1c7 · disposition: rebutted
|
|
span=06436cdfb7af · disposition: deferred
|
|
span=b9f3f14ac808 · disposition: deferred
|
|
span=903fbb8cd89d · disposition: deferred
|
827790d to
a99996a
Compare
|
span=a35ee02efb90 · disposition: needs-a-decision
|
|
span=e940114429e2 · disposition: deferred
|
|
span=0989cc78d9c1 · disposition: rebutted
|
|
span=5e0cfbd8576d · disposition: rebutted
|
|
span=93c2969bbb6d · disposition: deferred
|
Problem / Motivation
Goal: A person looking at a crewmate's staged dashboard page can keep it or drop it with one click, and then sees the live page right away.
A crewmate stages a page with
dashboard_previewand sends a link. The link opens the Dashboard tab on the staged page, but there is no button to keep it. The only way is to say yes in chat and wait for the crewmate to calldashboard_apply.After the page is applied, the tab keeps saying "This preview has closed. It was applied or it expired." The URL still asks for the preview (
?dashboard=preview), so the tab never shows the live page.Why it matters
Every person who opens a preview link hits both. They have nothing to press, and after a yes in chat they are left on a closed notice instead of the page they just chose.
Not a goal
dashboard_rollback.What changed (motivation → approach → change)
Premise: the maintainer asked for this exact shape: open the preview, press Keep, done, and after Keep the tab refreshes to the live page. The chat "yes" path stays for the crewmate.
The buttons sit in the host chrome above the sandboxed frame, so the staged page can never press them.
Both buttons act only on the page on screen. The preview read returns the staged page's
staged_ms; the host sends back the stamp of the document the frame has loaded and that sent its ready beacon (both buttons stay disabled until then), and the store refusespreview_changedinside the instance lock if another page was staged since. Keep runs the sameapply_previewwriter asdashboard_apply; Discard runsdiscard_shown_preview.The routes
POST /api/members/{slug}/dashboard/preview/applyand.../preview/discardcarry the lock route's gates in its order: an internal-secret caller is refusedhuman_only(one helper the three routes share), then the member checks, then the owner gate; CSRF is the shared middleware. Locked answers 423dashboard_locked, nothing staged 404no_preview; Discard reads back and only answers ok when nothing is left to install.The hand-over: when the staged page is gone for any reason (Keep, Discard, the agent's apply, expiry), the host drops the cached live read, leaves preview mode at once (removing
dashboard=previewon/members) and mounts the live page under one note. The frame reports "nothing staged" only after its own read settles and draws nothing for it while a host listens, so no closed screen flashes; a later preview link reopens the staged page in both hosts.Copy: the hint says Keep replaces the current page and the crewmate can restore it; "Discard can't be undone." sits under the buttons. A refused or failed request, the lock refusal included, is an
ErrorNoticein the tab's own words. A Keep refused because a newer page was staged redraws it and says so through the sharedStatusNotice(warn): nothing was written and the next step is the ordinary Keep. After Keep the note adds the undo line; any other hand-over says "Preview ended. This is the live page now." Thedashboard_previewreply and the dashboard skill tell the crewmate the person may press Keep or Discard, so it re-reads[DASHBOARD]beforedashboard_apply.Composed packages: a preview read without
dashboard=serves only the staged template page and Keep only installs a staged template, so a bound package never reaches Keep; a test pins that.Where it lives: routes in
src/kiro_crew/dashboard/handlers/member_dashboard.py(registered insrc/kiro_crew/dashboard/server_runtime/mcp_routes.py);staged_mschecks,discard_shown_previewand the refusals insrc/kiro_crew/dashboard_templates/instance.py; the agent's text insrc/kiro_crew/mcp_panel.pyandsrc/kiro_crew/builtin_skills/dashboard/SKILL.md; client calls inwebsite/src/api/client/agents.ts; the drawn-page stamp inCrewDynamicDashboard.tsx; buttons, note and hand-over inwebsite/src/pages/chat/DashboardPreviewActions.tsx, used byCrewDashboardTab.tsxandDashboardPreviewPanel.tsx; the re-open signal inwebsite/src/utils/dashboardPreview.tsfromwebsite/src/hooks/usePanelDocumentActions.ts; strings inwebsite/src/i18n/locales/*.json(en-XA regenerated);docs/system-specs/modules/dashboard-instances.mdanddocs/feature-map/README.md.Backwards compatibility
Compatible: two new routes and a new optional
staged_mson the preview read;apply_preview's new keyword defaults to the old behaviour, sodashboard_applyis unchanged.Removes nothing: the "closed" notice still renders where no host listens for it; the preview read, the agent routes and the lock route answer as before.
Tests
test/test_dashboard_preview_keep.py: Keep installs the staged page and broadcasts the change; refuses a page staged after the one shown, a locked layout, nothing staged, a badstaged_ms; Discard drops the shown page, keeps one staged since (409), needs a validstaged_ms, is idempotent, and does not claim success when the page stays staged; an internal-secret caller and a non-owner are refused for both routes; the real owner gate admits only the owner; a bound composed package never reaches Keep; the deferred binder registers both routes.website/src/test/CrewDashboardTab.keep.test.tsx(real router, URL read back): Keep → route called with the staged page → URL has nodashboard=preview→ the live read ran → the kept page is mounted → no "closed" state; Keep and Discard do nothing until the frame has loaded the page and it beaconed; Keep names the mounted page, not a newer read still being minted; the agent-apply path hands over the same way, with no undo line; a later link shows the newly staged page; the server's lock refusal is an error; a failed Keep stays on the preview; Discard; no buttons on the live page.DashboardPreviewActions.test.tsx: Keep and Discard are alone on their row; a click before the page is drawn does nothing; a failed Discard is an error; a 500 on Keep is anErrorNotice, never the status notice; a newer staged page refuses Keep, says so in a warnStatusNotice(role=status,data-tone=warn, no alert) and redraws the preview.DashboardPreviewPanel.test.tsx: buttons sit outside the frame and post nothing until pressed; Keep hands over to the live page; a session preview has no Keep; an expired preview hands over; a re-opened link returns to the staged page.MembersPage.test.tsx: an agent-applied preview dropsdashboard=previewand shows the live page with the note.CrewDynamicDashboard.test.tsx: the frame draws nothing for "nothing staged" when the host listens.test_dashboard_server_composition_contract.py: route table and boot order pins updated for the two routes.Determinism:
test_dashboard_preview_keep.pypassed 3× under xdist and once in a shuffled order (seed 7,-n0); the three frontend files passed 3× with--sequence.shuffle. The "staged again" cases pininstance._now_msinstead of sleeping.Manual verification
Ran a Playwright capture against the real
MembersPageand the realDashboardPreviewPanel(gateway-free, every/api/call answered by fixtures): Keep and Discard enabled only after the page loaded and beaconed, and sent itsstaged_ms; after Keep the URL droppeddashboard=preview, the live page was re-read and the note says "Kept"; after Discard the old live page is back under "Discarded"; a failed Keep or Discard stays on the preview with the error under the buttons; a newer staged page redraws the frame; a page the agent applied, and one that expired, hand over under "Preview ended"; a locked layout refuses Keep in the badge words. No closed screen in any scene.Screenshots / video
Before Keep (dark): the staged page with Keep and Discard above the frame.
After Keep (light): the live page, the URL without
dashboard=preview, and the note with the undo line.After Discard (dark): the old live page is back under "Discarded. The live page didn't change."
A newer page was staged after the look (light): Keep is refused, the frame redraws to the newer page, and a warn
StatusNoticesays Keep now keeps it.A failed Keep and a failed Discard (dark): the error sits under the buttons and the preview stays.
The preview expired while open (dark): the old live page stays, under "Preview ended. This is the live page now."
The layout is locked (dark): Keep is refused with the tab's own lock words, and the preview stays.
More: the agent applied it, the chat side panel, the other theme
The crewmate applied the page while it was open (light): the tab hands over under "Preview ended".
The chat side panel (dark), before and after Keep.
Related Issues
Closes #19900
Checklist