Skip to content

rewind: web rewind menu moves to useMessageRewind and its own files - #48

Merged
ziyadakl merged 2 commits into
spec107/integrationfrom
spec107/rewind-web
Nov 3, 2026
Merged

ziyadakl merged 2 commits into
spec107/integrationfrom
spec107/rewind-web

Conversation

@ziyadakl

@ziyadakl ziyadakl commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Part of ziyadakl/tokenmaxxing#122 (spec pingdotgg#107, rewind step 4 of 5: web).

Summary

The rewind menu, code restore and Esc-to-stop-or-rewind move out of Upstream's web files into the Fork's own files. No behaviour change.

ChatView.tsx
  timelineRewindInput = { ...Upstream's 17 args }
  useTimelineRewind(timelineRewindInput)      # Upstream, now only fork-from-run is used
  useMessageRewind({ ...input, rewind extras }) # Fork: menu, picker, Esc, revert callbacks
  <MessageRewindOverlays {...rewindOverlayProps} />
 apps/web/src/
+├── components/chat/useMessageRewind.ts       # the hook (was inside useTimelineRewind)
+├── components/chat/messageRewind.logic.ts    # menu, plan, preview, wait-for-outcome, targets, isMessageRewindDisabled
+├── components/chat/messageRewindSend.ts      # RevertAction, rewindToMessageWithChoice
+├── components/chat/MessageRewindOverlays.tsx # picker + dialog
-├── session-logic.ts, state/queries.ts        # back to Upstream byte for byte
-├── components/chat/useTimelineRewind.ts, chatViewSend.ts   # back to Upstream byte for byte
-└── ChatView.logic.ts                         # only the /compact lines left
 docs/user/rewind.md                           # rewind text moves out of composer.md (one link line stays)

Footprint (Upstream files the Fork edits, git diff --no-renames --numstat --diff-filter=MD <merge-base> HEAD):

  • Whole Fork: 181 files, +13694 -2908 -> 175 files, +12325 -2763.
  • Web rewind alone: 11 production files (ChatView.tsx, ChatView.logic.ts, useTimelineRewind.ts, chatViewSend.ts, session-logic.ts, queries.ts, MessagesTimeline.tsx, MessagesTimeline.logic.ts, TimelineUserMessageRow.tsx, timelineRowContext.ts, composer.md) and 3 test files, about +830 -130 -> 6 production files (ChatView.tsx, MessagesTimeline.tsx, MessagesTimeline.logic.ts, TimelineUserMessageRow.tsx, timelineRowContext.ts, composer.md), about +60 -35. ChatView.logic.ts and MessagesTimeline.logic.test.ts still carry other features' lines (/compact, keep answers).

Not moved, on purpose: Upstream's onRevertToTurnCount stays in useTimelineRewind but nothing calls it any more, and Upstream's rewindToMessage and waitForRevertedMessage are unchanged. Behaviour has to stay identical, so the checkpoint revert on other providers keeps the Fork's wait (waitForRewindOutcome) rather than Upstream's. Deleting the dead Upstream callbacks would put them back in the footprint, and knip rejects an unused rewindToMessage. rewindToMessageWithChoice therefore repeats most of rewindToMessage.

Evidence

  • Before: 11 web files (rewind, ChatView, MessagesTimeline, session-logic, escape/picker browser tests included): 11 passed, 320 tests passed.
    After: the same files plus the new messageRewind.logic.test.ts: 12 passed, 326 tests passed. The extra 6 are Upstream's original waitForRevertedMessage cases, restored in ChatView.logic.test.ts.
  • Full web suite: 513 of 515 files pass; AttachmentFilePreview.browser.test.tsx and fileEditorDismissal.browser.test.tsx failed under full-suite load, and both pass alone (134 tests).
  • vp check 0 errors, tsc --noEmit for web clean, vp run knip:check clean.
  • Moved tests keep their bodies: messageRewindBlockedReason, deriveMessageRewindMenu, planMessageRewind, decideMessageRewindStart, waitForThreadToStop, loadThreadRewindPreview, the session-logic rewind cases and isMessageRewindDisabled. The Fork's waitForRevertedMessage tests moved under waitForRewindOutcome (name only). useMessageRewind is the old hook body minus fork-from-run (diffed line by line against the old useTimelineRewind); no ChatView browser test drives the rewind menu end to end.

Merge Danger

Door: two-way. Web only; reverting the commit restores the old files.

Blast Radius: web chat view. The rewind menu, Esc picker and checkpoint revert all run through the new hook, so a mistake would show there first. The server and Claude adapter PRs touch no web file.

🤖 Generated with Claude Code

The rewind menu, code restore and Esc-to-stop-or-rewind logic leave
Upstream's ChatView.logic.ts, session-logic.ts, state/queries.ts,
chatViewSend.ts, useTimelineRewind.ts and MessagesTimeline.logic.ts for
useMessageRewind.ts, messageRewind.logic.ts, messageRewindSend.ts and
MessageRewindOverlays.tsx. ChatView calls both hooks and renders one
overlay element. Tests for the moved functions move with them; the rewind
section of composer.md moves to docs/user/rewind.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 3, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ziyadakl
ziyadakl merged commit 9d8a977 into spec107/integration Nov 3, 2026
27 checks passed
@ziyadakl
ziyadakl deleted the spec107/rewind-web branch November 3, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants