Skip to content

refactor(website): move ChatPage hook logic into page owners - #20388

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

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

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: website/src/pages/ChatPage.tsx shrinks from 6,990 to 2,774 lines with unchanged behaviour, by moving its hook logic into 14 owner modules under pages/chat/page/ (step 1 of 2 toward the 2,000-line file cap).

ChatPage.tsx is the second-largest hand-written file in the repo and gets about 38 commits a week. Every feature PR that touches the chat page edits a 7,000-line component, and the campaign rule in #20192 caps a hand-written file at 2,000 lines.

Why it matters

A file this size is where merge conflicts and missed side effects pile up: one function body can sit 4,000 lines away from the effect it races. Splitting by responsibility gives each part of the page (composer send, transcript paging, pins, the sessions drawer, ...) one module that new work for it goes to, and lets the line-cap guard hold the file under the cap.

Not a goal

  • Getting ChatPage.tsx under 2,000 lines in this PR. The JSX views and the page's own slot switches move in the stacked follow-up (PR 2 of the series), which takes the page to about 1,200 lines.
  • Any behaviour, layout, styling or wording change. The single user-visible effect is the knowledge-note translation described below.
  • Refactoring the moved code. Bodies move verbatim; only the hook boundaries (inputs and returned values) are new.

What changed (motivation → approach → change)

ChatPage already composes 26 owner hooks under pages/chat/page/, but about 4,300 lines of state, effects and callbacks were still inline. This PR moves them out in contiguous runs: each run of statements becomes one owner hook, called from the exact position those statements held. React registers effects in call order, so the order is unchanged; ChatPage.pageOwners.test.ts pins it.

Owner (pages/chat/page/) Responsibility Lines
pageEnvironment.ts the router, store, viewport and dashboard-config flags the page reads first 298
activeSlotState.ts the active session's store-backed state 249
composerHost.ts the main composer's draft, its intake refs, Side Chat hand-offs and the voice host 288
sessionPicks.ts the model roster, the next-session picks, and approval / agent / model / project choices 353
turnActions.ts steering a running turn, the refused-press notice, regenerate 296
transcriptPaging.ts the virtualizer and every door that pages older history into it 625
panelTabs.ts run-in-terminal config and the MCP App panel reveal 118
composerSend.ts send(): the composer's whole turn submission and its recoveries 808
followupCardActions.ts follow-up and folder-suggestion card actions 167
paneLayout.tsx pane, sessions-sidebar and side-panel layout state 368
messageActions.ts dock clearance, Quote / Ask on a selection, per-message actions 300
transcriptPins.ts turn navigation, pins, and jumps to a pinned, quoted or edited row 353
transcriptRendering.tsx the renderer registry, renderMessage, turn and measurement-farm rows 520
sessionsDrawer.ts the sessions drawer and the side panel's phone overlay 661

