Repository navigation
feat(chat): fork with earlier or later messages from the message menu - #21961
Conversation
bolichen97
left a comment
There was a problem hiding this comment.
Good to ship from my read, pending CI and the review lanes on this head.
Head reviewed: 139fcc7. The review lanes had not run on this head because the fork workflows were waiting for approval. I approved those runs, so I make no claim about their verdicts yet.
What I checked by hand:
forkHasLaterMessagescompares the window index fromvisibleIndexMap(user and assistant rows only) with the same map's size. This matches the server's tail split inchat_fork.py, which refuses an empty tail withno_messages_after_fork_point.- With Tail-only Fork off,
forkDirectionChoiceis false, so the menu, labels and the too-large advice are unchanged. - The too-large advice now names the entry that was pressed. The head and tail sentences still point at the correct end of the transcript.
- The server contract is unchanged. The client only adds an explicit
direction="head", which the server already accepts. - No CI trust path, security path or manifest is touched. The capture page and script follow the existing
website/capture/andwebsite/scripts/capture-*pattern.
🔴 0 must-fix. 🟡 1 should-fix (inline, non-blocking): the new i18n key names do not match their strings.
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that [DESIGN-REVIEWED] 86dc00d Description read[DESCRIPTION-READ] 881d640ca93254be2068f376ebad993887c9b7380a0b47461da447a4621544d6 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 |
First Principles Review (Opus 5.5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The new "Forking…" label and "Another fork is starting." line add two strings to all 13 catalogs for a state that spinner-plus-dimming already shows. Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: let a Tail-only Fork user choose a full-history fork at the moment they fork, without a trip to Settings. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 86dc00d Description read[DESCRIPTION-READ] 3c21a5ddcb4ace485f49cc914e8c44a072d6c410596082ebdcd5b2ae5f212101 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5, fork) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Every fork state has a still, but no first-time reader has seen them, so nobody has checked that users can tell "earlier" from "later only". Watch
Suggestions
[UX-REVIEWED] 86dc00d Description read[DESCRIPTION-READ] a3417b83ae6acd2f343d18ca0c8ecbf38707e5326c50b14627b4ef26e84b4b65 That sha256 names everything this verdict read: the PR description, plus the 13 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 |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
139fcc7 to
6b6b714
Compare
|
|
|
|
|
|
6b6b714 to
87c4d10
Compare
With Tail-only Fork on, the message menu lists "Fork with later messages only" and "Fork with earlier messages", each with a line naming what the new chat holds, so a full-history fork no longer needs the global setting flipped first. On the newest message the later-messages entry is held, because a tail fork there has nothing to copy and the server refuses it with `no_messages_after_fork_point`. The hold is read when the menu opens and again on select, so an older reply re-enables once a newer message arrives, and a refusal that still reaches the server reads "No messages after this one yet." While a fork runs, the chosen entry reads "Forking…" and the other entry says another fork is starting. With the setting off the menu is unchanged. Closes kirodotdev#18611 Co-authored-by: Javen Cinocca <129346815+javenciu@users.noreply.github.com>
87c4d10 to
86dc00d
Compare
|
|
|
The three UX evidence gaps are closed in 86dc00d. Each still is asserted by
Both refusal stills go through the real The workflows on the new head need maintainer approval. The red |
bolichen97
left a comment
There was a problem hiding this comment.
Approving on head 86dc00d. Checked: readiness passed with the PR Readiness check green, no failing or pending checks, no blocking reviewer lane, mergeable against main, linked issue is tier T2, and no file on the security path denylist. Thanks for the change.
Problem / Motivation
Goal: Let a user who keeps Tail-only Fork on take a full-history fork from the message menu at the moment they fork, without flipping the global setting first.
"Fork conversation from here" follows one global setting, Tail-only Fork (
tail_fork_enabled). Off, the fork copies the transcript up to the chosen message. On, it keeps only the messages after that point. The setting applies to every session at once, so a user who wants both kinds of fork has to open Settings before each one, and a toggle left in the wrong position silently changes what the next fork produces.This continues #19963 by @javenciu, which was closed unmerged with three open review items. The commit carries their work with a
Co-authored-bytrailer.Why it matters
People who split long threads with tail forks also want ordinary forks that keep the history. Today that costs a trip to Settings per fork, and forgetting the trip gives them the wrong fork with no warning.
Not a goal
chat_fork.py.What changed (motivation → approach → change)
With Tail-only Fork on, the message menu offers both forks side by side. Each entry has a short line naming what the new chat holds, so the choice is made at the moment of forking.
useChatPageSlotSwitches.tssends an explicitheadfor the second entry and lets the setting decide for the plain one, andChatPage.tsxpasses the choice to the transcript.tailheadOn the newest message the later-messages entry is held and its line reads "No messages after this one yet.", because the server refuses an empty tail with
no_messages_after_fork_point.transcriptRendering.tsxpasses a stableforkHasLaterMessagescheck that reads the live list of user and assistant rows, the same roles the server counts. The menu asks it when it opens and again on select, andAssistantMessage.tsxuses it, so an older reply re-enables once a newer message arrives even though settled turns do not re-render. If the server still refuses,utils/forkFailure.tsshows the same words, and its too-large advice names the menu entry that copies fewer messages. While a fork runs, the chosen entry reads "Forking…" and the other entry's line reads "Another fork is starting." While both entries show, the menu is capped to the viewport so their lines wrap on a phone. The new strings are in all 13 catalogs underwebsite/src/i18nwith translator context, andhistory.mddocuments the second entry.Backwards compatibility
Compatible: with Tail-only Fork off the menu is unchanged, and the server already accepts an explicit
direction="head".Removes nothing: the change only adds a menu entry, its hint lines and a client-side hold.
Tests
AssistantMessage.test.tsx: the two entries, their order, labels, icons and hints;headfrom the second entry and the plain call from the first; the newest-message hold; the hold re-reading on menu open; a held entry staying inert while its menu stays open; a select refused when the live check changes; busy labels and hints for each entry; the menu unchanged with the setting off.ChatPageMoreCoverage.test.tsx: the page offers the choice only while the setting is on, sendsheadfrom the second entry whatever the setting says, and hands rows a check that flips once a message is appended after an older reply, with the same function identity.forkFailure.test.ts:no_messages_after_fork_pointreads like the held entry, other codes keep the server's text, and the too-large advice names the control it is given.ChatPageMoreCoverage.test.tsx(too-large refusal): with the setting on, the advice names "Fork with earlier messages" for aheadfork and "Fork with later messages only" for atailfork; with it off, it names "Fork conversation from here".Determinism: the new tests are synchronous component and store assertions with no timers or network. I ran the touched suites repeatedly and in the full related frontend set (489 files, 13057 tests) with no failures.
Manual verification
website/scripts/capture-18611-fork-menu.mjsdriveswebsite/capture/fork-menu.htmlin Chromium with hit-tested clicks: 93 checks pass, covering setting on (dark and light) and off, the newest reply, a fork in flight from each entry, the empty-tail and too-large refusal banners fed through the realutils/forkFailure.ts, and 320 / 390 / 760 px widths with no entry wrapping when the setting is off.Screenshots / video
This is a fork PR, so the stills are committed under
temp-screenshots/fork-menu/.Setting on:
temp-screenshots/fork-menu/fork-menu-setting-on.pngFork in flight:
temp-screenshots/fork-menu/fork-menu-fork-in-flight.pngSetting on, light theme:
temp-screenshots/fork-menu/fork-menu-setting-on-light.pngFork in flight from Fork with later messages only:
temp-screenshots/fork-menu/fork-menu-fork-in-flight-later.pngEmpty-tail refusal:
temp-screenshots/fork-menu/fork-menu-refusal-empty-tail.pngToo-large refusal, setting on:
temp-screenshots/fork-menu/fork-menu-refusal-too-large.pngNewest reply:
temp-screenshots/fork-menu/fork-menu-newest-reply.pngSetting off, 320 px and 390 px
Related Issues
Closes #18611
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement