Skip to content

refactor(chat-core): drop ChatPage's duplicate stop_event / notice / mcp_oauth rows (P5-c) - #9577

Merged
iamwhatever merged 1 commit into
mainfrom
refactor/chat-core-p5c-shared-renderers
Sep 9, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
refactor/chat-core-p5c-shared-renderers

Conversation

@CrysisDeu

Copy link
Copy Markdown
Contributor

Closes #9571 — chat-core RFC (docs/request-for-change/rfc-chat-core-extraction.md) phase P5-c.

Summary

After P5-b (#8733) ChatPage.tsx still re-registered three rows the SDK default registry (app-sdk/messageRenderers.tsx) already draws from the same component and the same inputs:

host entry ChatPage drew defaultMessageRenderers draws
stop_event <StopEventCard key={meta.id ?? ctx.key} message={m} /> ctx.row(<StopEventCard message={m} />)
notice <NoticeCard key={ctx.key} content={m.content} /> ctx.row(<NoticeCard content={m.content} />)
mcp_oauth <div key>{renderMcpOAuthMessage(m, connectionsUiOn)}</div> ctx.row(renderMcpOAuthMessage(m, ctx.hideCardOwnedOAuth))

ChatPage's ctx.row is a keyed <Fragment> and its ctx.hideCardOwnedOAuth is already connectionsUiOn, so each pair rendered identically (the OAuth entry differed by one bare <div> inside the row's px-4 … py-1 block). These copies were the last places a shared row was wired a second time on one surface — the drift class that once shipped mcp_oauth wired in app-sdk and raw on the main chat.

Correction to the brief that scheduled this slice: ChatPane / Crew Members DM already rendered these three rows through the SDK defaults, and ChatPage has no artifact-specific renderer (handleArtifactOpen / artifactPaths are assistant-bubble props). transcriptRenderers.test.tsx also already pins that the factory keeps no second stop_event copy. So P5-c is a deletion on ChatPage, not an addition to createTranscriptRenderers — a third copy would be the opposite of the RFC's goal.

