Skip to content

feat(tui): animate startup header mascot#25340

Open
fcoury-oai wants to merge 3 commits into
mainfrom
fcoury/header-mascot
Open

feat(tui): animate startup header mascot#25340
fcoury-oai wants to merge 3 commits into
mainfrom
fcoury/header-mascot

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented May 30, 2026

Copy link
Copy Markdown
Contributor

Why

Give the initial Codex TUI banner a recognizable mascot without depending on terminal image protocols or the separate ambient pets surface. The header should remain portable across terminals that can render styled Unicode text.

What Changed

  • Add a generated 14x6 Unicode mascot frame set for working, thinking, and read-below, plus the approved idle reference frame.
  • Randomly choose one startup animation when the header is created and preserve that same animation through the placeholder-to-configured-session handoff.
  • Settle the mascot to the idle reference frame when startup animation completes or when the header is committed to transcript history.
  • Fall back to the text-only session header when the terminal is too narrow for the mascot and existing header text.
  • Add focused animation/layout coverage and refresh the affected TUI snapshots.

Debugging Notes

  • ChatWidget::new selects startup motion once and stores the shared StartupAnimation.
  • handle_session_configured copies that same state into the configured SessionInfoCell so metadata arrival does not restart or switch motion.
  • ChatWidget::pre_draw_tick schedules redraws while the active header reports a mascot tick, then flushes settled configured session info into transcript history.
  • HistoryCell::finalize_for_history removes transient visual state before an active cell is committed.
  • SessionHeaderHistoryCell::display_lines first attempts the side-by-side mascot layout, then rebuilds text at full width if the terminal requires the text-only fallback.

How to Test

  1. Start Codex with animations enabled using just c.
  2. Confirm the initial session header shows a 14x6 Unicode mascot and animates during startup.
  3. Restart Codex a few times and confirm startup randomly selects among the working, thinking, and read-below motions.
  4. Wait for startup animation to finish and confirm the mascot settles to the same idle reference image.
  5. Resize the terminal narrow enough that the mascot and text no longer fit together. Confirm the header falls back to the existing text-only layout without over-truncating the directory.
  6. Start Codex with animations disabled and confirm the mascot renders statically from the first frame.

Targeted verification:

  • cargo check -p codex-tui
  • just fix -p codex-tui
  • just test -p codex-tui passes the mascot coverage and snapshots. The suite currently also reports two unrelated guardian feature-flag test failures in app::tests::update_feature_flags_disabling_guardian_*.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb76d3ed69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/history_cell/session.rs Outdated
@etraut-openai

Copy link
Copy Markdown
Collaborator

Please gate the animation on the tui.animations flag. This prevents problems with screen readers.

@fcoury-oai

Copy link
Copy Markdown
Contributor Author

Please gate the animation on the tui.animations flag. This prevents problems with screen readers.

It's already gated, try starting it with -c 'tui.animations=false'

@etraut-openai

Copy link
Copy Markdown
Collaborator

I like the polish and character this adds to the TUI. Unfortunately, I'm seeing that it doesn't look so great in many terminals.

It looks good in kitty and ghostty.

Screenshot 2026-05-30 at 5 08 26 PM

But it kind of falls apart in Terminal.app, the VS Code terminal, the Codex app terminal, and iTerm2:

Screenshot 2026-05-30 at 5 07 28 PM Screenshot 2026-05-30 at 5 09 17 PM Screenshot 2026-05-30 at 5 07 59 PM Screenshot 2026-05-30 at 5 07 59 PM

I haven't tried on Linux or Windows.

@fcoury-oai

fcoury-oai commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

I agree: It's a compromise. People that are using these terminals are probably already used to the gaps on nerdfonts and unicode characters in general.

I see two ways forward: release it and see if people dislike or complain about it or gate it to some terminals. I am in favor of just releasing it and gathering feedback.

Edit: I will test again on Windows and Linux.

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