Skip to content

app: undo and redo show a document's transport - #472

Merged
foxnne merged 1 commit into
mainfrom
app/history-transport
Oct 16, 2026
Merged

foxnne merged 1 commit into
mainfrom
app/history-transport

Conversation

@foxnne

@foxnne foxnne commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Part of plans/RECORDING_PLAN.md (fizzyedit/plans#17), step 5, first half: the transport. The hot zone and pixi's history line follow.

What changes

Undo and redo show a document's transport (app.HistoryTransport): a bar of glass at the bottom centre of that document's own pane.

  • What's on it: its history as a line with a tick per step (while they stand 6 points apart) and a knob where the document is; undo and redo bubbles either side; the step's title with how far along it is ("Edit 2 / 3").
  • The look: three bubbles of one liquid glass (core.dialogs.glassBubbles), as the demo player's transport is.
  • The line: a press on the line's band goes to the step under it, and a drag follows the pointer. That's at most one historyGoTo a frame, so a drag across a thousand steps costs a jump a frame. A press on the title does nothing. A drag lasts only while the bar holds the mouse: if the bar stopped drawing mid-drag (a claim came), the drag is over. The bubbles step one at a time.
  • Coming and going: the bar fades in, stays while the pointer is on it or a drag holds it, and goes 3 s after it was last touched. While it shows, it sets one timer for its next change (fully in, starting to go, gone); once gone it sets none and asks nothing of the owner.
  • A held undo or redo goes further each press: one step a press for the first six, then 2, 4, 8, … up to 32. A press the other way starts a new run. Each step is the owner's own undo/redo command, so anything an owner does around an undo still happens. The bar doesn't show on a claimed document, or when there's nothing to undo or redo.
  • The activity feed stays above the bar, as it does above a claim's pill. The bar's place is computed before either draws (place), so they don't overlap even on its first frame. A first version used the bar's rect from the frame before, and they overlapped on the frame it came in.
  • Anchors history.line:<path> (its x is that fraction of the history), history.back:<path> and history.forward:<path>, unprefixed like app/'s others (region:, picker:), for tapes and tests. Documented in docs/AUTOMATION.md.

For any owner with historyLine and historyGoTo, so text has it now. Pixi needs both (it has step ids since fizzyedit/pixi#45). That's in the next half, with the hot zone: the pointer near a view's bottom centre, no button held, a short dwell, bringing the bar up.

The rules are std-only and tested on their own (app/history_transport.zig, fizzy-history-transport-tests): when the bar shows and for how long, how far a held key goes, and which step a point on the line is.

Not built yet:

  • Going back then editing still clears redo, as undo always has. The timeline plan's "going back is a step" (HISTORY_TIMELINE_PLAN.md step 4) is what keeps it on the line.
  • Authors and times on the line. Authors come with SHARED_HISTORY_PLAN's step 2; times are in the tracks already.

SDK impact

  • None
  • Core-only or additive: reaches plugins at the next SDK release
  • Fingerprint moved: recorded in sdk/src/version.zig, sdk_version untouched, PR labelled sdk
  • SDK release: bumps sdk_version, lists the sdk PRs since the last sdk-v* tag

Verified

  • macOS:
    • scripts/check-fmt.sh, zig build, zig build check-web, zig build test-sdk-version and zig build check-tests-reached pass.
    • zig build test: 572/573 (1 skipped), including the transport rules. zig build test-integration: 53/53 steps, 542/542 tests.
    • The new integration test makes 40 steps in a text document and undoes. It checks:
      • the bar shows, at 39;
      • a live tape clicking the title over the line's start leaves it at 39;
      • clicking the line's start goes back before every change (0), and clicking redo goes to 1;
      • a drag along the whole line ends at 40;
      • ten undos in one frame go 14 steps, landing at 26.
    • Seen in a running fizzy (Debug, driven through the agent plugin's bridge): the bar over the document undo was pressed in, its label, ticks and knob, and the feed's bubbles above it once its place was computed first.
  • Windows: not run.
  • Linux: CI.
  • Web: check-web builds. Not seen there yet.

Follow-ups

  • The hot zone, and historyLine / historyGoTo for pixi (the second half of step 5).
  • "Going back is a step", so scrubbing back and editing loses nothing.
  • The line is asked for each frame the bar shows. HistoryLine.version can't save that, because reading the version means building the line. A historyVersion hook (one number, no allocation) is the seam, for when long histories make it show up in the profiler.

🤖 Generated with Claude Code

Undo and redo now show a bar of glass at the bottom of the document's pane: its history as a
line with a tick per step and a knob where the document is, undo and redo either side, and the
step's title with how far along it is (`app.HistoryTransport`). A press on the line goes to the
step under it, a drag follows the pointer (one `historyGoTo` a frame at most), and the buttons
step. The bar stays while the pointer is on it and goes 3 s after, with one timer wake while it
shows and none once it has gone. An undo or redo held down goes one step a press for six presses,
then two, four, up to thirty-two, in one jump each. The activity feed stays above the bar.

Over any owner with `historyLine` and `historyGoTo`, so text has it now. The rules (when it
shows, how far a held key goes, which step a point is) are std-only
(`app/history_transport.zig`). The bar publishes `fizzy.history.line`, `.back` and `.forward`
anchors for tapes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@foxnne
foxnne force-pushed the app/history-transport branch from 23231ec to 5374435 Compare October 16, 2026 21:46
@foxnne
foxnne marked this pull request as ready for review October 16, 2026 21:46
@foxnne
foxnne enabled auto-merge (squash) October 16, 2026 21:54
@foxnne
foxnne merged commit 3a8031f into main Oct 16, 2026
11 checks passed
@foxnne
foxnne deleted the app/history-transport branch October 16, 2026 21:54
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.

1 participant