Skip to content

TUI - drive all visual animations by elapsed time - #4987

Open
krissetto wants to merge 1 commit into
docker:mainfrom
krissetto:animation-durations
Open

krissetto wants to merge 1 commit into
docker:mainfrom
krissetto:animation-durations

Conversation

@krissetto

Copy link
Copy Markdown
Contributor

Consolidate usage of duration based animations and easing effects across all docker-agent surfaces, and add a linter rule to try and catch raw tick-based animations in the future

Copilot AI balanced review requested due to automatic review settings November 21, 2026 13:40

Copilot AI 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.

🟡 Changes recommended

The clock is not paused during shell and suspend terminal handoffs, so subsequent ticks incorrectly count time spent away and jump the spinner phase.

1 open issue
What changed in this PR

This PR moves visual animations across the full-screen TUI, lean TUI, and board from tick counters to elapsed-time sampling, making animation speed independent of refresh cadence.

Changes:

  • Centralizes animation durations and progress helpers, excluding idle time from the shared clock.
  • Migrates spinners, transfer rails, recording dots, and transcript slack to elapsed-time updates.
  • Adds timing tests, package documentation, and a linter rule against tick-driven visuals.
File Description
pkg/​tui/​tui.go Connects recording editors to shared animation ticks.
pkg/​tui/​components/​spinner/​spinner.go Samples the text highlight sweep by elapsed time.
pkg/​tui/​components/​spinner/​spinner_test.go Tests sweep positions and dwell boundaries.
pkg/​tui/​components/​sidebar/​sidebar.go Converts transfer rail motion to elapsed time.
pkg/​tui/​components/​sidebar/​agent_transfer_test.go Tests rails using accepted runtime ticks.
pkg/​tui/​components/​sidebar/​agent_panel_test.go Uses a deterministic animation scheduler.
pkg/​tui/​components/​reasoningblock/​reasoningblock.go Uses shared progress calculation for tool fades.
pkg/​tui/​components/​messages/​slack_test.go Tests elapsed-time slack decay and cleanup.
pkg/​tui/​components/​messages/​messages.go Decays transcript slack by elapsed duration.
pkg/​tui/​components/​editor/​recording_animation_test.go Tests recording dots, pause behavior, and cleanup.
pkg/​tui/​components/​editor/​editor.go Moves recording dots onto the shared runtime.
pkg/​tui/​animation/​transition.go Adds reusable elapsed-time progress calculation.
pkg/​tui/​animation/​transition_test.go Tests irregular samples, pauses, and idle intervals.
pkg/​tui/​animation/​spinners.go Clamps negative elapsed time before calculating steps.
pkg/​tui/​animation/​durations.go Defines shared durations for migrated effects.
pkg/​tui/​animation/​doc.go Documents animation clocks and timer exemptions.
pkg/​tui/​animation/​coordinator.go Clears the elapsed baseline when subscriptions become idle.
pkg/​leantui/​view.go Passes elapsed animation time into screen rendering.
pkg/​leantui/​ui/​transcript.go Uses elapsed time for live tools and working indicators.
pkg/​leantui/​ui/​tool.go Creates tool snapshots from elapsed duration.
pkg/​leantui/​ui/​tool_test.go Updates tool rendering tests to duration inputs.
pkg/​leantui/​ui/​screen.go Propagates elapsed time through screen rendering.
pkg/​leantui/​tool_test.go Updates snapshot and cache tests to duration inputs.
pkg/​leantui/​leantui.go Accumulates spinner time while busy UI is active.
pkg/​leantui/​animation_test.go Tests active-time sampling and idle exclusion.
pkg/​board/​tui/​view.go Renders busy-card glyphs from the animation clock.
pkg/​board/​tui/​tui.go Adds runtime subscriptions and attach pause/resume handling.
pkg/​board/​tui/​animation_test.go Tests board spinner timing and idle exclusion.
lint/​tui_animation_duration.go Detects tick-based visual counters and legacy frame reads.
lint/​tui_animation_duration_test.go Tests detection and exempt timer patterns.
lint/​registrations_test.go Verifies registration of the new rule.
lint/​main.go Registers the animation-duration linter rule.

Review effort: Balanced

Comment thread pkg/board/tui/tui.go Resolved
@aheritier aheritier added the area/tui For features/issues/fixes related to the TUI label Nov 21, 2026
Copilot AI balanced review requested due to automatic review settings November 21, 2026 14:19

Copilot AI 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.

🟢 Approval recommended

No active review issues require resolution for the elapsed-time animation changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@aheritier aheritier added the kind/refactor PR refactors code without behavior change label Nov 21, 2026
@krissetto
krissetto marked this pull request as ready for review November 21, 2026 15:30
@krissetto
krissetto requested a review from a team as a code owner November 21, 2026 15:30
@krissetto

Copy link
Copy Markdown
Contributor Author

@dgageot n @rumpl mind giving this a spin? I tried to sanity check the lean TUI and board, but not using them much I'm not 100% confident that no regressions exist

@aheritier aheritier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving these effects off tick counts. The board now excludes time spent away from the terminal, but the full-screen TUI still charges that time to the newly migrated animations.

Prior threads: #4652813108 is addressed. The board pauses before suspend, resumes when Bubble Tea returns, and handles both successful and failed shell exits.

Comment thread pkg/tui/components/editor/editor.go Resolved
Comment thread pkg/tui/tui.go Resolved
Comment thread lint/tui_animation_duration.go Resolved
@aheritier
aheritier marked this pull request as draft November 22, 2026 00:10
@aheritier

Copy link
Copy Markdown
Collaborator

Please mark this PR ready for review once you have addressed the review feedback.

Copilot AI balanced review requested due to automatic review settings November 22, 2026 00:15

Copilot AI 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.

🟡 Changes recommended

Fullscreen shell and external-editor handoffs leave the animation runtime running, causing elapsed-time effects to jump ahead when the UI resumes.

1 open issue

Review effort: Balanced

Comment thread pkg/tui/tui.go Resolved
Copilot AI balanced review requested due to automatic review settings November 22, 2026 00:30
@aheritier aheritier added the status/needs-rebase PR has merge conflicts or is out of date with main label Nov 22, 2026
@aheritier

Copy link
Copy Markdown
Collaborator

👋 This PR has merge conflicts with the base branch. Please rebase or merge the latest base branch and resolve them. I've moved it to draft and added status/needs-rebase; it'll be picked back up automatically once the conflicts are cleared.

Share durations and easing across terminal UIs, preserve discrete effect pacing at different redraw cadences, and flag tick-counted visual progress in the project linter.

Signed-off-by: Christopher Petito <chrisjpetito@gmail.com>

Copilot AI 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.

🟢 Approval recommended

No active review issues are recorded for the elapsed-time animation changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 22, 2026 00:35

Copilot AI 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.

🟢 Approval recommended

There are no active review issues blocking approval of the elapsed-time animation changes.

No open issues 🎉

Review effort: Balanced

@krissetto
krissetto marked this pull request as ready for review November 22, 2026 00:39
@krissetto
krissetto enabled auto-merge November 22, 2026 01:17
@aheritier aheritier removed the status/needs-rebase PR has merge conflicts or is out of date with main label Nov 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/refactor PR refactors code without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants