Skip to content

fix(chat): undoing a file chip remove restores its attachment - #14773

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:fix/composer-chip-undo-attachment
Sep 30, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:fix/composer-chip-undo-attachment

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Ctrl/Cmd+Z after removing an @-picked file chip brings the file back, so the message sends with the attachment it had before the remove.

Picking a file through the composer's @ picker does two things: it inserts an @src/... token into the text and stages the file as a chip above the composer. The chip's remove button undoes both. The composer's undo history covers only the text, so Ctrl/Cmd+Z brought back @src/main.ts as plain text while the file stayed unstaged. The next send went out without the file.

Why it matters

An accidental click on a chip's remove button is recoverable in the text but silently loses the attachment, and nothing on screen says so beyond the missing chip. The agent then answers about a file it never received.

Not a goal

  • Making the remove of an uploaded or dropped file undoable. Those removes change no composer text, so there is nothing for the text undo to bring back.
  • Changing paste chips or folder chips. Both already survive undo: paste content rides in the undo snapshots, and folder chips are derived from their text token.
  • Changing the reconciliation's own rules for hand-edited mentions.

What changed (motivation → approach → change)

When What happens to the file
Remove chip Mention stripped as its own undo step, file unstaged, its recorded aliases kept
Undo brings the mention back The chip reconciliation re-stages the file
Redo takes the mention out again The reconciliation unstages it
Send Aliases cleared, as before

The chip reconciliation in ChatPage.tsx already keeps a picked file in sync with its @rel mention: a hand-edited-out mention unstages the chip, and a mention that comes back re-stages it. The remove button was the one path that also deleted the file's recorded aliases, so after a remove there was nothing left for the reconciliation to revive. The remove now keeps them, so undo and redo work through the existing reconciliation with no new state.

It drops them only when a mention of this file survives the strip, since that leftover would re-stage the file the click just removed. That survival check calls the reconciliation's own revival predicate, fileChipRevives, which this PR extracts so both places share one copy. A staged file whose name extends this one (report beside report,) is therefore not mistaken for this file, and a leftover old-project spelling, which the reconciliation never revives from, does not cost the chip its undo. The aliases are now persisted per slot beside the staged files (website/src/utils/chatFileTokenDrafts.ts, the same sessionStorage store shape and lifetime as chatFileDrafts), and loaded on mount and slot switch. Before this, a reload restored the staged files but not their aliases, so a restored chip could not be unstaged by a hand-edit (a limitation the code documented), and a restored report, beside report made remove followed by undo lose report. A draft saved before this change has no stored aliases; its remove records the derived one so undo works there too.

In ChatInput.tsx, clicking a file or folder chip's remove now ends the current undo burst first. Without that, a short mention (@a.ts ) removed within 400 ms of a keystroke was merged into the typing entry, and undo skipped past the text that still held the mention. Typing, voice dictation, pickers and prompt recall keep their grouping. The file-search spec describes the new remove contract. The file comes back by path, so nothing is uploaded again.

Backwards compatibility

Compatible: remove, send and draft behave as before unless the removed mention comes back into the text.

Tests

website/src/test/ChatPage.chipUndo.test.tsx, on the full chat page:

  • remove, undo, send carries the file
  • remove, send leaves it out
  • undo then redo leaves it out
  • a duplicated mention does not re-stage the removed file
  • undo revives a removed file whose name is a prefix of a staged sibling's (report and report,)
  • no re-attach from a mention typed after a send
  • an old project's alias left behind by the strip keeps the undo working (@src/main.ts after the project moves to src/)
  • after a reload, undo still revives a removed chip beside its prefix sibling
  • after a reload, deleting a restored chip's mention by hand unstages it

website/src/test/chatFileTokenDrafts.test.ts: the alias drafts roundtrip through sessionStorage and malformed entries are dropped.

website/src/test/ChatInput.chipRemoveUndo.test.tsx: a short mention removed 100 ms after a keystroke is its own undo step, and quick typing still groups into one.

The undo, redo, prefix-sibling, old-project-alias, both after-reload and quick-remove cases fail without their fixes. The existing ChatPage.dirStaging.test.tsx and ChatInput.test.tsx cases pass unchanged.

Manual verification

Picked a file in the dashboard composer, removed its chip, pressed Ctrl+Z, and saw the token and the chip come back (screenshots below).

Screenshots / video

The chip strip and composer text in the dashboard, built from this branch. Picked, then removed, then Ctrl+Z:

Composer after picking src/main.ts: main.ts chip above the text @src/main.ts explain

After clicking the chip's remove button: chip and token gone, only "explain" left

After Ctrl+Z: main.ts chip and @src/main.ts token both back

On main, the same Ctrl+Z brings back the @src/main.ts text without the chip; the undo case in the page test fails there.

Related Issues

Fixes #14772

Pattern harvest

Not generalizable: the loss came from the one remove path that discarded the bookkeeping the text-to-chip reconciliation needs; the other paired state, paste blocks, already rides in the undo snapshots.

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

@Pearcekieser
Pearcekieser requested a review from a team September 28, 2026 17:12
@Pearcekieser
Pearcekieser requested a review from a team as a code owner September 28, 2026 17:12
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Intent: After a user removes an @-picked file chip, Ctrl/Cmd+Z brings the attachment back along with its mention, redo removes it again, and a remove that is not undone still leaves the file out of the send.
Not a goal: Changing the chip reconciliation's rules for hand-edited mentions, making uploaded/dropped file removes undoable, or changing the composer's undo coalescing.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of dc7fc1d152d45755f44dbffad19e925f39fb417b via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify the remove-time fileChipRevives snapshot (pendingFiles minus the removed path) can't disagree with the staged set the next reconciliation commit actually sees.

[DESIGN-REVIEWED] dc7fc1d

Description read

[DESCRIPTION-READ] 5a83bbeffa123a6fdfd2a078e3035e4a29ca9deb23e6235a08226a651c106505

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 Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — ✅ PASS

Premise-level review of dc7fc1d152d45755f44dbffad19e925f39fb417b via the fork AI-review pipeline — 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

Verify the declared rider: persisted aliases also make a restored chip unstage on a hand-edit after reload — behavior beyond the undo fix itself.

Not justified as shipped

  • Item 5 — rides along: "a limitation the code documented" — the hand-edit-unstage of a restored chip is a declared consequence of the alias persistence, not the undo fix; it carries no premise risk.

What this change ships

Inventory (7 items) — 6 justified

Intent: Ctrl/Cmd+Z after removing an @-picked file chip brings the attachment back for the next send — a FIX (issue #14772, tests fail on base).

  1. Undo after a file chip's remove re-stages the file; redo unstages it again — justified
  2. A file or folder chip remove is now its own undo step, never merged into the typing burst — justified
  3. A leftover mention that would revive the removed chip still drops its record, so remove sticks — justified
  4. File-chip aliases persist per slot in sessionStorage beside the staged files — justified
  5. After a reload, hand-deleting a restored chip's mention now unstages it — rides along: declared side effect of item 4
  6. Remove and reconciliation share one revival predicate (fileChipRevives) — justified
  7. file-search.md spec updated in the same commit — justified

[FIRST-PRINCIPLES-REVIEWED] dc7fc1d

Description read

[DESCRIPTION-READ] 97109eeff62cfaef36a7072ca89c97c15a70bf10502e11875739fdfcca3f0790

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 Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🟡 CONCERNS

UX-level review of dc7fc1d152d45755f44dbffad19e925f39fb417b via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

No first-time reader has seen the restored-chip undo state; the three screenshots cover pick, remove, and restore, so the cap is this lane's limit, not an author gap.

Watch

  • Undo restoring the attachment has no confirmation beyond the chip reappearing in peripheral vision above the composer; a human should verify on the branch that the chip's return is noticeable after Ctrl+Z, since missing it recreates the silent-loss this PR fixes. Low frequency × high impact (message sends without the file) × once per misread.

[UX-REVIEWED] dc7fc1d

Description read

[DESCRIPTION-READ] 3d28d2b377b8db9a287ced2144d6ed89b932866e3d6c526255a000135a642f94

That sha256 names everything this verdict read: the PR description, plus the 6 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 Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed dc7fc1d152d45755f44dbffad19e925f39fb417b via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] dc7fc1d

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review (fork) — ✅ no blocking findings

Reviewed dc7fc1d152d45755f44dbffad19e925f39fb417b via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] dc7fc1d

@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 Sep 28, 2026
@Pearcekieser
Pearcekieser force-pushed the fix/composer-chip-undo-attachment branch from e48fba0 to 24fa235 Compare September 28, 2026 19:09
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Short mention removals overwrite the pre-remove undo snapshot

issue (fixed): upheld and fixed in 24fa235.

fixed: ChatInput wraps the file and folder chip remove callbacks so a click ends the current undo burst (undoLastEditRef = 0) before the parent strips the mention.
The strip therefore gets its own undo entry, and Ctrl/Cmd+Z returns to the text that still holds the mention, which revives the chip.
Typing, voice partials, pickers and recall keep their grouping; a global user-edit gate was rejected because voice partials are parent-driven and would split per chunk.
Test: ChatInput.chipRemoveUndo.test.tsx removes @a.ts 100 ms after a keystroke and undoes to the text with the mention; it fails without the wrap.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Survival guard omits the sibling aliases the strip used

issue (fixed): upheld and fixed in 24fa235.

fixed: the survival check now passes relMentionedHere the same protecting set the reconciliation uses before reviving: other paths' recorded aliases that are live in the stripped text.
With report and report, both staged, the sibling's @report, no longer reads as report still mentioned, so the aliases survive and undo revives the chip.
The suggested otherAliases set was not used: it carries derived-rel fallbacks the reconciliation has no counterpart for, and it broke the restored alias-less sibling case in ChatPage.dirStaging.test.tsx.
Test: ChatPage.chipUndo.test.tsx stages report and report,, removes the shorter, undoes, and expects both chips and both attachments in the send; it fails on the old guard.

@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 28, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Alias-less sibling defeats attachment undo

issue (rebutted, non-blocking): not a defect this PR introduces; the case falls back to exactly what main does today.

Trigger needs a draft restored from storage (no recorded aliases, since pickedFileTokens is never persisted) holding two staged files whose names differ only by trailing punctuation (report, report,), both mentioned, then ✕ on the shorter one and undo.
In that case the remove drops the file's record, which is what main does on every ✕ (delete slotTokens[p] unconditionally), so undo restores the text without the chip, as on main. No attachment that main would send is lost.
The missing chip is visible in the strip before send, and re-picking the file re-attaches it.
The reviewer's narrow fix (derived aliases in liveOthers) makes the reconciliation re-stage the removed file immediately after ✕, sending a file the user removed. Closing the case properly means adding the derived-rel fallback to both sides of the reconciliation contract, which is wider than this PR's goal.
Override reason for a maintainer, if they agree: "Restored-draft prefix-sibling ✕+undo falls back to main's behaviour (record dropped, chip visibly absent, re-pick recovers); the suggested narrow fix would re-stage a removed file."

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Removing a chip whose mention appears twice leaves the second mention without a chip, and undo cannot revive it

issue (rebutted, non-blocking): the chosen trade-off, and no worse than main.

When the strip cannot reach every copy of a file's mention, the surviving copy would read to the reconciliation as the mention coming back. Keeping the record would re-stage the file right after ✕, so a file the user just removed would be sent. The remove therefore drops the record in that case.
That is main's behaviour on every ✕ today: the record is deleted, the leftover text stays, and the chip is gone. This PR does not make the case worse; it makes every other ✕ undoable.
The leftover mention is visible plain text in the composer; re-picking the file re-attaches it.
Test: removing a chip whose token appears twice does not re-stage the file in ChatPage.chipUndo.test.tsx pins that the removed file stays out of the send.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Survival check and revival disagree when the longer prefix sibling is removed