Changes

  • website/src/pages/ChatPage.tsx: delete the stop_event, notice, mcp_oauth host entries and the StopEventCard / NoticeCard / renderMcpOAuthMessage imports; drop connectionsUiOn from the renderer memo's deps (it still feeds ctx.hideCardOwnedOAuth). Precedence comment updated.
  • website/src/pages/chat/transcriptRenderers.tsx: header comment no longer lists the stop/OAuth rows as page-only.
  • website/src/test/chatRolesParity.contract.test.ts: new PAGE_OVERRIDE_IDS (only undrawn) + a test that rejects any page-written entry reusing another default id, and asserts the three imports are gone.
  • website/src/test/ChatPage.mcpOAuth.test.tsx: rewritten for the new shape — default registry claims mcp_oauth, page does not shadow it (no mcp_oauth entry, no banner import, only hidden_invisible_assistant as a '*' entry), hideCardOwnedOAuth: connectionsUiOn reaches the registry through ctx.
  • website/src/test/NoticeCard.test.tsx: the registry-wiring test now pins the absence of a page notice entry.
  • RFC §4.2: P5-a (refactor(chat-core): dispatch ChatPage's transcript rows through the renderer registry #8713), P5-b (refactor(chat-core): one dashboard row set -- ChatPage spreads createTranscriptRenderers #8733), P5-c rows.

Resolution-order note: with the page's stop_event gone, the registry's shape-matched default sits first in the merged list (ahead of the shared spread) instead of after it. The only shared entry that could have claimed a stop row first is subagent_completion, whose predicate never matches a stop envelope, so no row resolves differently.

Evidence (real pod, light + dark)

Same fixture transcript (stop card, two notice rows, three OAuth banner states: expired-after-reload / authenticated / expired) seeded into the main chat and a Crew Members DM on a pod built from origin/main and one built from this branch.

Main chat — before (main) vs after (branch). Pixel diff of the transcript column: 0 differing pixels in both themes; the only full-page differences are the top-bar clock/update chip.

before (main) after (this PR)
light
dark

Crew Members DM (ChatPane) on this branch — stop card, notice cards and OAuth banners, drawn by the same registry defaults the page now reads:

light dark

The notion banner carried a live oauth_url in the fixture but renders as expired on both pods: the persist-side redaction blanks the URL on reload (pre-existing behaviour, unrelated to this PR). A live "Authorize" banner needs an in-session OAuth request, which the fixture cannot produce.

Verification

  • npx tsc --noEmit clean; npx eslint clean on every touched file.
  • Tests updated, not run locally (CI runs them). No new copy, no i18n change.

@CrysisDeu
CrysisDeu requested a review from a team September 8, 2026 23:25
@CrysisDeu CrysisDeu added refactor Internal restructuring with no behavior change area: dashboard Dashboard UI and its backend handlers labels Sep 8, 2026
@CrysisDeu
CrysisDeu requested review from a team and cixuuz September 8, 2026 23:25
@CrysisDeu CrysisDeu added refactor Internal restructuring with no behavior change area: dashboard Dashboard UI and its backend handlers labels Sep 8, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of bc2ad839aa97b2923a880c2d318644c5fb4fe4b8 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Deletes a proven-identical duplicate, and the new parity contract pins the whole drift class shut, not just these three ids.

I verified the load-bearing claims independently: mergeRenderers does hoist the shape-matched stop_event default ahead of the shared spread, and the only '*' entry in createTranscriptRenderers is the subagent-completion row, so the PR's resolution-order note holds; hideCardOwnedOAuth: connectionsUiOn is wired in renderMessage's ctx with the dep retained, so dropping it from the renderer memo is correct. The rewritten tests still guard the original regression (banner reachable, suppression flag from the shared hook) — they pin the same user-visible behavior through the consolidated path, so the old pins were honored, not discarded. Pixel-diff evidence and the same-commit RFC update close the loop.

[DESIGN-REVIEWED] bc2ad83

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of bc2ad839aa97b2923a880c2d318644c5fb4fe4b8 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All claims verified: the default registry draws the three rows from the same components, ctx.row is a keyed Fragment passthrough (ChatPage.tsx:5854), connectionsUiOn still feeds ctx.hideCardOwnedOAuth in renderMessage with correct deps (5846/5861), mergeRenderers confirms the declared ordering shift, isSubagentCompletionMessage rejects stop envelopes by role, only undrawn collides with a default id, and the screenshot directory follows an established convention. Final review:

First-Principles-Verdict: PASS

Author states tests were "updated, not run locally" — the rewritten source-contract pins are regex-fragile, so confirm CI green before merge.

What this change ships

Inventory (8 items) — 8 justified

Intent: delete ChatPage's last three private copies of rows the shared SDK registry already draws identically (chat-core RFC P5-c, #9571) — a FIX (removal of duplication), not an addition.

  1. Main chat's stop card, notice rows and OAuth banner now come from the shared registry defaults; the page copies are deleted, with zero pixel change — justified
  2. Stop rows now resolve ahead of the shared row set instead of after it — justified
  3. The OAuth banner row loses its bare <div> wrapper — justified
  4. CI now rejects any future page-local override of a shared row id; the allowlist holds only undrawn — justified
  5. The old test pin ("wiring stays explicit") is reversed to pin the absence of page entries — justified
  6. The renderer memo no longer rebuilds when the Connections-UI flag flips — justified
  7. The RFC phase table gains the merged P5-a/P5-b rows and this P5-c row — justified
  8. Six before/after evidence screenshots under .github/screenshots/p5c-shared-renderers/ — justified

Subtractions

  • Drop the three absence pins at the end of chatRolesParity's new test (import StopEventCard from, import NoticeCard from, \brenderMcpOAuthMessage\b) — each is a second spelling of a pin this same PR writes elsewhere (renderMcpOAuthMessage absence: 2 files, ChatPage.mcpOAuth.test.tsx:242 + chatRolesParity.contract.test.ts; import NoticeCard absence: 2 files, NoticeCard.test.tsx + chatRolesParity), and the generic privateCopies check in the same test already covers the entry ids.

[FIRST-PRINCIPLES-REVIEWED] bc2ad83

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of bc2ad839aa97b2923a880c2d318644c5fb4fe4b8 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

The blind read confirms the before/after screenshots render the transcript identically in both themes, and the diff is a pure renderer-deduplication with no user-facing string, control, or state added or changed. Nothing in the blind reader's confusions traces to this PR's surface — all pre-existing UI.

UX-Verdict: PASS

Behavior-preserving deletion of duplicate renderers; blind reader confirmed before/after transcripts match word-for-word in both themes, so nothing a user sees changed.

[UX-REVIEWED] bc2ad83

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed bc2ad839aa97b2923a880c2d318644c5fb4fe4b8 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] bc2ad83

Verdict parsed from the review's SHA-scoped output markers for commit bc2ad839aa97b2923a880c2d318644c5fb4fe4b8.

False positive or not applicable? A repository writer can comment:
/ai-review override fable bc2ad839aa97b2923a880c2d318644c5fb4fe4b8: <one-sentence reason>

…mcp_oauth rows (P5-c)

After P5-b (#8733) ChatPage still re-registered three rows the SDK default
registry already draws from the same component and the same inputs:
`stop_event` (StopEventCard), `notice` (NoticeCard) and `mcp_oauth`
(renderMcpOAuthMessage behind ctx.hideCardOwnedOAuth, which the page
already sets to connectionsUiOn). ChatPage's `ctx.row` is a keyed
passthrough, so the page's copies and the defaults rendered identically;
the copies were the last places a shared row was wired a second time on
one surface -- the drift class the P1 parity contract exists to close.

Delete the three host entries and their imports; the rows resolve to the
registry defaults, exactly as they do in ChatPane (split panes, Crew
Members DM). Pin it: chatRolesParity.contract.test.ts now rejects any
page-written entry that reuses a default id other than the documented
`undrawn` narrowing, and the two source-contract tests that pinned the
old copies (ChatPage.mcpOAuth, NoticeCard registry wiring) pin the new
shape instead. RFC §4.2 records P5-a/b/c.

Evidence (real pod, main vs branch, light + dark): the main-chat
transcript column is pixel-identical before/after; the Crew Members DM
draws the same stop card, notice cards and OAuth banners.

Closes #9571
@CrysisDeu
CrysisDeu force-pushed the refactor/chat-core-p5c-shared-renderers branch from ea99006 to bc2ad83 Compare September 8, 2026 23:47
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of bc2ad839aa97b2923a880c2d318644c5fb4fe4b8 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] bc2ad83

False positive or not applicable? A repository writer can comment:
/ai-review override gpt bc2ad839aa97b2923a880c2d318644c5fb4fe4b8: <one-sentence reason>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 9, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) September 9, 2026 01:04

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: refactor (12 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: code-move only -- deletes ChatPage's private stop_event / notice / mcp_oauth renderer entries so all three rows come from the shared app-sdk default registry that already draws them from the same component and inputs; no behaviour change. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/request-for-change/rfc-chat-core-extraction.md.

@iamwhatever
iamwhatever merged commit 50fd665 into main Sep 9, 2026
65 checks passed
@iamwhatever
iamwhatever deleted the refactor/chat-core-p5c-shared-renderers branch September 9, 2026 01:04
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 9, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…mcp_oauth rows (P5-c) (kirodotdev#9577)

After P5-b (kirodotdev#8733) ChatPage still re-registered three rows the SDK default
registry already draws from the same component and the same inputs:
`stop_event` (StopEventCard), `notice` (NoticeCard) and `mcp_oauth`
(renderMcpOAuthMessage behind ctx.hideCardOwnedOAuth, which the page
already sets to connectionsUiOn). ChatPage's `ctx.row` is a keyed
passthrough, so the page's copies and the defaults rendered identically;
the copies were the last places a shared row was wired a second time on
one surface -- the drift class the P1 parity contract exists to close.

Delete the three host entries and their imports; the rows resolve to the
registry defaults, exactly as they do in ChatPane (split panes, Crew
Members DM). Pin it: chatRolesParity.contract.test.ts now rejects any
page-written entry that reuses a default id other than the documented
`undrawn` narrowing, and the two source-contract tests that pinned the
old copies (ChatPage.mcpOAuth, NoticeCard registry wiring) pin the new
shape instead. RFC §4.2 records P5-a/b/c.

Evidence (real pod, main vs branch, light + dark): the main-chat
transcript column is pixel-identical before/after; the Crew Members DM
draws the same stop card, notice cards and OAuth banners.

Closes kirodotdev#9571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: dashboard Dashboard UI and its backend handlers refactor Internal restructuring with no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chat-core P5-c: drop ChatPage's duplicate stop_event / notice / mcp_oauth host entries (the shared registry already draws them)

2 participants