Skip to content

Phase 33 slice D: the inspector and comments, rebuilt and live - #267

Merged
vicmaster merged 2 commits into
masterfrom
phase-33-slice-d
Nov 24, 2026
Merged

vicmaster merged 2 commits into
masterfrom
phase-33-slice-d

Conversation

@vicmaster

Copy link
Copy Markdown
Owner

Fourth slice of Phase 33. It rebuilds the detail page's inspector and the comment flow to design screens 2 and 4. It also makes the inspector, the comments and their counts update while the page is open.

What changed

  • The Quality tab leads with what holds a design back.
    • The score shows as "95 / 100" with an At the bar or Below the bar chip.
    • A reason line follows, such as "Coverage holds it back: …".
    • The categories run lowest first.
    • The issues are grouped the way canvas_evaluate groups them for agents ("28 findings in 9 groups"), errors first. Each row is "Category · kind" (the cliché tell, auto-fixable, or the severity), then the message, then a Show n nodes link that outlines those nodes in the preview.
    • The provenance and vision-critique chips moved off the toolbar into this tab, as "Built from …" and "Vision critique NN/100".
  • Design system and Feedback keep their content in the new style. The disabled "Import" tab, a placeholder since Phase 19, is gone. The tabs are real tab buttons and work with the arrow keys.
  • Comment opens a popover under the button.
    • Clicking an element in the preview pins the comment to it, and chips let you widen the anchor up to the whole page.
    • With no click, the comment is about the whole page.
    • Saving switches to the Feedback tab, and deleting a comment asks in a dialog first.
  • The inspector refreshes on its own.
    • /api/canvas/:id/meta gains a feedbackKey, and a new route, GET /canvas/:id/inspector, returns the panels and the node index.
    • When the agent edits the canvas, the score and panels update. When it resolves a comment with resolve_feedback, the comment moves to Resolved and the counts drop. Neither needs a reload.
    • The selected tab, the scroll position and an open comment draft all survive the refresh.
    • A failed fetch is retried on the next poll, and an older response never replaces a newer one.
  • The old score grades and the green, amber and red bars are deleted.
  • The README describes the new Quality tab, the comment flow, the new route and live refresh.

Two deliberate narrowings

  • The "Built from" line shows structure, genre and preset, as the spec says. The old toolbar chip also showed the alignment and density axes, which no longer appear.
  • Each issue's suggestion is now the row's tooltip instead of visible text, as the approved design shows. Agents still get it from canvas_evaluate. A keyboard or touch user can no longer read it in the viewer.

Tests

  • New:
    • test/unit/test-viewer-quality.ts (16 checks): the chip, the reason line, the category order, the folded counts, the order and kind of each row, and the critique row.
    • test/browser/test-viewer-inspector.ts (29 checks): the tabs and keyboard; Show n nodes; the popover for page-level and pinned comments, Escape, and deleting through the dialog; and the live panels, including a failed fetch being retried and a comment flagged "node gone" after an edit removes its node.
    • test/e2e/test-viewer-live-mcp.ts: drives the real MCP server. A comment resolved with resolve_feedback and an edit made with batch_design both show on an open page without a reload. The test pins the embedded viewer's port, so it never touches a viewer you have running.
  • Rewritten: test-viewer-panels.ts (inspector markup), test-eval-cache-key.ts (it reads "Built from" instead of the toolbar chip), and the delete-dialog selectors in test-viewer-detail.ts, now that the page has two dialogs.
  • Results:
    • The unit tier passes 100/100.
    • All six viewer browser tests and both viewer e2e tests pass.
    • The test type-check is clean.

Verification

An independent verifier found no major issues. It checked:

  • the score, reason, ordering and grouping rules;
  • the popover flow;
  • the live refresh, by probe: the selected tab, scroll position and draft survive;
  • escaping, by trying a script-tag payload in canvas names, node names, provenance and comments;
  • both themes against the design images.

Its minor findings are fixed in the second commit:

  • a failed fetch could leave the panels stale until the next edit;
  • an older poll response could replace a newer one;
  • the "node gone" badge did not update after an edit;
  • a Show n nodes button could fall out of step with its outline;
  • focus was lost after Cancel, Save and Delete;
  • a scoring failure read as "empty canvas".

The docs audit's README corrections are in the same commit.

Phase 33 slice D. The Quality tab leads with the score against the bar and a
reason line, then the categories lowest first and the issues grouped as
canvas_evaluate groups them for agents, each with a "Show n nodes" link.
Design system and Feedback are restyled, and the Import placeholder is gone.
Comment opens a popover under the button, and a click in the preview pins
the note. The panels, comments and counts refresh while the page is open.
Retry a failed panel or comment fetch on the next poll instead of dropping it, let the newest response win, flag comments whose node an edit removed, keep a Show n nodes button in step with its outline, return focus after Cancel, Save and Delete, tell a scoring failure from an empty canvas, and describe the new inspector and comment flow in the README.
@vicmaster
vicmaster merged commit 1ba233a into master Nov 24, 2026
3 checks passed
@vicmaster
vicmaster deleted the phase-33-slice-d branch November 24, 2026 19:43
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