issue (rebutted, non-blocking): the outcome is the revival guard's documented residual on main, and it is no worse than main's ✕.

Case: remove /repo/report, while /repo/report stays staged and mentioned, then undo. The text comes back and the reconciliation refuses revival because a longer alias that extends a staged sibling's live alias is not treated as unambiguous (the "Accepted residual: pasting @report, back while report is staged does not revive" comment above the revival filter).
Result: @report, returns as plain text with no chip. That is what main produces for the same ✕ + undo, since main deletes the record on every ✕; no attachment main would send is lost, and the missing chip is visible before send.
Sharing one predicate between the survival check and the revival filter would not bring the chip back here either: the revival guard refuses this case by design. Changing that guard is the reconciliation contract's call, outside this PR's goal.
The retained record is inert: it is slot-scoped, cleared at send, and revives only if the guard's condition clears (the shorter sibling unstaged).

@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 Sep 28, 2026
@Pearcekieser
Pearcekieser force-pushed the fix/composer-chip-undo-attachment branch from 24fa235 to 206664e Compare September 29, 2026 22:30
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (5d4f173) with no code change. New head is 206664e. Main's #14227 moved the chip reconciliation from an [input] effect to the draft-commit callback; the 243 tests in the four affected files, typecheck and lint pass on the new head.

question (blocking): override request for the fenced GPT finding fd89d98b48d2, needs a repository writer.

The finding needs a draft restored from storage, two staged files whose names differ only by trailing punctuation (report and report,), both mentioned, then ✕ on report and undo. In that case the ✕ drops the file's record, which main does on every ✕ (delete slotTokens[p]), so undo brings back the text without the chip. The missing chip shows in the strip before send and re-picking re-attaches it. The Opus adjudicator reached the same reading and flagged it as a likely edge case. The reviewer's suggested fix makes the reconciliation re-stage the removed file right after the ✕, which would send a file the user removed. The full rebuttal is in the disposition comment above.

If you agree after checking it, the override for this head is:

/ai-review override gpt 206664ed25cd1e19c5eb732e88b06ad26ce50cc6: Restored-draft prefix-sibling remove+undo falls back to main's behaviour (record dropped, chip visibly absent, re-pick recovers); the suggested narrow fix would re-stage a removed file.

@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: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 29, 2026
@Pearcekieser
Pearcekieser force-pushed the fix/composer-chip-undo-attachment branch from 206664e to 8e6736e Compare September 29, 2026 23:30
@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 30, 2026
…ment

Removing an @-picked file chip strips its mention from the composer and
unstages the file, and it also dropped the file's recorded aliases. The
composer undo brought the mention back as plain text, but with the
aliases gone the chip reconciliation had nothing to revive, so the
message sent without the file.

Keep the aliases through the remove, so the existing reconciliation
re-stages the file when undo brings the mention back and unstages it on
redo. The send-clear still drops them. Drop them at remove time only when
a mention of the file survives the strip, so the leftover cannot revive
the chip the click removed.
@Pearcekieser
Pearcekieser force-pushed the fix/composer-chip-undo-attachment branch from cf29fcd to dc7fc1d Compare September 30, 2026 02:31
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto current main with no code change; the new head is dc7fc1d. This re-runs Backend Tests shard 2. On cf29fcd that shard failed only in test/test_remote_crew_chaining.py: the hop-port tests hit EADDRINUSE on a lent hop port on both the Linux and Windows runners, and Coverage Gate failed after them. This PR touches only frontend code, one spec and tests. The whole file passes locally on this head (163 passed). The 282 tests in the six affected frontend test files and typecheck pass on the new head.

On cf29fcd, the GPT, Opus, Design and First Principles reviews passed. The UX review's single Watch item asks a maintainer to press Ctrl+Z once to confirm the chip comes back; the review itself calls that a lane limitation, not an author gap.

@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 Sep 30, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Undo restoring the attachment has no confirmation beyond the chip reappearing

