Skip to content

Alt 0.8 motion: page cascade, dialog pop, toasts, streaming cursor, splash (M01–M05) - #3

Merged
3d3dcanada merged 7 commits into
mainfrom
claude/clever-ritchie-b6o8gm
Oct 11, 2026
Merged

3d3dcanada merged 7 commits into
mainfrom
claude/clever-ritchie-b6o8gm

Conversation

@3d3dcanada

@3d3dcanada 3d3dcanada commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Problem and resulting behavior

The 0.7 interface was static. Every state change was an instant swap, so it lacked the motion of a modern app. This PR adds a motion layer with three rules: it never delays a key, it never holds text back for more than about a quarter second, and an idle Alt writes no more to the terminal than with motion off.

Stacked on #2: the base is cloud/0.7-2026-10-11, so the diff shows only the motion work. Retarget to main once #2 merges.

What users see (Full motion, the default):

  • Pages cascade in: rows settle top to bottom, each sliding a few columns and fading up (190 ms).
  • Dialogs dim the page behind them, pop in from 86% with a slight overshoot and a drop shadow, and their colours fade out when closed. The text underneath is final from the first frame.
  • Toasts float in at the top right with a ✓ ✕ • glyph. A toast always shows the current status line: a newer notice, an error or a progress update retires it at once, and identical repeats collapse into one card with a count (×2).
  • Replies stream in with a soft ▍ cursor. Running tools spin and status changes flash. The context meter and job progress glide in eighth-cell steps; progress of unknown size shimmers.
  • Accents: a gradient wordmark; focus rings that breathe only while a task runs; a glow on hover and a flash on click; a 0.7 s launch splash that any key passes through.
  • Motion levels: Full, Reduced (fades only) or Off, in Settings → Appearance → Motion and Ctrl+P motion. ALT_MOTION overrides the choice; the Linux console, TERM=dumb and NO_MOTION are always Off.
  • Whole frames: each frame reaches the terminal in one buffered write inside a synchronized update, so no terminal shows half a frame.
  • No layout jumps: the job footer appears only after a job has run for 250 ms, so instant refreshes don't shift the layout.
  • Quitting: Ctrl+Q doesn't ask "Leave Alt?" over a disposable view refresh. Running tasks, connections and downloads still ask.

Clips and stills are in docs/screenshots/0.8/motion/. Design, budgets and measurements are in docs/MOTION.md.

Validation

Order Commit Test Result Deferred
M01 engine, levels, pacing, glides f861ba8 motion unit tests (easing, blend, levels, glides, transitions, toasts, reveal, flashes, splash), settings and palette reach, adaptive pacing, eighth-cell meters Pass —
M02 cascade, dialog pop 554563c final frame exact, Reduced keeps text in place, Off draws in place, dialog pop and close, fx tests Pass —
M03 toasts, reveal, flashes 6d78a2e toasts collapse, replace, retire and expire; progress never toasts; reveal cursor; history appears whole; flash and spinner Pass —
M04 accents, pointer, splash b70f236 splash yields to keys and ends within budget, Reduced has none; hover and click; idle frames identical over time; busy rings breathe; gradient Pass —
M05 proof bcf6566 frame_time_stays_inside_budget…, capture_motion.py --check, clips Pass Frame time and perceived smoothness on the reference PC; non-xterm terminals
CI fix 1 9fc98cc dialog close shows the new text at once (fx and view tests) Pass locally; CI still red, so the diagnosis was incomplete —
CI fix 2 cd96aaf quit prompt only for real work; smoke_allowance_tui 20/20 journeys under 6 CPU burners on 4 cores (0.7 baseline: 12/13 under the same load); pressure 30/30 ×2 and 30/30 under load Pass; CI green —
  • Every order passed cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test, and the TUI smokes with motion at its default (Full): tui, task, workbench, harness, verification, practice, allowance (real Goose) and pressure (30 rounds).
  • M05 head (bcf6566): the complete scripts/setup-cloud.sh exited 0, with 199 Rust tests, 72 Python unit tests, every TUI smoke, real-Goose openai and ollama, compact and stream-recovery smokes, and the motion check.
  • Current head (cd96aaf): 200 Rust tests, every TUI smoke, smoke_pc_recorder and the motion check pass, and CI (linux, training-handoff, GitGuardian) is green.
  • Frame time (release build in a cloud container, 160×48, same scripted session at both levels): Off 1.39 ms median / 4.17 ms p95; Full 1.44 ms / 2.45 ms.
  • Terminal output: a page change at 120×40 writes about 30 KB (Off: about 10 KB). Settled idle output is equal with motion on and off (about 575 bytes per 1.5 s). --check runs in setup-cloud.sh and verify CI.
  • Secret scan: 0 findings. Repo weight: 0 problems. Every GIF and still is under 1 MiB.

Problems found and fixed:

  • Bandwidth: a per-frame page slide wrote about 83 KB per change, and smoke_pressure_tui stalled when its reader paused mid-transition. Transitions are now drawn in a few distinct stages, so identical frames cost nothing.
  • Stale toasts: two smokes matched old confirmations. A toast is now tied to the current status line.
  • Stale PTY output: smoke_tui judged a resumed session by the previous process's unread frames. It now drains its PTY between processes.
  • CI failure (smoke_allowance_tui, 80×24): reproduced under CPU load. Two races were to blame:
    • Frames left Alt in ~1 KiB pieces, so a reader could see half a frame. Each frame is now one buffered write inside a synchronized update.
    • A short refresh job briefly grew the footer and moved the buttons, so a click landed on the composer. Short jobs no longer resize the layout.
    • The second race also exists on the 0.7 baseline; the faster frame pacing exposed it more often.
  • Harnesses: they now keep reading the PTY while Alt exits, as a terminal does.

Compatibility and recovery

  • New preference: preferences.motion (default full). Existing preferences.toml files load unchanged.
  • No new dependencies. No keys, GPU or weights were used.
  • Off restores the previous visuals: set Motion to Off or ALT_MOTION=off. The status line still carries every notice.
  • Clicks during a transition go to the target's settled position. Hit targets never move.
  • Behaviour changes:
    • Quitting during a disposable view refresh no longer asks for confirmation.
    • The job progress footer appears after 250 ms instead of immediately.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Tbobytt56pieYgqXeVGKrx

- src/tui/motion.rs: one clock (pinnable for tests), ease-out cubic,
  ease-in-out cubic and ease-out-back curves, keyed tweens, RGB blending,
  and the transition/toast/reveal/flash state later orders draw from.
- Motion level Full | Reduced | Off saved as preferences.motion; ALT_MOTION
  overrides it; NO_MOTION, TERM=linux and TERM=dumb force Off. Settings →
  Appearance → Motion and the palette entry 'Setting: Motion' choose it.
- Run loop: 16 ms frames only while something animates, 60 ms idle; any
  input or update draws within one fast frame instead of waiting a tick.
- Spinners follow the clock, so speed no longer depends on frame rate.
- Header context meter and job progress glide in eighth-cell steps.

Tests: easing, blending, level resolution, glides, transitions, toasts,
reveal, flashes, splash budget, eighth-cell meters, settings/palette reach
and adaptive pacing. fmt, clippy -D warnings, cargo test (185 passed),
smoke_tui and smoke_task_tui pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tbobytt56pieYgqXeVGKrx
- src/tui/fx.rs: buffer post-processing (fade, slide, snapshot, changed
  bounds, scaled clip, shadow, fade-out, gradient, tint). Effects only
  recolour or move cells widgets already drew; hits and text are untouched.
- Page change: rows cascade in top to bottom, each sliding a few columns
  and fading up from the background over 190 ms. Reduced fades only.
- Dialogs: the page dims behind them in one step, the dialog pops from 86%
  with a slight overshoot (ease-out-back) and casts a shadow; closing fades
  the last dialog frame out over 110 ms. Targets are live from frame one.
- Bandwidth: transitions are quantised into a few distinct stages so
  identical frames diff to nothing. A page change at 120x40 writes ~30 KB
  (Off: ~10 KB) instead of ~83 KB for a per-frame slide; this also fixes
  smoke_pressure_tui stalling when the reader paused mid-transition.

Tests: cascade settles on the exact final frame, Reduced keeps text in
place, Off draws in place, dialog pop/close, fx unit tests, stepping. fmt,
clippy -D warnings, cargo test (192 passed), smoke_tui, smoke_task_tui,
workbench, harness, verification, allowance (Goose), practice and
pressure (30 rounds) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tbobytt56pieYgqXeVGKrx
- Toasts: notices float in at the top right of the page (slide + fade in
  four stages) and leave after 3.2 s. A toast always equals the current
  status line: a newer notice replaces it, any other status (error,
  progress, direct update) retires it, identical repeats collapse into
  one card with a count. The status line is unchanged and still the
  source of truth; workspace progress updates never toast.
- Streaming: the newest reply is revealed as it arrives with a soft '▍'
  cursor, catching up at >=120 chars/s and never more than ~250 ms
  behind; history and finished replies appear whole.
- Tool list: running tools spin, status changes flash green/red and fade
  over 650 ms.
- Job progress with no known size shows a moving shimmer (Full only).
- smoke_tui: drain the first process's unread frames before judging the
  resumed session on the same PTY (it matched stale output).

