Skip to content

refactor(website): move ChatPage's views and slot switches to modules - #21054

Merged
bolichen97 merged 1 commit into
mainfrom
refactor/linecap-f04-chatpage-p2
Oct 16, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
refactor/linecap-f04-chatpage-p2

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: website/src/pages/ChatPage.tsx drops from 2,775 to 1,089 lines, under the 2,000-line file cap, with unchanged behaviour. Its JSX regions move into eight view components and its own slot switches into one sibling hook module (step 2 of 2).

After step 1 (#20388) moved the page's hook logic into owners, ChatPage.tsx was still 2,775 lines. About 1,700 of them were one JSX tree, plus the four flows that switch the active session. The campaign rule in #20192 caps a hand-written file at 2,000 lines. The page still had a row in .github/file-line-cap-baseline.txt, so it was the one chat file allowed over the cap.

Why it matters

The chat page gets about 38 commits a week, and each of them edits that single tree: the sessions chrome, the title row, the transcript, the composer dock and the side panels all sit in one return statement. With each region in its own view, a change to the composer dock edits only the dock. The page also leaves the baseline, so the line-cap guard now holds it under the cap the same way it holds every other file.

Not a goal

  • Any behaviour, layout, styling or wording change. Every DOM node, class, test id, a11y attribute and i18n key renders as before.
  • Narrowing the views' interfaces. Each view takes exactly the values its region read in the page, so the wide prop lists (the composer dock reads 175 of them) mirror the page's current dependencies. Trimming them is follow-up work.
  • Moving the hooks that stay in the page: the three controllers, the listbox keyboards and the MCP App auto-open effect each read a value declared after them.

What changed (motivation → approach → change)

The page's return statement was one tree of about 1,700 lines. Its regions are self-contained: each reads page values and renders, and holds no hook. So each region becomes a module-level view component, moved verbatim and handed exactly the identifiers it reads as props. The page keeps the layout skeleton that places the views. A view holds no state, so mounting it in place of its JSX changes nothing React tracks. ChatPage.focusRetention.test.tsx pins that: the composer keeps its DOM node, focus and caret across a parent re-render and the sidebar pin toggle, and its DOM node across a slot switch and back. The same file pins one ordering the page owns: the composer dock renders after the transcript scroller.

View (pages/chat/page/) Renders Lines
ChatPageFrame.tsx the contexts every surface reads, and the root element both drawer swipes bind to 85
SessionsSidebarChrome.tsx the phone drawer and scrim, the desktop toggle and recents flyout, the sidebar or drawer, the phone top bar, the tag popover 342
ChatPaneChrome.tsx the crew-window cover, the screen-snip overlay, the pane notices, the phone sessions opener, the session tab strip 196
ChatEmptyState.tsx the pane with no session open 53
ChatTitleOverlay.tsx the session title row, the pinned-prompt fold sentinel and the pinned prompt 252
ChatTranscriptView.tsx the welcome hero, or the minimap and scroll shell with rows, earlier-messages bar, measurement farm and footer; the restore skeleton 344
ComposerDockView.tsx the floating composer dock (status stack, input area, composer) and the composer toolbar's pop-ups 768
ChatSidePanels.tsx the find pane and the side panel, inline or portaled into the shell's activity column 217

The page's four slot-switching flows move into pages/useChatPageSlotSwitches.ts (357 lines): useSignedLinkAnchor (a signed chat link), useForkSession, useOpenFollowupSession and useOpenSideChatForPane. This module sits beside the page, not under pages/chat/page/, because owners there never switch slots (ChatPage.pageOwners.test.ts pins that). Each hook is called where its statements ran, so effect order is unchanged.

ChatPage.tsx keeps its default export, PREFILL_STORAGE_KEY and the shouldAutoFillOlder re-export. It is the only non-test importer of the views (ChatPage.pageOwners.test.ts pins it) and of the sibling module.

Backwards compatibility

Compatible: pages/ChatPage keeps its module id, default export and named exports, so every importer and every vi.mock('../pages/ChatPage') works unchanged. No view or hook module imports the facade.

Removes nothing: every construct moves into a module the page renders or calls; no route, export, key or behaviour is dropped. The two backend files touched (chat_handlers.py, state.py) change a comment or docstring only.

Tests

New tests (deterministic: no sleeps, no timers):

  • ChatPage.focusRetention.test.tsx: the composer textarea keeps its node, focus and caret across a re-render and the sidebar pin toggle, and its node across a slot switch and back. Keying ComposerDockView on sidebarPinned, messages.length or activeSlot turns it red. It also passes on main. Every step runs inside an awaited act(), so the page's mount queries settle inside the test and the file emits 0 act() warnings under KIROCREW_ACT_STRICT=1. A fourth case, in its own describe, pins that the composer dock root follows the chat-messages scroller in the DOM (that order, not a z-index, paints the dock over the transcript); swapping the two views in ChatPage.tsx turns it red.
  • ChatPage.views.test.tsx (10 tests) and ChatPage.composerDock.test.tsx (7 tests) render the views directly with their children stubbed and assert the actions each wires. The crew-window case loads a fresh ChatPaneChrome (vi.resetModules), so its lazy chunk starts unloaded in any test order, and both chunk waits use a named CREW_WINDOW_CHUNK_TIMEOUT_MS. These cover the branches the page suites rarely reach (a crew window over an embedded pane, the recents flyout, reveal and rename, a popped-out or split-anchored session, the pinned prompt, group approvals, each composer pop-up's close).

Source pins. Assertion logic is unchanged: path re-points, row edits and L30 joins, plus the one granted literal split in scrollShell.recipe. Each pin carries a mutation of its construct in its new home that turns the test red (36 of 36 mutations killed):

  • test/sidePanelMount.test.ts: reads the union of ChatPage.tsx, pages/chat/page/* and pages/useChatPage*, like the 42 files re-pointed in step 1.
  • test/ChatPage.reachability.test.tsx: its negative half (not.toMatch(/trackSession\(\s*activeSlot/)) reads the same union, so the regression shape cannot come back in a view or the sibling (a plant in ChatPaneChrome.tsx or useChatPageSlotSwitches.ts turns it red). Its positive half ("the page must run the bridge") keeps reading ChatPage.tsx alone: over the union, useChatEventBridges({ would also match the hook's own definition in eventBridges.ts, and the check could never fail (hiding the page's call still turns it red).
  • pages/ChatPage.knowledgeNote.test.ts (step 1's own test): its construct did not move (the call site is still in composerSend.ts), but "one call site" now counts over the same union as a negative-half guard, so a second site anywhere in the page is seen (a plant in ComposerDockView.tsx, or removing the real site, turns it red).
  • test/ChatPage.pageOwners.test.ts: the owner scan includes pages/useChatPage*.ts. The pinned order gains useSignedLinkAnchor (in place of the inline signed-token effect it anchored before), useForkSession, useOpenFollowupSession and useOpenSideChatForPane, each at its call position. INLINE is now empty, and a comment says why the list stays.
  • test/ChatPage.handleFork.test.tsx (its "shared action-error notice" describe, added on main by fix(chat): refuse an over-capacity whole fork instead of dropping rows #20992): src reads the same union. handleFork now lives in useForkSession, so the handler slice is found there (its two markers occur once in the union), and the describe's not.toContain halves see every view. Altering the handler's result.code read, or planting fitsAt or setForkError in a view, turns it red. The describe's comment names the handler's new home.
  • store/switchSlotCallsiteClassification.test.ts: five plain sites move from the ChatPage.tsx row to a new useChatPageSlotSwitches.ts row with its reason. The totals (2 announced, 1 keep-target, 6 plain) are unchanged.
  • test/ChatPage.scrollShell.recipe.test.tsx:270 (granted by the campaign's integration owner): one toContain of the combined import becomes two, because TranscriptScrollShell is imported by ChatTranscriptView.tsx and useTranscriptWidth by the page.
  • website/scripts/mutation-check-scroll-shell.mjs (granted): FILES gains the three views that now hold scroll-shell regions. --list finds the same 104 targets and 8 scoped out as before. ComposerDockView.tsx is one of them because it holds the dock root (<div ref={dockRef} … data-testid="composer-dock-root">). That root is the positioned box that floats over the scroller, and everything the view renders lives inside it. Leaving it in the page would split the dock across two files, with the view returning children for a wrapper it does not own.

Edits beyond a verbatim move:

  • useSignedLinkAnchor runs before useComposerDraftLifecycle returns noCarryCreateIdsRef, so it receives a getter, getNoCarryCreateIdsRef: () => noCarryCreateIdsRef. One body token reads getNoCarryCreateIdsRef().current instead of noCarryCreateIdsRef.current. The old closure read the binding when its callback ran, and the getter reads it at the same moment.
  • ComposerDockView.tsx's body is not re-indented. ChatPage.statusStackLayering.test.tsx ends its status-stack match at a newline plus exactly 14 spaces, so re-indenting the dock would make that read-only pin over-match.
  • An import that leaves the page whole takes its own-line leading comment with it: the "Eager: holds the window's isolation guards" note now sits on CrewWindowGuard's import in ChatPaneChrome.tsx. The recipe also collapses the blank-line run the pruned imports leave (the same rule it applies to removed declarations), so the page is 1,089 lines.
  • The lazy CrewChatWindow declaration moves into ChatPaneChrome.tsx, the only file that renders it, and its import path is re-rooted.
  • COLLAPSED_SESSION_TABS_INSET stays in the page beside COLLAPSED_PANE_RECLAIM_PX, which it is derived from and which the page's own pane wrapper reads. ChatPaneChrome receives it as a prop.
  • ChatTitleOverlay and ComposerDockView type activeSlot as string, because both render only in the page's branch where activeSlot is set (after !activeSlot ? <ChatEmptyState …/>).

Two views under 150 lines. ChatEmptyState.tsx (53) is the pane with no session open, a region of its own with its own create-or-retry action. ChatPageFrame.tsx (85) is the provider frame every surface reads. Folding either into a neighbour would give that neighbour a second responsibility.

Docs that named ChatPage as the place a region renders now name its view (26 citations across learn-cron-dashboard.md, docs/feature-map/README.md, stt-streaming.md, prompt-optimizer.md, mcp.md, followup-suggestions-trust-model.md and website/docs/narrow-viewport.md). The owner table in learn-cron-dashboard.md gains a row per view and a paragraph on the sibling hook module, and the feature map's Sessions row lists the views and pages/useChatPageSlotSwitches.ts with the other parts of the page. Comments in src/kiro_crew/dashboard/chat_handlers.py (filteredSlots, defined in chat/page/pageEnvironment.ts) and state.py (the composer's Resume gate, now in ComposerDockView.tsx) cite the new homes.

Citations in comments and notes (L29, path or name only; no code, assertion or test-title changes). Comments that located a construct in ChatPage / ChatPage.tsx that now lives in a view, the sibling or (for a file-path or Component.member locator) a step-1 owner now name that home. A statement about a hook owner's code that still runs inside the ChatPage component stays as it is, and so do citations that were already stale before this series, except one on a line this PR corrects anyway: index.css's data-overflowing note now names useChatPageTranscriptController.tsx, where the attribute is set. test/gui_user/features.json also gains two source rows beside ChatPage.tsx: chat-knowledge-picker-attach adds ComposerDockView.tsx, where KnowledgePicker mounts, and chat-long-history-pagination adds ChatTranscriptView.tsx, where EarlierMessagesBar mounts. test_features_catalog.py validates both. MembersPageThread.tsx (the title-row overlay cite that F07's split moved out of MembersPage.tsx) now names ChatTitleOverlay. state.py:2052, in G04's live file, is relayed to G04, not edited. The chat_handlers.py edit settles S02's relay. The ChatPage.handleFork.test.tsx header now names useForkSession; replacing its hand copy of handleFork with a renderHook(useForkSession) test is a follow-up, not part of this move.

101 rewritten lines in 66 files
  • src/kiro_crew/dashboard/state.py (1)
  • test/gui_user/features.json (3)
  • website/capture/action-row-first-cell-hover.tsx (1)
  • website/capture/loading-indicator-align.tsx (2)
  • website/capture/pinned-prompt-handoff.tsx (4)
  • website/capture/question-card-survives-nudge.tsx (2)
  • website/capture/refused-press.tsx (2)
  • website/capture/steer-bubble-geometry.tsx (1)
  • website/capture/subagent-completion-overflow.tsx (2)
  • website/capture/transcript-row-geometry.tsx (1)
  • website/capture/user-bubble-mobile-overflow.tsx (1)
  • website/capture/workflow-completion-overflow.tsx (2)
  • website/integration/ForkSession.integration.test.tsx (1)
  • website/scripts/capture-filter-input-font.mjs (1)
  • website/scripts/capture-side-panel-dock-flip.mjs (1)
  • website/scripts/capture-sidebar-scrollbar.mjs (1)
  • website/scripts/capture-transcript-row-style.mjs (1)
  • website/src/App.tsx (1)
  • website/src/apps/md-notebook/MdNotebookPage.tsx (4)
  • website/src/components/AgentDropdownList.tsx (1)
  • website/src/components/ChatInput.tsx (1)
  • website/src/components/ChatPane.tsx (2)
  • website/src/components/ProjectPicker.tsx (2)
  • website/src/components/SessionPulseSurveyCard.tsx (1)
  • website/src/components/SessionTabStrip.tsx (1)
  • website/src/components/WelcomeView.tsx (1)
  • website/src/index.css (5)
  • website/src/lib/agentSwitch.ts (1)
  • website/src/pages/PopoutFrame.tsx (1)
  • website/src/pages/chat-sidebar/bulkModelSwitch.tsx (2)
  • website/src/pages/chat-sidebar/scope.ts (2)
  • website/src/pages/chat/PinnedPrompt.tsx (2)
  • website/src/pages/chat/SessionFlyout.tsx (2)
  • website/src/pages/chat/SessionTitleControl.tsx (1)
  • website/src/pages/chat/SubagentCompletionCard.tsx (1)
  • website/src/pages/chat/SubagentRunCard.tsx (1)
  • website/src/pages/chat/WorkflowCompletionCard.tsx (1)
  • website/src/pages/chat/WorkflowRunCard.tsx (1)
  • website/src/pages/chat/crew-window/crewWindowAgentMode.tsx (1)
  • website/src/pages/chat/page/MobileTopBar.tsx (1)
  • website/src/pages/chat/page/composerHost.ts (1)
  • website/src/pages/chat/page/pageEnvironment.ts (1)
  • website/src/pages/chat/page/sessionsDrawer.ts (4)
  • website/src/pages/chat/page/transcriptPaging.ts (1)
  • website/src/pages/chat/page/transcriptRows.ts (1)
  • website/src/pages/members/MembersPageThread.tsx (1)
  • website/src/test/App.topbarCapsule.test.tsx (1)
  • website/src/test/ChatInput.liquidGlass.test.tsx (1)
  • website/src/test/ChatPage.continueGate.test.tsx (1)
  • website/src/test/ChatPage.handleFork.test.tsx (8)
  • website/src/test/ChatPage.pickerAnchorRemeasure.test.tsx (1)
  • website/src/test/ChatPage.responsivePanel.test.tsx (1)
  • website/src/test/ChatPane.headerStacking.test.tsx (1)
  • website/src/test/ProjectPicker.footer.test.tsx (1)
  • website/src/test/SessionControlHostCoverage.test.tsx (1)
  • website/src/test/TranscriptRowGeometry.test.tsx (2)
  • website/src/test/UserMessage.pinnedStandinActions.test.tsx (1)
  • website/src/test/chatSlice.boundedInitialFetch.test.ts (1)
  • website/src/test/mcpAppPanelTab.test.ts (1)
  • website/src/test/mobileSessionsDrawerViewport.test.ts (1)
  • website/src/test/sessionTitleSqueeze.test.ts (1)
  • website/src/test/sidePanelDockMotion.test.tsx (1)
  • website/src/test/usePinnedPrompt.test.tsx (1)
  • website/src/test/useVirtualChat.observerBackfill.test.tsx (1)
  • website/src/uiLocations/areas/chat.ts (2)
  • website/src/utils/pinnedPrompt.ts (1)

.github/file-line-cap-baseline.txt: the ChatPage.tsx row is deleted (own row only). scripts/check_file_line_cap.py reports 0 failures.

Runs (local, gate_slot, against main 333061b; the head was then rebased onto fe87f5b with an unchanged patch, git range-diff =, and docs-lint and the line cap re-ran):

  • tsc (tsconfig.app.json) 0; eslint --max-warnings 0 on the 72 changed files under src/ and scripts/ 0 (and on all of src/ 0 one rebase earlier); i18n:check: 19 checks PASS; gen-ui-index --check 0; jscpd 0 clones; phantom classes 0; check_file_line_cap.py 0 failures; focus-cue, brand, comment-history and feature-map gates 0; docs_lint.py 0; the take-away check finds no take-away shape; mutation-check-scroll-shell.mjs --list 0 (104 targets, 8 scoped out).
  • vitest, the ChatPage suites under coverage (every test that renders ChatPage, mocks it or reads its source, plus the three new files): 215 files, 2,954 tests passed. One earlier run of the same suite failed ChatPage.dirStaging.test.tsx › "the same file picked under two differently-rooted slots keeps both chips" (expected '@src/main.ts ' to contain '@main.ts'), and that test passes 5/5 isolated both here and on main. Its line-422 barrier waits for slot-b's file search to be issued, not answered, so under load the click can land on slot-a's placeholderData row. That is a pre-existing race in the test, in code this PR does not touch, tracked as the known flake in Flaky: ChatPage.dirStaging 'same file under two differently-rooted slots keeps both chips' clicks a stale placeholder row #20843.
  • vitest, the tree-scanning guards, the tests of every file whose comments or code this PR touches, every test under src/i18n, the TurnBlock/ToolCallLine files main changed under the move, and uiIndex: 593 files, 11,751 tests passed.
  • KIROCREW_ACT_STRICT=1 over the three new files, ChatPage.reachability and ChatPage.knowledgeNote: 26 tests pass, 0 act() warnings.
  • Per-file line coverage over the ChatPage suites: every view is at least 87.5% (ChatEmptyState.tsx 87.5%, ComposerDockView.tsx 92.0%, the other six 100%), useChatPageSlotSwitches.ts is 94.1%, and ChatPage.tsx is 91.3%.
  • Determinism of the three new test files: ten shuffled serial runs and one shuffled run at 3 workers all pass, with the seed printed for each run.
  • Mutation proofs: 36 mutations, all kill their test. 21 are for the pins this PR edits or adds (sidePanelMount ×3, scrollShell.recipe ×2, the classification rows ×2, the pageOwners sequence ×2, reachability ×3, knowledgeNote ×2, handleFork ×3, the dock order and the three composer remounts in focusRetention). 15 re-run step 1's mutations against the views their constructs now live in (sessionTitleSqueeze, AgentDropdownList, papyrusNarrow, queueBandReanchor, mobilePanels.compositor, narrowFirstBaseline, composerChromeOcclusion ×2, scrollShell.recipe, scrollShell.render, statusStackLayering, chatTableHeightScope ×2, filterInputFont ×2).
  • Backend: the 28 pytest files that read the docs this PR edits, pin chat_handlers.py, or validate test/gui_user/features.json: 2,163 passed. The 13 that test is_turn_interrupted (whose docstring cites the composer's Resume gate) or read state.py's source: 891 passed.
  • semgrep 1.78 (CI's packs + semgrep/, --baseline-commit the merge-base): 0 findings over 80 files, no parse errors (semgrep skips learn-cron-dashboard.md as larger than 1 MB, as CI does).
  • Diff shape (L36): git diff and git diff --minimal add the same lines for 94 of the 95 files (ChatPage.tsx: 131 added, 1,817 deleted both ways). The one exception is docs/system-specs/modules/learn-cron-dashboard.md: +21/−9 by default, +20/−8 with --minimal. The default diff re-shows one blank line (deleted and re-added beside the owner-table rows), and that line carries no gate token; the campaign accepts this as an L41 exception. The diff is 603,544 bytes.
  • scripts/local-gate.py --dry-run: selects 2,843 backend + 1,562 frontend test files (the comment citations in state.py, App.tsx, index.css and the shared components widen the related set), over the ~600 limit, so the floor above ran instead; CI owns the broad matrix.

Manual verification

N/A — unit coverage sufficient: the views are moves of JSX the page suites already render, ChatPage.focusRetention.test.tsx pins that the composer is not remounted, and effect order is pinned by ChatPage.pageOwners.test.ts.

Screenshots / video

Why no screenshot: every region renders the same DOM, classes and text from its new module; nothing on screen changes.

Move audit

  • website/src/pages/ChatPage.tsx: 2775 → 1089 lines; 1799 non-blank removed lines (1,817 with blanks), 1716 found unchanged among the added lines (1715 in the new files, 1 re-placed in ChatPage.tsx; 95.39%). The 83 unmatched are glue: 81 import lines (78 import statements plus 3 tail lines of two wrapped imports), the lazy CrewChatWindow declaration (moved into ChatPaneChrome.tsx with its import path re-rooted from ./chat/crew-window/ to ../crew-window/), and the one getNoCarryCreateIdsRef() token described under Tests. The recipe (regen2.sh on main 333061b, views mode) reproduces ChatPage.tsx, the eight views and useChatPageSlotSwitches.ts byte-for-byte.

CI path references

None: no workflow, AUTOSDE.yaml glob or sensitive-change glob names ChatPage.tsx or the new files.

Related Issues

Part of #20192

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

ChatPage.tsx is still 2,775 lines after its hooks moved to owners
(#20388), over the 2,000-line cap (#20192). Its layout regions move,
verbatim, into eight view components under pages/chat/page/ (the page
frame, sessions chrome, pane chrome, empty state, title row, transcript
column, composer dock and side panels), and its own slot switches (fork,
the signed chat link, the follow-up session, a split pane's Side Chat)
into hooks in pages/useChatPageSlotSwitches.ts, beside the page and
outside the owners that never switch slots. Each hook is called where
its statements ran, so effect order is unchanged; the views are pure
functions of the props the page hands them.

ChatPage.tsx drops to 1,089 lines and leaves the line-cap baseline.
Source pins that read the page now also find what moved, and new tests
cover the views directly and pin that the composer keeps its node,
focus and caret across re-renders and the sidebar toggle, and its node
across a slot switch.

Part of #20192
@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 16, 2026 02:59
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing to check.

[UX-REVIEWED] ece2f4a

Description read

[DESCRIPTION-READ] 4a0facc9e0a3d641679358bb17c9db6144e355a16d3b62d3bbc9b064bda5e961

That sha256 names everything this verdict read: the PR description, plus the 3 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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Make sure the frontend suite is green: about 45 source-scan tests outside this patch read ChatPage.tsx and its pages/ neighbours, and none were re-pointed.

[DESIGN-REVIEWED] ece2f4a

Description read

[DESCRIPTION-READ] 2fe1350ce89379a9ee7872379d94af4bcb79cb6aded10b90fe1c74a1159d77ff

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ece2f4ac4e14a4cc77d2f993c2336cb9b6195b18 — 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.

First-Principles-Verdict: PASS

Check that useChatPageSlotSwitches.ts's five plain switchSlot sites match the six removed from ChatPage.tsx; the classification table now says 1 + 5.

What this change ships

Inventory (8 items) — 8 justified

Intent: bring ChatPage.tsx under the 2,000-line file cap required by AGENTS.md without changing any behaviour. This is a FIX (a refactor that the cap rule requires).

  1. ChatPage.tsx shrinks from 2,775 to 1,089 lines, and its row leaves file-line-cap-baseline.txt — justified
  2. The page's JSX regions are moved unchanged into eight hook-free views under pages/chat/page/ — justified
  3. The four slot-switching flows move into pages/useChatPageSlotSwitches.ts, called in their original order — justified
  4. StableChatInput moves unchanged from the page into ComposerDockView.tsx — justified
  5. The source-pin tests now read the page plus its new modules — justified
  6. New view, composer-dock and focus-retention tests pin the region wiring and keep the composer's DOM node — justified
  7. The call-site classification table splits the page's six plain sites into 1 + 5 — justified
  8. Comments, docs and spec references across about 60 files now name the new homes — justified

[FIRST-PRINCIPLES-REVIEWED] ece2f4a

Description read

[DESCRIPTION-READ] e07ba5149de3f8470679418b2f8299e66222b6c4a44c9ac80516f1fd6f13a51e

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@bolichen97
bolichen97 enabled auto-merge (squash) October 16, 2026 03:05
@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of ece2f4ac4e14a4cc77d2f993c2336cb9b6195b18 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ece2f4a

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

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ece2f4a

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

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

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • the source-scan tests that read ChatPage.tsx

answered: those ~45 tests were re-pointed in step 1 (#20388) to read the union ChatPage.tsx + pages/chat/page/* + pages/useChatPage*, so the eight views and the sibling hook module this PR adds are already inside what they read; their assertions are unchanged.
This PR re-points the four that still read a narrower set: sidePanelMount, reachability's negative half, knowledgeNote's call-site count, and the handleFork describe main added in #20992.
Frontend Tests (1)-(4) and Frontend Coverage Merge pass on this head. Locally, the ChatPage suites (215 files, 2,954 tests) and 593 guard files (11,751 tests) pass, and 36 mutations each turn a pin red in the construct's new home.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • five plain switchSlot sites in the sibling vs six removed from the page

answered: they match. At base, ChatPage.tsx had 9 sites: 2 announced, 1 keep-target and 6 plain. Five plain ones move into useChatPageSlotSwitches.ts (fork; the signed link's reconnect and its just-linked slot; the follow-up session; a split pane's side chat), and one stays in the page (the comment-batch send to the tab it targets).
The table's ChatPage row (2/1/1) plus the sibling row (0/0/5) is 2/1/6, the base total. switchSlotCallsiteClassification.test.ts recounts with its own classify() and passes, and a new site planted in either file turns it red.

@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 Oct 16, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved by a maintainer after reading the review lanes: every lane is clean on this head, and the automated triage held it only on a size or category rule.

@bolichen97
bolichen97 disabled auto-merge October 16, 2026 07:15
@bolichen97
bolichen97 merged commit a7158db into main Oct 16, 2026
101 of 103 checks passed
@bolichen97
bolichen97 deleted the refactor/linecap-f04-chatpage-p2 branch October 16, 2026 07:15
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 16, 2026
@Pearcekieser Pearcekieser mentioned this pull request Oct 16, 2026
5 tasks done
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.

2 participants