ChatPage.tsx (2,776 lines at this head: main has since split one of its imports into two lines and added the project-chip lock prop) keeps the composition, every dispatch(switchSlot( site, the slot controllers, the listbox keyboards and the remaining JSX. It still re-exports shouldAutoFillOlder (now defined in transcriptPaging.ts) and keeps its default export and PREFILL_STORAGE_KEY.

Three effect-free statements are hoisted a few lines so each run stays contiguous: inputRef (after inputNonBlank), refusedPress (after planTaskId) and showRefusedPress (after refusedPress). Each is a useRef, useState or useCallback, so nothing React schedules moves.

react-hooks/exhaustive-deps cannot see across a hook boundary that a useState setter or useRef object is stable, so those names are appended to the dependency arrays that read them. Adding a stable identity never changes when a hook re-runs. The full list is under Tests.

The draft-restore notice's knowledge sentence was an English literal appended to a translated string. It becomes the catalog key pages.chatPage.knowledge_context_not_kept, added to all 12 catalogs under website/src/i18n/locales/ (en-XA regenerated with npm run i18n:pseudo). English stays byte-identical; the call site prepends the leading space, because a catalog value may not start with one. User-visible: non-English users now read that sentence translated.

Docs and comments that name where this code lives now name its owner: the ChatPage owner rows in learn-cron-dashboard.md, file-search.md, turn-stats-footer.md, workflow-chat-cards.md, two rows of docs/feature-map/README.md, and the code comments listed under Tests.

Backwards compatibility

Compatible: pages/ChatPage keeps its module id, default export and named exports (shouldAutoFillOlder re-exported from its new owner, PREFILL_STORAGE_KEY), so every importer and every vi.mock('../pages/ChatPage') works unchanged. No owner imports the facade, and nothing outside it imports an owner.

Removes nothing: every construct moves into a module that the facade composes; no route, export, key or behaviour is dropped.

Tests

New unit tests for owners that the page suites cover below 80% on their own (deterministic: fake timers with vi.setSystemTime, no sleeps):

  • ChatPage.transcriptPaging.test.tsx: the top sentinel, earlier-messages bar, walk poll, failed-page retry, gesture budget, slot-entry reset.
  • ChatPage.transcriptPins.test.tsx: jump to pin, quote and last edit; paging until the target lands; the not-found and load-error wording; pin and unpin.
  • ChatPage.transcriptRendering.test.tsx: hidden rows, content-column wrapper, group approval routing, the measurement farm.
  • ChatPage.panelTabs.test.tsx: run-in-terminal config and app panel reveal.
  • ChatPage.knowledgeNote.test.ts: the English sentence is byte-identical, and the call site composes it once.

Source pins re-pointed (L30, path only, assertions unchanged). 42 test files that read ChatPage.tsx as text now read the union ChatPage.tsx + sorted pages/chat/page/* + sorted pages/useChatPage*. Each re-point carries a mutation of the pinned construct in its new home that turns the test red (95 of 95 mutations killed; one pinned string occurs twice in its new home, so that pair is applied together). Four files change only a relative specifier, in five regexes, because the import they pin moved into pages/chat/page/: systemNoticeScans (./chat/CompactionCard → ../CompactionCard), RecoveryCard and transcriptRenderers (each ./chat/transcriptRenderers → ../transcriptRenderers) and chatRolesParity (../app-sdk → ../../../app-sdk, two regexes).

11 of the re-points are anticipatory for PR 2 of this series: their constructs are still in ChatPage.tsx today, and the union read keeps PR 2's view move from editing them. Each still carries a killing mutation: test/AgentDropdownList.test.tsx, test/ChatPage.composerChromeOcclusion.test.tsx, test/ChatPage.queueBandReanchor.test.tsx, test/ChatPage.scrollShell.recipe.test.tsx, test/ChatPage.scrollShell.render.test.tsx, test/ChatPage.statusStackLayering.test.tsx, test/filterInputFont.test.tsx, test/narrowFirstBaseline.test.ts, test/papyrusNarrow.test.ts, test/reasoningBurst.contract.test.tsx, test/sessionTitleSqueeze.test.ts.

Re-pointed files
  • guide/revealScopes.test.tsx
  • store/chatSlice.abortOlderOnSwitch.test.ts
  • test/AgentDropdownList.test.tsx
  • test/ChatPage.collapsedGroupTrust.test.tsx
  • test/ChatPage.composerChromeOcclusion.test.tsx
  • test/ChatPage.dockClearance.test.tsx
  • test/ChatPage.footerNotRetracted.test.ts
  • test/ChatPage.idlePrefetchAuth.test.ts
  • test/ChatPage.mcpOAuth.test.tsx
  • test/ChatPage.newSessionModel.test.ts
  • test/ChatPage.overlaySelection.test.tsx
  • test/ChatPage.queueBandReanchor.test.tsx
  • test/ChatPage.remoteBoundGates.test.tsx
  • test/ChatPage.scrollShell.recipe.test.tsx
  • test/ChatPage.scrollShell.render.test.tsx
  • test/ChatPage.sessionChipOffline.test.tsx
  • test/ChatPage.sid.test.tsx
  • test/ChatPage.statusStackLayering.test.tsx
  • test/ChatPage.systemNoticeScans.test.ts
  • test/ChatPageDrafts.test.tsx
  • test/NoticeCard.test.tsx
  • test/RecoveryCard.test.tsx
  • test/TurnBlock.rowMemo.test.tsx
  • test/chatPins.test.tsx
  • test/chatRolesParity.contract.test.ts
  • test/chatTableBreakout.test.tsx
  • test/chatTableHeightScope.test.tsx
  • test/filterInputFont.test.tsx
  • test/injectBubbleWhitespace.test.ts
  • test/invisibleText.test.ts
  • test/jevRoute.test.tsx
  • test/mobilePanels.compositor.test.ts
  • test/mobileSessionsDrawerViewport.test.ts
  • test/narrowFirstBaseline.test.ts
  • test/olderHistoryTrigger.test.tsx
  • test/pagination.earlierAdmission.test.ts
  • test/papyrusNarrow.test.ts
  • test/reasoningBurst.contract.test.tsx
  • test/sessionTitleSqueeze.test.ts
  • test/transcriptRenderers.test.tsx
  • test/useInteractiveModels.test.ts
  • test/userBubbleMobileOverflow.test.tsx

ChatPage.pageOwners.test.ts: the pinned hook order gains the 27 new owner hooks at their call positions; the existing order is unchanged.

Dependency arrays (setters and refs only):

23 sites
  • ChatPage.tsx:866 + activeSlotRef
  • ChatPage.tsx:1253 + setSplitMode
  • chat/page/composerHost.ts:213 + composerSlotRef, inputRef
  • chat/page/composerHost.ts:260 + activeSlotRef, composerSlotRef
  • chat/page/composerHost.ts:274 + composerSlotRef, inputRef
  • chat/page/sessionPicks.ts:331 + modelPickerReturnsFocusRef
  • chat/page/turnActions.ts:255 + setRefusedPress
  • chat/page/turnActions.ts:258 + setRefusedPress
  • chat/page/transcriptPaging.ts:208 + vScrollerElRef
  • chat/page/transcriptPaging.ts:286 + lastRealInputAtRef, sentinelPagesSinceInputRef, vFarmIsMeasuredRef, vScrollerElRef
  • chat/page/transcriptPaging.ts:621 + setRefusedPress
  • chat/page/followupCardActions.ts:51 + inputRef
  • chat/page/followupCardActions.ts:120 + followupTsRef
  • chat/page/paneLayout.tsx:109 + setSplitAnchor, setSplitMode
  • chat/page/paneLayout.tsx:212 + setSidebarPinned
  • chat/page/messageActions.ts:115 + setRegenerating
  • chat/page/messageActions.ts:192 + filteredSlotsRef, setSidebarPinned, sidebarAutoHidden
  • chat/page/messageActions.ts:286 + activeSlotRef
  • chat/page/transcriptPins.ts:187 + editSeqRef, messagesRef, setEditLast
  • chat/page/transcriptRendering.tsx:414 + farmPassRef, messagesRef
  • chat/page/transcriptRendering.tsx:515 + farmPassRef
  • chat/page/sessionsDrawer.ts:272 + setSidebarPinned, sidebarAutoHidden
  • chat/page/sessionsDrawer.ts:597 + setSidebarPinned, sidebarAutoHidden, sidebarPinnedRef

One justified edit, a new suppression: renderMessage's deps in transcriptRendering.tsx. messagesRef became a parameter and is identity-stable, but listing it would put the substring messages back in the array that TurnBlock.rowMemo.test.tsx bans, so the line carries an eslint-disable-next-line with that reason instead.

panelTabs.ts is 118 lines because it owns one small responsibility, the run-in-terminal bridge's event-time config and the MCP App tab reveal, which neither neighbouring owner holds.

Citations (comments only, L29): utils/chatDrafts.ts, utils/channelOrigin.ts, utils/offline.ts, hooks/useDrawerSwipe.ts, components/DetailPanel.tsx, chat/page/composerDrafts.ts, chat/page/busyTurnControls.ts (three) and the header of test/ChatPage.handleFork.test.tsx now name the owner file instead of ChatPage. Moved comments that said "above" / "below" about code that is now in another file name that file (26 phrases, applied as recipe prepatches so the move stays reproducible).

.github/file-line-cap-baseline.txt: the ChatPage.tsx row drops from 6990 to 2776, by hand (own row only); scripts/check_file_line_cap.py reports 0 failures. PR 2 deletes the row.

website/scripts/mutation-check-scroll-shell.mjs (one line, granted by the campaign's integration owner): the shell-import region now ends at import TurnNavigationMinimap, because import { useVirtualChat moved to transcriptPaging.ts. --list exits 0 with all 8 regions; the region covers the one shell import line instead of the six lines up to the old anchor.

Runs (local, gate_slot): All at this head, against its merge-base with main:

  • tsc (tsconfig.app.json) 0; eslint --max-warnings 0 on the 72 changed source files 0; 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, feature-map and comment-history gates 0; docs_lint.py 0; the take-away check finds no take-away shape.
  • vitest, ChatPage suites (every test that renders ChatPage, mocks it or reads its source, plus the new ones): 213 files, 3,028 tests passed.
  • vitest, the 61 other tree-scanning guards (they read every source file, so the new owners are in their reach): 1,641 tests passed. The tests of every file whose comments changed: 51 files, 998 tests passed. Every test under src/i18n (the catalog, parity and per-language style checks): 43 more files, 888 tests passed.
  • Per-file line coverage over the ChatPage suites: every new owner is at least 83% (followupCardActions.ts 83.3%, sessionPicks.ts 83.7%, the rest 87–100%), and ChatPage.tsx is 82.1%.
  • Mutation proofs: 95 mutations, at least one per re-pointed file, all kill their test (one pinned string occurs twice in its new home, so that pair is applied together).
  • Backend: the 23 pytest files that read the docs this PR edits: 1,515 passed.
  • semgrep 1.78 (CI's packs + semgrep/, --baseline-commit the merge-base): 0 new findings, no parse errors.
  • Diff shape (L36): for every changed file, git diff and git diff --minimal add the same lines (ChatPage.tsx: 198 added, 4,412 deleted both ways).
  • scripts/local-gate.py --dry-run selects 825 backend + 475 frontend files, over the ~600 limit, so the floor above ran instead; CI owns the broad matrix.

Manual verification

N/A — unit coverage sufficient: the change is a move with effect order pinned by ChatPage.pageOwners.test.ts, and the ChatPage render suites run unmodified against the composed page.

Screenshots / video

Why no screenshot: layout, styling and English text are byte-identical; the one rendered delta is the draft-restore notice's knowledge sentence now appearing translated in non-English locales, described in What changed.

Move audit

  • website/src/pages/ChatPage.tsx: 6992 → 2776 lines; 4328 removed lines, 4151 found unchanged in the new files (95.91%); the 177 unmatched are glue: 121 import lines, 23 dependency arrays extended with the stable names listed under Tests, 5 module declarations that gain export in their new owner (DRAWER_UNCOVERED_PX, REFUSED_PRESS_TITLE_KEYS, RefusedPressAction, slashRefusal, ComposerDraftSync), the one English literal that became pages.chatPage.knowledge_context_not_kept, and 27 comment lines whose "above" / "below" now name the owner file (Citations, under Tests).

CI path references

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

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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 14, 2026 17:02
@bolichen97
bolichen97 requested a review from mbriones98 October 14, 2026 17:02
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 14, 2026
@bolichen97
bolichen97 force-pushed the refactor/linecap-f04-chatpage branch from edbad5f to 227533b Compare October 14, 2026 17:52
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Check one non-English draft-restore notice in Japanese or Chinese: the call site puts a space before the translated sentence, and those languages don't separate sentences with spaces.

Suggestions

  • composerSend.ts:496 adds ' ' + i18nT('pages.chatPage.knowledge_context_not_kept'). The joiner between the two sentences differs by language, so let each catalog's message_saved_as_draft value decide it rather than hardcoding the space.

[UX-REVIEWED] 4c43498

Description read

[DESCRIPTION-READ] f76c7aaa6196272434d65b5bdf3b5f48c5f652bb020aa6f613f271a2c939b2eb

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

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Check that the 42 re-pointed source pins, which now match text anywhere in the page plus every owner file, can still fail when a construct leaves its intended owner.

[DESIGN-REVIEWED] 4c43498

Description read

[DESCRIPTION-READ] 3f80d0320f22c519b61ae002b20c4342857dde3cc099ac5a496b2deaccad2aff

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

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 4c434986e28ffeeda479060f284f2e6fe0086c76 — 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: CONCERNS

The same union-source loader is pasted into 42 test files, next to the existing test/readSource.ts. Eleven of those re-points are only there for the next PR.

Not justified as shipped

  • Item 5 — duplicate of website/src/test/readSource.ts: each re-pointed pin inlines its own readdir(ownerDir)…filter…sort…join loader. I grepped test files that name chat/page and call readdir/readdirSync: 42 copies, zero shared. The PR's own description puts the path in all of them: "ChatPage.tsx + sorted pages/chat/page/* + sorted pages/useChatPage*". PR 2 (or any later owner move) will have to edit all 42.
    Subtraction: replace the 42 inline loaders with one function in test/readSource.ts, so 42 copies become one.
    Clears when: the inline copies are gone, or one existing loader is named that they all call.
  • Item 6 — inherited: "11 of the re-points are anticipatory for PR 2 … their constructs are still in ChatPage.tsx today". This is "so we can later": on this head, nothing those 11 files pin has moved.
    Subtraction: leave the 11 files as they are on base and re-point them in PR 2.
    Clears when: those 11 diffs are dropped, or the construct each one pins has moved in this PR.

What this change ships

Inventory (8 items) — 6 justified

Intent: shrink ChatPage.tsx toward the 2,000-line cap with no behaviour change — an ADDITION-free refactor (structural).

  1. About 4,200 lines of page hook logic move into 14 owner modules under pages/chat/page/, called in the same order — justified
  2. The ChatPage.tsx line-cap baseline row drops from 6990 to 2776 — justified
  3. Non-English users now read the draft-restore knowledge sentence translated (new catalog key in 12 locales) — justified
  4. Comments and spec rows that name where code lives now point to its new owner — justified
  5. 42 source-text pins read the page plus its owners, each through its own inline loader — duplicate of test/readSource.ts
  6. 11 pins re-pointed ahead of PR 2 — rides along, inherited ("anticipatory")
  7. New unit suites for the paging, pins, rendering, panel-tab and knowledge-note owners — justified
  8. The page-owner call-order pin is extended to the new hooks — justified

[FIRST-PRINCIPLES-REVIEWED] 4c43498

Description read

[DESCRIPTION-READ] 7377ebf970d8812b253cd31e2f40376d0ed47f7254d7718c0786dca3dce75d7c

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.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4c43498

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

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=4cdcdedabff6 the 11 anticipatory re-points

rebutted: the Goal names this PR step 1 of a two-PR series, and these 11 edits are test-only source reads for that series, not new scope: no assertion, product file or behaviour changes.
Each read becomes the union ChatPage.tsx + pages/chat/page/* + pages/useChatPage*, which today still contains the pinned construct exactly once, and each has a mutation in ChatPage.tsx that turns it red.
The campaign's integration owner ruled that L30 covers anticipatory re-points within a series when each carries such a proof; reverting them only moves the same 11 edits into PR 2's diff.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=4cdcdedabff6 the 11 anticipatory re-points

rebutted: test-only union reads inside a two-PR series (this PR is step 1 of 2); no assertion or product code changes, and each still pins its construct once and fails under a mutation of it in ChatPage.tsx.
The campaign's integration owner ruled to keep them; reverting moves the same edits into PR 2 without removing any.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Answers to the PASS punchlines on 227533b:

  • Design: call order of the new owner hooks. website/src/test/ChatPage.pageOwners.test.ts pins the page's whole owner-call sequence. It now lists the 27 new owner hooks (from the 14 new files) at their call positions, and the 26 existing hooks keep their order. That test reads the facade and fails on any reordering, so effect registration order is checked.
  • UX: the translated knowledge sentence. The draft-restore notice composes ' ' + i18nT('pages.chatPage.knowledge_context_not_kept') at its one call site in chat/page/composerSend.ts. That puts a single leading space before the translated sentence in every locale. ChatPage.knowledgeNote.test.ts pins the English text byte-for-byte and checks that the composition appears exactly once. CI's Russian style check caught a formal-register verb in the ru value (выберите). The next push changes it to the ты form (выбери).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@bolichen97
bolichen97 force-pushed the refactor/linecap-f04-chatpage branch from 227533b to 1938323 Compare October 14, 2026 20:32
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=b13750ad1aec the 11 anticipatory re-points

rebutted: the Goal names this PR step 1 of a two-PR series, and these are test-only source reads for that series: no assertion, product file or behaviour changes, so they add no scope the series does not already own.
Each reads the union ChatPage.tsx + pages/chat/page/* + pages/useChatPage*, which today still contains its pinned construct exactly once, and each has a mutation of that construct in ChatPage.tsx that turns it red.
The campaign's integration owner ruled that L30 covers anticipatory re-points inside a series when each carries such a proof; dropping them moves the same 11 edits into PR 2 without removing any.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=b13750ad1aec the 11 anticipatory re-points

rebutted: test-only union reads inside a two-PR series (this PR is step 1 of 2); no assertion or product code changes, and each still pins its construct exactly once and fails under a mutation of it in ChatPage.tsx.
The campaign's integration owner ruled to keep them; dropping them moves the same edits into PR 2 without removing any.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Answers to the PASS punchlines on 1938323:

  • Design: do the 42 re-pointed pins still fail against the moved constructs? Yes. Each re-pointed file carries at least one mutation of its pinned construct, made in the construct's new home. All 95 of those mutations turn their test red. One pinned string occurs twice in its new home, so that pair is applied together. The per-file results are in the move evidence behind the body's Tests section.
  • UX: the space before the translated sentence in ja / zh-CN. The space was there before this PR: the notice has always appended ' ' + <sentence>, which until now was English in every locale. This PR keeps that separator and only translates the sentence. A per-locale separator, with no space after 。, would change what users see, so it is not part of a behaviour-preserving move. It is noted as a follow-up for the copy owners.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override fable 1938323: Opus discovery failed closed on two runs at this head (38632956362; no [OPUS-DISCOVERY] marker, no review content), an infrastructure fault rather than a finding; I verified this head myself — range-diff against the previously reviewed head changes only import lines ported from #20369, one ru catalog string for the style check, and the line-cap baseline row, and GPT, Design, First Principles and UX lanes pass.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the fable AI finding as false positive, not applicable, or explicitly accepted for 1938323e2fe2f2d91868e28cfbea1bf00507e2d1.

Opus discovery failed closed on two runs at this head (38632956362; no [OPUS-DISCOVERY] marker, no review content), an infrastructure fault rather than a finding; I verified this head myself — range-diff against the previously reviewed head changes only import lines ported from #20369, one ru catalog string for the style check, and the line-cap baseline row, and GPT, Design, First Principles and UX lanes pass.

This decision applies only to this commit. A new push requires a new judgment.

@bolichen97
bolichen97 enabled auto-merge (squash) October 14, 2026 23:05
@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 Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 4c43498

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

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

@bolichen97
bolichen97 force-pushed the refactor/linecap-f04-chatpage branch from 821b781 to 4c43498 Compare October 15, 2026 05:24
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: the PR went DIRTY after the 04:55Z merges, #20524 (ChatSidebar owners) among them (9163daf -> fec3e98). No upstream change touched ChatPage.tsx. Three files carried both PRs' edits and keep both: ChatPage.remoteBoundGates.test.tsx and useInteractiveModels.test.ts (#20524's sidebar reads beside this PR's ChatPage reads) and the utils/channelOrigin.ts comment that now names chat/page/pageEnvironment.ts and chat-sidebar/HistoryPane.tsx; the line-cap baseline is a row union. Re-gated locally; CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 15, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=323259656f32 inline union loaders beside test/readSource.ts

rebutted: the campaign grant (L30) covers path-only re-points of an existing read, so each test keeps the read it already had and only widens what it reads; readSource.ts reads one file and has no union mode, so routing 42 tests through it would mean a new shared helper plus rewriting every one of these reads, which the grant does not cover.
Every copy selects the identical set — ChatPage.tsx, then sorted pages/chat/page/, then sorted pages/useChatPage — and matches no test file, so no pin can see a different source than another.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=8280b2c5532d the 11 anticipatory re-points

rebutted: the Goal names this PR step 1 of a two-PR series; these are test-only source reads for that series, with no assertion, product file or behaviour change.
Each still pins its construct exactly once in the union and fails under a mutation of it in ChatPage.tsx; the campaign's integration owner ruled that L30 covers anticipatory re-points inside a series with such a proof, so dropping them moves the same edits into PR 2.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=323259656f32 inline union loaders beside test/readSource.ts

rebutted: the campaign grant (L30) covers path-only re-points of an existing read, so each test keeps the read it already had and only widens what it reads; readSource.ts reads one file and has no union mode, so routing 42 tests through it would mean a new shared helper plus rewriting every one of these reads, which the grant does not cover.
Every copy selects the identical set — ChatPage.tsx, then sorted pages/chat/page/, then sorted pages/useChatPage — and matches no test file, so no pin can see a different source than another.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=8280b2c5532d the 11 anticipatory re-points

rebutted: the Goal names this PR step 1 of a two-PR series; these are test-only source reads for that series, with no assertion, product file or behaviour change.
Each still pins its construct exactly once in the union and fails under a mutation of it in ChatPage.tsx; the campaign's integration owner ruled that L30 covers anticipatory re-points inside a series with such a proof, so dropping them moves the same edits into PR 2.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=18daef078dde the joiner before the knowledge sentence

rebutted: the space is the notice's own composition from before this PR (it then preceded an English literal in every locale); this behaviour-preserving move keeps it byte-identical and only translates the sentence, as the campaign owner ruled (English byte-identical, space at the call site because a catalog value may not start with one).
A per-locale joiner changes what users see in ja / ko / zh-CN; it belongs to the copy owners as a separate change.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=18daef078dde the joiner before the knowledge sentence

rebutted: the space is the notice's own composition from before this PR (it then preceded an English literal in every locale); this behaviour-preserving move keeps it byte-identical and only translates the sentence, as the campaign owner ruled (English byte-identical, space at the call site because a catalog value may not start with one).
A per-locale joiner changes what users see in ja / ko / zh-CN; it belongs to the copy owners as a separate change.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Answers to the PASS punchlines on 4c43498:

  • Design: do the union pins still fail when a construct leaves its intended owner? They fail when the construct leaves the page altogether, or changes. Each of the 42 re-points has a mutation of its construct that turns its test red (95 in total). Which owner holds what is not checked by those pins, which read text. It is checked by ChatPage.pageOwners.test.ts, which pins the owner hook call order and stops owners importing the facade or switching slots, and by store/switchSlotCallsiteClassification.test.ts, which pins each file's switchSlot sites.
  • UX: the space before the sentence in ja / zh. See the disposition on span 18daef078dde: that separator is BASE's own composition, kept byte-identical by this move.

@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 15, 2026

@cruisercohen cruisercohen 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.

Re-approving on 4c43498 after the rebase onto main.

git range-diff against the previous head (821b781) shows the PR's own change is unchanged: comparing the added and removed lines of both diffs, the only difference is the two node:fs import edits in ChatPage.remoteBoundGates.test.tsx and useInteractiveModels.test.ts, which main already carries from #20524. Everything else that differs is context. My review on 821b781 still applies: hook order, dependency arrays and moved bodies are as reviewed.

Required checks are green on this head, and the Sensitive Change Review run reports no sensitive path changed.

@bolichen97
bolichen97 merged commit c0cabf9 into main Oct 15, 2026
102 of 105 checks passed
@bolichen97
bolichen97 deleted the refactor/linecap-f04-chatpage branch October 15, 2026 06:13
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 15, 2026
bolichen97 added a commit that referenced this pull request Oct 16, 2026
…#21054)

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
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.

3 participants