Tests: toast collapse/replace/retire/expire, progress never toasts,
reveal cursor and whole history, flash/spinner, motion units. fmt,
clippy -D warnings, cargo test (195 passed), smoke_tui, smoke_task_tui,
workbench, harness, verification, allowance (Goose), practice and
pressure (30 rounds) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tbobytt56pieYgqXeVGKrx
- Header wordmark 'ALT //' is a two-accent gradient in every theme.
- Focus rings breathe toward the second accent only while a task runs;
  an idle Alt writes nothing to the terminal (eight levels per breath).
- Mouse: the target under the pointer glows (stepped fade-in) and a click
  flashes it for 140 ms. Moves are tracked from the existing capture.
- Launch splash (Full motion only, 720 ms): gradient wordmark, tagline and
  a filling bar, then the interface cascades in. Any key passes straight
  through and ends it; a click only ends it (it cannot aim at a hidden
  screen). Reduced and Off have no splash.
- Dialog pop draws a ring on the growing edge, so the reveal stays a
  clean box; toasts carry a tone glyph (✓ ✕ •).
- Removes the staging dead-code allowances from M01/M02.

Tests: splash covers then yields to keys and ends within budget, Reduced
has none; hover tint and click flash; idle screens are byte-identical
over time while busy focus rings breathe; gradient hue. fmt, clippy -D
warnings, cargo test (198 passed), smoke_tui, smoke_task_tui, workbench,
harness, verification, allowance (Goose), practice and pressure (30
rounds) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tbobytt56pieYgqXeVGKrx
- frame_time_stays_inside_budget_with_every_effect_active runs one
  scripted session (page changes, dialogs, toasts, gliding meter, busy
  task, 40 messages) at 160x48 with motion Off and Full. Release: Off
  1.39/4.17 ms, Full 1.44/2.45 ms (median/p95); budget 8 ms p95 release,
  60 ms debug, or ALT_FRAME_BUDGET_MS.
- Dialogs record their own rect; a full-screen snapshot is taken only
  during the 170 ms entrance, so a settled dialog costs no extra copy.
- scripts/capture_motion.py: records every byte Alt writes through a PTY
  with timestamps, replays it into a terminal emulator, writes GIF clips
  (80x24, plus launch at 120x40) and 120x40 stills, and reports bytes with
  motion against motion off. --check fails above ~4x the Off bytes or when
  a settled screen keeps writing; it runs in setup-cloud.sh and verify CI.
- docs/MOTION.md (levels, effects, budgets, measurements), the M01-M05
  board with status, CHANGELOG and README entries.

Validation: complete scripts/setup-cloud.sh exit 0 (199 Rust tests, 72
Python unit tests, every TUI, real-Goose openai/ollama, compact and
stream-recovery smoke, motion check), smoke_pressure_tui 30/30.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tbobytt56pieYgqXeVGKrx
The close fade kept the old dialog's characters for its first half
(~55 ms). smoke_allowance_tui read the screen in that window after Esc
and could not find the composer's button row (CI, 80x24). A closed
dialog now leaves only its colours to fade; the text beneath is final at
once, so nothing stale can be read or clicked.

Tests: fx fade-out keeps new text early and blends colours; dialog close
test asserts the text is gone at once while colours still fade. fmt,
clippy -D warnings, cargo test (199 passed), all TUI smokes, allowance
(Goose) three times, pressure 30/30, capture_motion --check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tbobytt56pieYgqXeVGKrx
CI on this PR failed smoke_allowance_tui at 80x24. Reproduced under CPU
load and traced to two races the faster motion pacing made visible:

- Stdout flushes in ~1 KiB pieces, so a reader could see half a frame
  (closing a dimmed dialog repaints the whole screen). Frames now go
  through a 1 MiB buffered backend, one write per frame, wrapped in a
  synchronized update (ignored by terminals without it).
- A short refresh job after each turn grew the footer from 3 to 6 rows
  and back, moving the composer buttons; a click aimed at the transient
  layout landed on the composer. The job footer now appears only after a
  job has run for 250 ms. The same race fails on the 0.7 baseline under
  load (1 of 3 runs); this head passed 20/20 journeys under that load.
- Ctrl+Q no longer opens 'Leave Alt?' over a disposable (replaceable)
  view refresh; running tasks, connections and downloads still ask.
- Harnesses keep reading the PTY while Alt exits (terminal_harness,
  smoke_pressure_tui), as a terminal does, and report the screen if it
  does not; the allowance smoke clicks only a button row that held still.

Tests: quit prompt only for real work. fmt, clippy -D warnings, cargo
test (200 passed), every TUI smoke, allowance (Goose) x2, pc_recorder,
capture_motion --check, pressure 30/30 x2 and 30/30 under CPU load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tbobytt56pieYgqXeVGKrx
@3d3dcanada
3d3dcanada changed the base branch from cloud/0.7-2026-10-11 to main October 11, 2026 23:47
@3d3dcanada
3d3dcanada merged commit af304e3 into main Oct 11, 2026
5 checks passed
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.

2 participants