note (acknowledged, non-blocking): the chip returning is the confirmation, the same signal every other chip change uses.

The file chip strip above the composer is where every attachment state is shown. Picking a file adds its chip there, ✕ removes it, and hand-editing a mention adds or removes it. Undo restoring the chip is the same signal, and the third screenshot in the description shows it after Ctrl+Z.
A separate toast or announcement only for the undo path would make that one path behave unlike the other chip changes. That is a composer-wide decision and out of scope for this fix.
Before this PR the silent loss was the chip staying gone while the text came back. After it, text and chip return together, and a send carries the file, which the page tests assert.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Hand-edit unstage of a restored chip rides along

note (acknowledged, non-blocking): it comes with the alias persistence, which this PR needs for undo after a reload.

Persisting the aliases is what makes remove followed by undo work after a reload, which the fenced GPT review required. The same aliases are what let a hand-edit unstage a restored chip, so that fix comes with the persistence rather than being added separately. It is tested and named in the description, and as the review says, it carries no premise risk.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Sep 30, 2026

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

Reviewed. The remove path keeps the file's aliases unless fileChipRevives finds a mention left in the text, reconciliation then handles undo and redo with no new state; drafts share the existing sessionStorage and both send-clear sites delete the alias map; only path strings are kept, keyed by slot; sanitizeTokens rejects malformed entries and paths become attachments only through the existing reconciliation. Tests cover removed-not-undone-not-sent, redo, duplicated mention, prefix pair, old alias and reload.

Non-blocking: aliases now last until the next send, so a hand-typed @src/main.ts after the X re-attaches the file (chip reappears, so nothing is sent unseen), which the table does not mention and no test pins; and ChatPage.tsx:~9030 decides on inputRef.current while the strip runs on setInput(prev).

@iamwhatever
iamwhatever enabled auto-merge (squash) September 30, 2026 05:30
@iamwhatever
iamwhatever merged commit 5df0d97 into kirodotdev:main Sep 30, 2026
100 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 30, 2026
@Pearcekieser
Pearcekieser deleted the fix/composer-chip-undo-attachment branch September 30, 2026 05:52
bolichen97 added a commit that referenced this pull request Sep 30, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
bolichen97 added a commit that referenced this pull request Oct 1, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
bolichen97 added a commit that referenced this pull request Oct 1, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
bolichen97 added a commit that referenced this pull request Oct 1, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
bolichen97 added a commit that referenced this pull request Oct 1, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
bolichen97 added a commit that referenced this pull request Oct 1, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
bolichen97 added a commit that referenced this pull request Oct 1, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
bolichen97 added a commit that referenced this pull request Oct 1, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
bolichen97 added a commit that referenced this pull request Oct 1, 2026
ChatPage.tsx had grown to 9,468 lines holding every chat-page
responsibility inline. It is now the page's facade over 19 cohesive
owners under website/src/pages/chat/page/: composer drafts, staging and
@-mentions; launch / prefill / error hand-off intake; window and
Electron event bridges; busy-turn controls; turn recovery; transcript
rows and jumps; composer chips, rosters, session controls, automation,
follow-up chips and the welcome screen; the composer dock, the pane
notices and the phone top bar.

Moved code is copied verbatim from the base by line span; the only hand
edits are dependency arrays gaining stable refs and setters, and comment
re-pointers. ChatPage keeps its default export, props,
shouldAutoFillOlder and the PREFILL_STORAGE_KEY re-export, and calls each
owner where its inline code ran, so the effect-bearing hook sequence is
unchanged. Code the source-pin tests hold in ChatPage (send, the
switchSlot sites, renderers, paging and pins, the model picker, drawers
and layout) stays there.

Upstream #14773 (chip undo, persisted file-chip aliases) and #14756
(prompt history) are ported into their owners. The owning specs, the
feature map, two RFC line cites and one architecture note are re-pointed
in the same commit. New tests cover the owners that page suites never
exercised and pin the facade, the owners' import graph and their call
order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undo after removing an @-picked file chip restores the text but not the attachment

2 participants