Repository navigation
fix(dashboard): open a crewmate's staged dashboard preview in the Dashboard tab - #18798
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that #18105 passes the crew name to [DESIGN-REVIEWED] c647b26 Description read[DESCRIPTION-READ] 9f2a5c333bf0c080a0b0d94ee81c5b3fd6583fba89893ca804388d5d1fb44182 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 Members-page preview builds a second host for a staged page that Not justified as shipped
What this change shipsInventory (8 items) — 6 justifiedIntent: a person opens the link a crewmate gives them after
[FIRST-PRINCIPLES-REVIEWED] c647b26 Description read[DESCRIPTION-READ] bc935d19fa0fcd040d786a33120c263eabd9578d9005f393b35bcdf7a40e702d That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The closed-preview notice doesn't say whether the page was kept or lost. On a phone, the preview link opens an overlay that hides the chat the label says to reply in. Watch
Suggestions
[UX-REVIEWED] c647b26 Description read[DESCRIPTION-READ] 22ac403cc28729d77e13d5c7eb5f27514c69ac65a1c0e3635105d0bd9a6c2c66 That sha256 names everything this verdict read: the PR description, plus the 7 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: |
3e9e771 to
0ec07cc
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: |
|
Rebased: main moved in src/kiro_crew/dashboard/handlers/guide.py, test/test_guide_observe.py since this head went green (d3f462f -> d32c084); CI re-running. The new base also clears the stale ui-index.generated.json that turned Build, Build Desktop and E2E (at its Build frontend step) red on the previous head. |
|
|
Frontend Tests (3) red is main's: |
0ec07cc to
3c7232d
Compare
|
|
|
|
|
3c7232d to
b15efea
Compare
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
…page
but only for the /api/members/<slug>/dashboard?preview=1 form. preview_url now
hands out /members?member=<name>&dashboard=preview, so the chat page catches
that form too and resolves its crew name to a slug from the roster; the old form
keeps working for links already in transcripts.
On /members a plain click on either form opens the named crewmate's Dashboard
tab on the staged page, the same place ?dashboard=preview lands, instead of a
second side-panel tab.
Both surfaces draw the staged page under one label, DashboardPreviewLabel
("Preview, not applied"), and one gone notice. The Dashboard tab's own band,
its exit button, its nothing-staged notice and their four strings are removed.
chenmingwei23
left a comment
There was a problem hiding this comment.
Approving. Opening the staged preview inside the Dashboard tab is the right place.
Non-blocking follow-ups:
- Use one preview link shape,
?dashboard=preview, and have thedashboard_savepreview link use the same one, so there is a single way in. - This PR and #19335 both change
member_dashboard.py,CrewDynamicDashboard.tsx,CrewDashboardTab.tsxanddashboardPreview.ts. Let's agree which lands first so the second rebases once.
chenmingwei23
left a comment
There was a problem hiding this comment.
pending for review, need to revoke my approval
chenmingwei23
left a comment
There was a problem hiding this comment.
Re-approving after a second look. The bug is still on main (preview_url still returns the slug-only /api/ link), the PR works with the Feature Preview off so it fits RFC #19609, and all review lanes are green on c647b26. Only open point: it shares four files with #19335, so whichever lands second rebases once.
Problem / Motivation
Goal: The link a crewmate hands out after
dashboard_previewopens a page where the person sees the staged dashboard, labelled as a preview, so they can say whether to keep it.A crewmate called
dashboard_preview, and the person opened the link it returned:/api/members/bi-buddy/dashboard?preview=1. Two things were wrong with it:{"error": "member query parameter required", "code": "missing_member"}, because the link carries only the slug, and slugs are lossy (Crewmate dashboard preview link is refused with missing_member #18768).member=added by hand, the browser shows raw JSON ({"instance_version", "template", "html", ..., "rendered_html"}). Nothing in the web UI drew a staged page; the Dashboard tab reads only the live record (Crewmate dashboard preview link opens raw JSON; no UI renders a staged page #18769).Why it matters
The dashboard flow is "stage a page, show the person, ask, then apply". Every preview link has been dead, so the person had nothing to look at, and the ask before
dashboard_applywas about a page nobody could see.Not a goal
What changed (motivation → approach → change)
The link was built from the slug and pointed at the JSON API, and no page knew how to draw a staged dashboard.
preview_url(dashboard_templates/instance.py) now takes the crew name and builds a page link:/members?member=<name>&dashboard=preview. Thedashboard_previewtool reply (mcp_panel.py) hands it to the agent as a markdown link,[Open the dashboard preview](...), because the chat makes a root-relative path clickable only in that form. The Members page treatsdashboard=previewas "show the staged page": it opens the side panel on the Dashboard tab, and the tab reads the same owner-gated route withpreview=1and draws the result in the same sandboxed frame as the live page;memberDashboardinapi/client/agents.tsgains thepreviewflag for that read.no_preview: applied or expired)member_not_founddashboardquery is dropped; the live page returnsA Playwright spec on the real gateway opens the link the tool returns and checks it lands on the staged page (
docs/ci/e2e-gate.mddescribes it). No new strings ship: the label and notice are #18837's (pages.chat.dashboardPreviewPanel.*), anddashboard-instances.mddescribes the link and the tab.Backwards compatibility
Breaking:
instance.preview_url(slug)becomespreview_url(member), andPreview.wire()now takes the crew name. Writer sweep on origin/main @ d3f462f: the only callers areagent_panel.api_dashboard_preview(passes the session's crew name) andPreview.wireitself; both updated. Open PR #18105 adds a newpreview.wire()call and will need the crew name on rebase. The JSON route and itspreview=1read are unchanged.Reader: src/kiro_crew/mcp_panel.py:_render_preview -- chat (crewmate MCP tool) -- reads
preview_urlfrom the wire as a string; now a page link (test_it_hands_back_the_link_and_says_nothing_changed)Reader: src/kiro_crew/dashboard/handlers/agent_panel.py:api_dashboard_preview -- chat -- passes
crew_nametowire(test_a_staged_template_comes_back_with_its_link)Tests
The end-to-end guard:
website/playwright/dashboard-preview-link.spec.ts. It opens the exact linkdashboard_previewreturns, against a real gateway, and checks both halves. The UI route renders the staged page under the Preview, not applied label. The dashboard read accepts the crewmate the link names (200,preview: true, nomissing_member). The harness (test_playwright_e2e._stage_dashboard_preview) stages the page with the production store and passes the link that store'swire()returns, so the spec never builds the link. It stagesstandup, not the default page, so a tab showing the live page fails. This is the guard against a person being asked to approve a page they could not open. Run locally on an ephemeral gateway: green on this branch (4/4 with--repeat-each=3), and red with the old slug-only/api/link restored (the preview label not found).MIN_EXECUTED_SPECSgoes from 241 to 242 for it.test_the_staged_preview_outlives_the_whole_browser_runpins the 30-minute preview window above the run's ceiling.test_dashboard_tools.py::TestThePreviewLinkIsAPageForOneCrewmate: the link names the crewmate, is a page and never/api/, round-trips names slugification loses (BI Buddy,R&D,a/b?c=d, non-ASCII), and its two query literals matchdashboardPreview.ts.test_agent_panel_routes.py: the preview route's link is/members?member=<crew>&dashboard=preview, built from the crew name.test_member_dashboard_routes.py: thepreview=1read serves the staged page withpreview: trueandrendered_htmland leavesinstance_versionalone; nothing staged is 404no_preview.CrewDynamicDashboard.test.tsx: preview mode reads withpreview=trueand draws the sandboxed frame with no label of its own, a 404no_previewshows the closed notice with no retry and tells the host, any other 404 shows the load-failure notice, and the live page is not marked as a preview.MembersPage.test.tsx: a preview link opens a closed panel on the Dashboard tab in preview mode under the shared label, works with the Feature Preview off, and a closed preview stays on its notice.Determinism: the new frontend tests await the state they assert on and use no timers; the new backend tests use the file's isolated home.
Manual verification
Drove the real
MembersPage(isolated capture entry, gateway stubbed at/api/) with Playwright at the exact linkpreview_urlbuilds, panel closed beforehand. Each shot asserts its state first: the label text, the staged page inside the iframe, apreview=1&member=radarread, and the URL. A 390px shot asserts the label's hint keeps a readable width, and the closed shot asserts the label is gone. The driver iswebsite/scripts/capture-crew-dashboard-preview.mjs. Not run against a live gateway.Screenshots / video
Preview link opened with the panel closed (dark):
Nothing staged any more:
Light theme, and 390px
Related Issues
Closes #18768
Closes #18769
Pattern harvest
Rule candidate: review-prompt
Pattern: a link built for a person points at a JSON API route, or omits a query parameter the route requires; test a user-facing link by the route it opens, not by its suffix.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Rebase + follow-up
Rebased on main to resolve conflicts with #18837, which shipped a chat side-panel preview for the same staged page.
CrewDynamicDashboardtakes both host hooks. A host that passesonPreviewGone(feat(chat): open a staged dashboard preview in the side panel #18837'sDashboardPreviewPanel) draws its own label and gone notice. The Dashboard tab keeps this PR's band, its Show live dashboard button and its nothing-staged notice./api/members/<slug>/dashboard?preview=1. It now also catches/members?member=<name>&dashboard=preview. The name is resolved to a slug from the roster, never guessed. Both forms open the side-panel preview. Each form has its own test indashboardPreview.link.test.tsx./members: a plain click on either form in a crewmate's thread opens that crewmate's Dashboard tab on the staged page. It no longer opens feat(chat): open a staged dashboard preview in the side panel #18837's side-panel preview tab there. Covered inMembersPage.test.tsx.DashboardPreviewLabel) and the same closed notice. The Dashboard tab's own band, its Show live dashboard button, its nothing-staged notice and their four strings are removed, by maintainer ruling. The screenshots above are re-shot withcapture-crew-dashboard-preview.mjs.DashboardPreviewTargetunion with a third kind,member-name, for the/memberspage link; a session's preview keeps feat: root session side panel shows its own Dynamic Dashboard #18105's behavior. The Bundle Size Gate needs no bump here: fix(website): re-measure the App chunk's bundle-size ceiling #19089 re-measured the App ceiling on main.docs/feature-map/README.mdconflicted: main's Crew Members edit and new Crewmate self-change row stay beside this PR's Crewmate dynamic dashboard row. Neither commit changed otherwise.