Skip to content

[codex] redesign TUI shell#24

Merged
Vasanthdev2004 merged 15 commits into
mainfrom
codex/tui-shell-redesign
Jun 3, 2026
Merged

[codex] redesign TUI shell#24
Vasanthdev2004 merged 15 commits into
mainfrom
codex/tui-shell-redesign

Conversation

@Vasanthdev2004

Copy link
Copy Markdown
Collaborator

Summary

Redesigns the terminal chat surface into a more mature composable TUI shell.

  • Splits the chat UI into focused header, transcript, prompt, status, command suggestion, and debug panel components
  • Refreshes provider setup, provider picker, tool call rendering, and the Zero wordmark using the shared TUI theme
  • Keeps the app orchestration in App.tsx while preserving existing slash commands, model selection flow, provider runtime resolution, and debug mode behavior

Notes

This PR is intentionally stacked on codex/m1-model-selector-ui so review only sees the TUI shell redesign after the model selector slice.

Reference from D:\codings\Opensource\D was used only for architecture and UX patterns. No code was copied or translated.

Validation

  • bun run typecheck
  • bun test ./tests --timeout 15000
  • bun run build

@anandh8x anandh8x 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.

Review: TUI shell redesign

No blockers. This is a well-structured decomposition of the monolithic TUI into focused components with a shared theme system.

What's good

  • theme.ts and types.ts establish a design system — colors, marks, message types, mode state — that all TUI components consume consistently
  • TuiShell is a clean orchestration component: header > transcript > suggestions > debug panel > prompt box > status bar
  • Transcript.tsx cleanly handles all message types with consistent per-type rendering
  • ToolCallRenderer.tsx gets collapsible detail, syntax highlighting, smart per-tool summaries (bash command, file path, etc.) — major UX improvement
  • App.tsx is much slimmer: extracted runAgentLoop, handleSlashCommand, handleModelCommand, appendAssistantText, toFriendlyError, logDebugError into focused units
  • Error classification (toFriendlyError) maps provider errors to user-facing messages — auth, rate limits, network, and catch-all
  • Scroll is now terminal-aware via process.stdout.rows
  • Multi-step AddProvider flow (OpenGateway / Custom) with per-step validation and success feedback
  • TuiStatusBar shows scroll position and mode flags compactly

Important concern (follow-up, not blocking)

ToolCallRenderer.tsx — ANSI truncationformatResult(highlightedResult || result!, isLongResult, showFullResult) applies .slice(0, 200) when collapsed. If highlightedResult has ANSI color codes from highlightCode, truncating at an arbitrary character offset can split an escape sequence and corrupt terminal rendering. Suggestion: truncate the plain text before highlighting, or strip ANSI before measuring length.

Minor nits

  • TuiShell.tsx:44modeState local is created but never used
  • App.tsxcanScrollUp / canScrollDown naming is backwards from natural orientation (scrollOffset=0 is oldest, so scrollOffset > 0 means "scrolled down", not "can scroll down")
  • ToolCallRenderer.tsx:70,87onPress passed via as any cast; Ink's useFocus/useInput would be more robust for expansion toggling
  • TuiPromptBox shows debug/tools off labels that duplicate the header badges — intentional UX, but possible redundancy
  • theme.tssubtle and muted both map to 'gray', one is unused

@gnanam1990
gnanam1990 requested a review from anandh8x June 3, 2026 05:25
@gnanam1990

Copy link
Copy Markdown
Collaborator

@Vasanthdev2004 @anandh8x please review this PR.

@gnanam1990 gnanam1990 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.

Automated Hermes rereview

Verdict: Approve

Rereviewed after new commit 97a2b4c (fix: strengthen tui shell visual hierarchy). The update adds a more distinct launch/session/composer layout, themed panels, command suggestion rendering, improved transcript lanes, and tests/tui-shell-render.test.ts. I also rechecked the earlier ANSI-truncation follow-up area; this commit does not introduce a new blocker there.

Validation on origin/codex/tui-shell-redesign:

  • git diff --check origin/codex/m1-model-selector-ui..origin/codex/tui-shell-redesign
  • npx --yes bun test ./tests/tui-shell-render.test.ts --timeout 15000 ✅ (2 passing)
  • npx --yes tsc --noEmit
  • npx --yes bun test ./tests --timeout 15000 ✅ (150 passing)
  • npx --yes bun run build
  • ./zero --help

GitHub CI is green across ubuntu, macOS, and Windows smoke jobs. No requested changes or blocking issues found.

@gnanam1990 gnanam1990 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.

Automated Hermes rereview

Verdict: Approve

Rereviewed after new commit feb2e8f (fix: redesign tui as agent console). The TUI shell remains cleanly decomposed into themed header/transcript/prompt/status components, with the provider add flow and tool-call rendering aligned to the new console styling. I did not find regressions in command suggestion rendering, chat lanes, provider/model status, or existing tool-call display behavior.

Validation on detached worktree origin/codex/tui-shell-redesign:

  • git diff --check origin/codex/m1-model-selector-ui..HEAD
  • npx --yes bun install --frozen-lockfile
  • npx --yes bun test ./tests/tui-shell-render.test.ts --timeout 15000 ✅ (2 passing)
  • ./node_modules/.bin/tsc --noEmit
  • npx --yes bun test ./tests --timeout 15000 ✅ (150 passing)
  • npx --yes bun run build
  • ./zero --help

GitHub CI is green across ubuntu, macOS, and Windows smoke jobs. No requested changes or blocking issues found.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Approve

Rereviewed PR #24 after latest push 83b61db (fix: align tui with compact agent stream), which landed after my previous approval on feb2e8f. I focused first on the delta from feb2e8f..HEAD, then sanity-checked the full current PR diff against origin/codex/m1-model-selector-ui.

What changed since my previous review:

  • Simplified the TUI from the prior boxed/paneled agent-console treatment into a more compact terminal stream.
  • Updated transcript rows, prompt/header styling, command suggestions, and compact tool-call labels.
  • Adjusted the TUI render snapshot-style assertions to match the new compact surface.

Reviewer context considered:

  • Existing approval by anandh8x noting the TUI decomposition and theme/component structure had no blockers.
  • My prior approvals on commits 97a2b4c and feb2e8f.
  • Existing PR comments requesting review; no open change-request review or unresolved reviewer blocker was present.

Validation performed locally in /tmp/zero-pr-watch:

  • git diff --check origin/codex/m1-model-selector-ui...HEAD
  • npx --yes bun install --frozen-lockfile
  • npx --yes bun test ./tests/tui-shell-render.test.ts --timeout 15000 ✅ (2 passing)
  • ./node_modules/.bin/tsc --noEmit
  • npx --yes bun test ./tests --timeout 15000 ✅ (150 passing)
  • npx --yes bun run build
  • ./zero --help
  • GitHub checks: ubuntu, macOS, and Windows smoke jobs ✅

I did not find blocking correctness, security, or regression issues in the latest TUI-only delta.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Approve

Rereviewed PR #24 after latest push 668ad0e (feat: add premium startup splash), which landed after my previous approval on 83b61db. I inspected the delta from 83b61db..HEAD first, then sanity-checked the full current PR diff against origin/codex/m1-model-selector-ui.

What changed since my previous review:

  • Added StartupScreen.tsx, a dedicated startup splash with centered logo, command chips, provider/model status, prompt box, and shortcut hints.
  • Wired terminalHeight through App and TuiShell, and renders the startup splash only while the session still contains only system messages.
  • Extended the render test to assert the startup splash replaces session clutter and hides the prior system welcome text.

Reviewer context considered:

  • Existing approval by anandh8x for the overall TUI shell decomposition and shared theme/component structure.
  • My prior approvals on commits 97a2b4c, feb2e8f, and 83b61db.
  • Existing PR comments requesting review; no open change-request review or unresolved reviewer blocker was present.

Validation performed locally in /tmp/zero-pr-watch:

  • git diff --check origin/codex/m1-model-selector-ui...HEAD
  • npx --yes bun install --frozen-lockfile
  • npx --yes bun test ./tests/tui-shell-render.test.ts --timeout 15000 ✅ (2 passing)
  • ./node_modules/.bin/tsc --noEmit
  • npx --yes bun test ./tests --timeout 15000 ✅ (150 passing)
  • npx --yes bun run build
  • ./zero --help
  • GitHub checks: ubuntu, macOS, and Windows smoke jobs ✅

No blocking correctness, security, or regression issues found in the latest startup-splash delta.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Approve

Rereviewed PR #24 after new commits 16de941 (feat(tui): rebuild startup splash into reusable components) and 2eb503c (feat(tui): use figlet Electronic wordmark for ZERO splash logo), which landed after my previous approval on 668ad0e.

What changed since the previous review:

  • Refactored the inline startup splash into reusable src/tui/startup/* components: Header, ZeroLogo, CommandChips, PromptBox, ShortcutHints, and splash-local theme.
  • Preserved the controlled StartupScreen interface used by TuiShell, keeping input/terminal size ownership in the shell.
  • Replaced the splash logo with a figlet Electronic-style ZERO wordmark that degrades to a compact title on narrow terminals.

Review notes:

  • The decomposition is scoped to the startup splash and keeps the no-session-clutter behavior intact.
  • The wordmark width guard (maxWidth >= LOGO_WIDTH) avoids wrapping/broken glyphs on narrow terminals.
  • No new correctness, security, or regression blockers found in the latest delta.

Validation performed locally in /tmp/zero-pr24-review:

  • git diff --check origin/codex/m1-model-selector-ui...HEAD
  • npx --yes bun install --frozen-lockfile
  • npx --yes bun test ./tests/tui-shell-render.test.ts --timeout 15000 ✅ (2 passing)
  • npx --yes tsc --noEmit
  • npx --yes bun test ./tests --timeout 15000 ✅ (150 passing)
  • npx --yes bun run build
  • ./zero --help

GitHub checks are green across ubuntu, macOS, and Windows smoke jobs.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Approve

Rereviewed PR #24 after new commit b386c14 (feat(tui): switch splash wordmark to figlet Rebel with two-tone cyan), which landed after my previous approval on 2eb503c.

What changed since the previous review:

  • Replaced the Electronic figlet ZERO splash wordmark with the Rebel 3D figlet wordmark.
  • Added glyph classification/run rendering in src/tui/startup/ZeroLogo.tsx so solid front faces render bright cyan while shaded faces render dim cyan.
  • Kept the narrow-terminal fallback path intact when maxWidth < LOGO_WIDTH.

Review notes:

  • The delta is limited to the startup logo component and does not alter shell control flow, input handling, provider/model state, or transcript rendering.
  • The run-splitting approach is deterministic and safe for Ink rendering; it preserves spaces and pads lines to a consistent width for centering.
  • No new correctness, security, or regression blockers found in the latest delta.

Validation performed locally in /tmp/zero-pr24-rereview-0708:

  • git diff --check origin/codex/m1-model-selector-ui...HEAD
  • npx --yes bun install --frozen-lockfile
  • npx --yes bun test ./tests/tui-shell-render.test.ts --timeout 15000 ✅ (2 passing)
  • npx --yes tsc --noEmit
  • npx --yes bun test ./tests --timeout 15000 ✅ (150 passing)
  • npx --yes bun run build
  • ./zero --help

GitHub checks are green across ubuntu, macOS, and Windows smoke jobs.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Approve

Rereviewed PR #24 after new commit 8d01576 (feat(tui): simplify shortcut hints to a clean single line), which landed after my previous approval on b386c14.

What changed since the previous review:

  • src/tui/startup/ShortcutHints.tsx now renders a quieter single-line shortcut hint row instead of boxed keycaps.
  • Shortcut labels were shortened from "sends/accepts command/exits" to "send/complete/exit".
  • The row keeps flexWrap/flexShrink behavior for narrow terminals and uses muted middot separators between hint groups.

Review notes:

  • The delta is limited to presentational startup-splash shortcut hints.
  • It does not alter shell state, input handling, provider/model resolution, agent execution, tool execution, or persisted configuration.
  • No correctness, security, or regression blockers found in the latest delta.

Validation performed locally in /tmp/zero-pr24-rereview-0712:

  • git diff --check origin/codex/m1-model-selector-ui...HEAD
  • npx --yes bun install --frozen-lockfile
  • npx --yes bun test ./tests/tui-shell-render.test.ts --timeout 15000 ✅ (2 passing)
  • npx --yes tsc --noEmit
  • npx --yes bun test ./tests --timeout 15000 ✅ (150 passing)
  • npx --yes bun run build
  • ./zero --help

GitHub checks are green across ubuntu, macOS, and Windows smoke jobs.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Changes Requested

Rereviewed PR #24 after new commit 6692667 (feat(tui): add Claude-Code-style mode status line to splash), which landed after my previous approval on 8d01576.

Existing review/comment context considered

  • Prior reviewer anandh8x approved the TUI shell decomposition with no blockers.
  • My prior approvals covered the earlier splash/header/transcript/prompt refactors and the shortcut hint simplification.
  • Existing PR comment only asked other reviewers to review; no technical concerns were pending.

What changed in this push

  • Added src/tui/startup/ModeStatus.tsx with build/plan/auto-accept/bypass labels.
  • Added theme.warn for caution styling.
  • Rendered ModeStatus at the bottom of StartupScreen.

Blocking issue

  • StartupScreen now advertises an "Active agent mode" / "shift+tab to cycle" status line, but TuiShell never passes real mode state into it. StartupScreen therefore defaults to mode = 'build' even when the app is already in plan mode (isPlanMode), tools are disabled, or any future mode state is active. That makes the splash status line misleading exactly where it is intended to communicate the active mode. Please derive/pass the displayed startup mode from the existing shell/app state (at minimum isPlanMode, and avoid advertising modes that are not actually wired/cycleable yet), or make the line purely static until mode cycling exists.

Validation

  • npx --yes bun --version → 1.3.14
  • npx --yes bun install --frozen-lockfile → passed, no changes
  • npx --yes bun test → passed (150 tests)
  • npx --yes bun run typecheck → passed
  • npx --yes bun run build → passed (Built zero)

Automated rereview by Hermes Agent.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Changes still requested

Rereviewed after new commit 7db7f0b (feat(tui): show slash-command menu on splash, drop keycap hints).

What changed

  • Startup splash now receives and renders CommandSuggestions, so typing / on the splash can show the command menu.
  • Removed the separate ShortcutHints row.

Existing blocker status

This does not resolve the previous blocking issue from commit 6692667: TuiShell still renders StartupScreen without passing real mode state, and StartupScreen still defaults mode = 'build' while ModeStatus advertises an active mode plus shift+tab to cycle.

Please derive/pass the displayed startup mode from existing shell/app state (at minimum isPlanMode) and avoid advertising mode cycling that is not actually wired, or make the mode line static until cycling exists.

Validation

  • Inspected delta: git diff 66926672a4ea873ac82208a6c16adfea61a3853d..origin/codex/tui-shell-redesign -- src/tui/StartupScreen.tsx src/tui/TuiShell.tsx src/tui/startup/ModeStatus.tsx src/tui/startup/ShortcutHints.tsx tests/tui-shell-render.test.ts
  • GitHub CI observed green for ubuntu, macOS, and Windows smoke jobs.

Automated rereview by Hermes Agent.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Changes still requested

Rereviewed after new commit 0ed1dcf (feat(tui): redesign in-session working view).

What changed

  • Working view header now derives active file plus git branch/ahead-behind metadata.
  • Footer now shows model, estimated tokens/cost/context percent, and live/idle state.
  • Tool-call rows were simplified into compact activity summaries, with inline diff cards for edit/apply-patch-style changes.

Existing blocker status

This push does not resolve the prior blocking issue: TuiShell still renders StartupScreen without passing real mode state, and StartupScreen/ModeStatus still default to build while advertising shift+tab to cycle.

Affected area remains:

  • src/tui/TuiShell.tsx: startup path calls <StartupScreen ... /> without passing isPlanMode or another derived startup mode.
  • src/tui/startup/ModeStatus.tsx: default mode = 'build' and text says (shift+tab to cycle), but the startup splash does not reflect actual plan mode and mode cycling is not wired.

Please derive/pass the displayed startup mode from existing shell/app state (at minimum isPlanMode) and avoid advertising unwired mode cycling, or make the mode line static until cycling exists.

Validation

  • Inspected PR diff with gh pr diff 24 --repo Gitlawb/zero.
  • Inspected new delta with git diff 7db7f0bf47a61499c61e8f406ab6416a8c074a26..origin/codex/tui-shell-redesign -- src/tui tests/tui-shell-render.test.ts.
  • GitHub CI observed green for ubuntu, macOS, and Windows smoke jobs on the latest commit.

Automated rereview by Hermes Agent.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Changes still requested

Rereviewed after new commit 1d96786 (feat(tui): animate live dot and running tool rows).

What changed

  • Added src/tui/LiveDot.tsx to pulse the footer indicator while the agent is thinking.
  • Running tool rows now render an ink-spinner dots spinner, resolving to the static status dot after completion.
  • TuiStatusBar now uses LiveDot for the right-side live indicator.

Existing blocker status

This latest animation-only push still does not resolve the outstanding startup-mode blocker: the startup splash mode line is not wired to real shell state.

Affected area remains:

  • src/tui/TuiShell.tsx: the startup path still calls <StartupScreen ... /> without passing isPlanMode or any derived startup mode.
  • src/tui/startup/ModeStatus.tsx: still defaults mode = 'build' and says (shift+tab to cycle), even though startup mode cycling is not wired and plan mode is not reflected.

Please derive/pass the displayed startup mode from existing shell/app state (at minimum isPlanMode) and avoid advertising unwired mode cycling, or make the mode line static until cycling exists.

Validation

  • Inspected new delta with git diff 0ed1dcfcea4b434ad41a0e560b5053ac0a79985d..origin/codex/tui-shell-redesign -- src/tui tests/tui-shell-render.test.ts.
  • GitHub CI status observed: ubuntu and macOS smoke succeeded; Windows smoke was still in progress when this rereview was posted.

Automated rereview by Hermes Agent.

@Vasanthdev2004
Vasanthdev2004 marked this pull request as ready for review June 3, 2026 07:55
@Vasanthdev2004
Vasanthdev2004 requested a review from gnanam1990 June 3, 2026 07:55
@Vasanthdev2004

Copy link
Copy Markdown
Collaborator Author

Blockers

  • src/tui/TuiShell.tsx:66-75 renders the startup splash without passing any real mode state, while src/tui/StartupScreen.tsx:49 defaults mode to build and src/tui/startup/ModeStatus.tsx:34 advertises shift+tab to cycle. A direct render probe with showLogo: true and isPlanMode: true still prints build mode, so the splash can mislead users before the first non-system message. Please derive the displayed mode from shell state at least for plan mode, and remove/disable the cycle hint until shift+tab mode cycling is actually wired.
  • This PR still targets codex/m1-model-selector-ui instead of main. PR [codex] add TUI model selector #22 was already squash-merged to main, and a test merge of this head into current origin/main now conflicts in src/tui/App.tsx. Please retarget/rebase or open the rollup against main so this TUI redesign can actually land on the default branch without dropping the newer main work.

Non-Blocking

  • None.

Looks Good

  • The new TUI shell decomposition is much cleaner: header, transcript, prompt, status bar, startup splash, tool rows, and shared TUI types/themes are separated into focused components.
  • Validation on the PR worktree passed: bun install --frozen-lockfile, targeted TUI render test (2/2), full suite (150/150), bun run typecheck, bun run build, bun run smoke:build, ./zero --help, and both git diff --check commands.
  • Scope is 1,868 additions and 902 deletions across 25 TUI/test files; the UI-only direction is solid once the startup mode truth and main-landing path are fixed.

Verdict: Changes Requested — Clean component work, but the startup mode line is behaviorally wrong and the stacked branch needs to be brought onto main cleanly before merge.

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Changes still requested

Rereviewed PR #24 at head 9cc94df (fix: restore startup shortcut hints) after the prior changes-requested review on 1d96786.

Existing review/comment context considered

  • Prior approval from anandh8x for the TUI shell decomposition.
  • Prior Hermes reviews, including the blocking startup-mode concern introduced by the ModeStatus line.
  • Author comment noting two blockers: misleading startup mode/cycle hint and the stacked branch still targeting codex/m1-model-selector-ui instead of landing cleanly on main.

What changed in this push

  • Removed src/tui/startup/ModeStatus.tsx and the default build mode / shift+tab to cycle startup status line.
  • Restored startup shortcut hints (Enter, Tab, Ctrl+C).
  • Updated the TUI shell render test to assert the startup splash no longer contains shift+tab.

Blocker status

  • Startup mode blocker resolved. The splash no longer advertises an unwired/default build mode or shift+tab cycling.
  • Main landing path still blocked. The PR is still based on codex/m1-model-selector-ui, and a merge-tree check against current origin/main reports a content conflict in src/tui/App.tsx:
    • git merge-tree --write-tree origin/main HEAD exits 1
    • conflict: src/tui/App.tsx

Please rebase/retarget this PR onto current main (or otherwise resolve the src/tui/App.tsx conflict) so the branch can land cleanly on the default branch.

CI / validation

Local validation in /tmp/zero-pr-watch passed:

  • git diff --check origin/codex/m1-model-selector-ui...HEAD
  • temporary Bun 1.3.14 install/check: bun install --frozen-lockfile
  • bun test ./tests/tui-shell-render.test.ts --timeout 15000 ✅ (2 passing)
  • bun x tsc --noEmit
  • bun test ./tests --timeout 15000 ✅ (150 passing)
  • bun run build
  • ./zero --help

GitHub checks on the latest head:

  • Ubuntu smoke ✅
  • macOS smoke ✅
  • Windows smoke ❌ — zero --version test timed out at 15s and exited 143 in tests/cli-version.test.ts.

Even though local macOS validation passes and the startup-mode issue is fixed, the branch should not be approved until the current Windows CI failure and the main merge conflict are resolved.


Automated rereview by Hermes Agent.

@Vasanthdev2004

Copy link
Copy Markdown
Collaborator Author

Blockers

  • The PR is still stacked on codex/m1-model-selector-ui while that base is not an ancestor of current origin/main; a latest-main landing check still conflicts in src/tui/App.tsx (git merge-tree --write-tree origin/main HEAD exits 1). Please rebase/retarget onto current main or open a clean rollup so the TUI redesign can land without dropping newer main work.
  • The latest Windows CI smoke is failing: zero --version > prints the package version timed out after 15000ms, leaving the Windows job at 149/150 passing. Because this PR changes TUI/App startup code and Zero is Windows-targeted, please fix or demonstrate this is a pre-existing main-only failure before merge.

Non-Blocking

  • The previous startup splash blocker is resolved: the unwired build mode / shift+tab to cycle status line is gone, and the render test now asserts shift+tab is absent.

Looks Good

  • The TUI decomposition remains clean: shell, startup splash, transcript, prompt/status/header, tool rows, and diff cards are split into focused components without touching provider/model dispatch or tool permission enforcement.
  • PR-branch validation passed locally: install, targeted TUI render tests 2/2, full suite 150/150, typecheck, build, smoke:build, ./zero --help, and both diff whitespace checks.
  • Scope is 1,853 additions and 902 deletions across 25 TUI/test files; the UI direction is solid once the main landing path and Windows smoke failure are cleared.

Verdict: Changes Requested — Startup mode is fixed, but the branch still cannot land cleanly on current main and Windows CI is red.

Replace the inlined StartupScreen with composable Header, ZeroLogo, CommandChips, PromptBox and ShortcutHints under src/tui/startup, plus a self-contained theme. Keeps the same props so TuiShell is unchanged; typecheck clean, shell render test passing.
Outlined glyphs with a dotted fill — closer to the splash mockup than the solid block. Generated from figlet (not hand-drawn); lines padded to equal width so the block stays centered.
Use the Rebel 3D figlet font for ZERO; render solid front faces in bright cyan and the shaded drop-shadow dim, so the 3D depth reads correctly. Generated from figlet, padded to equal width for clean centering.
Drop the boxed keycaps (heavy/noisy); render keys in cyan with dim labels and a faint middot separator. Wraps on narrow terminals.
New ModeStatus shows the active mode (build/plan/auto-accept/bypass) with a chevron indicator, a shift+tab cycle affordance, and a /-command hint; color-coded per mode. Presentational for now — shell wires the actual cycling later.
Render CommandSuggestions on the startup splash (TuiShell only showed it in the in-session view, so typing / on the splash showed nothing). Remove the Enter/Tab/Ctrl+C keycap line; the mode line + command menu cover the affordances.
Header now shows the active file + git branch/ahead-behind; footer shows model · tokens · cost · ctx% · live. Activity rows are mockup-style (dot + tool + summary: Read N lines / Grep "q" N matches / Edit +A -B), and edits render an inline DiffCard (red/green). Usage/git are derived/estimated for now; live token usage + structured diffs are follow-ups.
Add a pulsing LiveDot in the footer (heartbeat while the agent works, steady otherwise) and an animated spinner on tool rows while they're running (resolves to a static dot on completion). Each is an isolated leaf component so only it repaints per tick. Thinking spinner already existed.
@Vasanthdev2004
Vasanthdev2004 force-pushed the codex/tui-shell-redesign branch from 9cc94df to 303829e Compare June 3, 2026 08:52
@Vasanthdev2004
Vasanthdev2004 changed the base branch from codex/m1-model-selector-ui to main June 3, 2026 08:52
@Vasanthdev2004

Copy link
Copy Markdown
Collaborator Author

Blockers

None found.

Non-Blocking

  • GitHub had not reported checks for the new 303829e head at review time, so I relied on local validation for this pass.

Looks Good

  • The previous stacked-branch blocker is resolved: this PR now targets main, origin/main is an ancestor of the head, and git merge-tree --write-tree origin/main HEAD succeeds without conflicts.
  • The latest lazy TUI import is the right fix for the Windows zero --version hang path: CLI-only commands no longer import Ink/TUI startup, and local ./zero --version returns 0.1.0 in ~0.19s.
  • Validation passed locally: bun install --frozen-lockfile, targeted TUI render tests 2/2, full suite 195/195, typecheck, build, smoke:build, ./zero --help, ./zero --version, and both diff whitespace checks.
  • Scope is 1,853 additions and 911 deletions across 26 TUI/CLI/test files; the redesign stays UI-focused and does not change provider/model dispatch, tool permission enforcement, or secret-redaction contracts.

Verdict: Approve — Clean TUI shell redesign; the startup-mode, main-landing, and CLI lazy-load concerns are resolved from this side.

@Vasanthdev2004
Vasanthdev2004 requested a review from gnanam1990 June 3, 2026 08:55

@gnanam1990 gnanam1990 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.

Automated Hermes Agent rereview

Verdict: Approve

Rereviewed PR #24 after the branch was force-updated/rebased onto main and latest head 303829e (fix: lazy load tui for cli commands). I inspected the current PR diff and validated the two previously blocking areas.

Resolved blockers

  • ✅ Main landing path is now clean: origin/main is an ancestor of origin/codex/tui-shell-redesign, and git merge-tree --write-tree origin/main origin/codex/tui-shell-redesign exits 0 with tree 9350ca5366b55edb3fe1df36028873d1d8efa1aa.
  • ✅ Windows zero --version hang concern is addressed by lazy-loading the TUI only for interactive startup. Local ./zero --version returns 0.1.0, and the targeted CLI version tests pass.
  • ✅ The earlier startup-mode/cycle-hint blocker remains resolved: ModeStatus is gone, shortcut hints are restored, and the render test asserts shift+tab is absent.

Validation performed on a detached worktree at origin/codex/tui-shell-redesign

  • npx --yes bun install --frozen-lockfile
  • git diff --check origin/main...HEAD
  • npx --yes bun test ./tests/tui-shell-render.test.ts ./tests/cli-version.test.ts --timeout 15000 ✅ (5 passing)
  • npx --yes bun test ./tests --timeout 15000 ✅ (195 passing)
  • npx --yes tsc --noEmit
  • npx --yes bun run build ✅ (Built zero)
  • ./zero --help
  • ./zero --version ✅ (0.1.0)

GitHub currently reports no checks yet for the new 303829e branch head via gh pr checks, so this approval is based on local validation plus the clean merge-tree result.


Automated rereview by Hermes Agent.

@anandh8x anandh8x 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.

Re-review: TUI shell redesign (v2)

Still no blockers. This iteration adds significant new surface — startup splash, inline diffs, live indicator, git status, token estimation — on top of the v1 component decomposition. The merge stays blocked but the code itself is clean.

What's new (since v1)

  • Startup splashStartupScreen + startup/ components (ZeroLogo, Header, PromptBox, CommandChips, ShortcutHints) render a centered wordmark + chip bar when only system messages exist. Degrades gracefully on narrow terminals with a minimal "▌ ZERO ▐" fallback
  • ZeroLogo — ASCII wordmark with two-tone glyph rendering (solid faces in bright cyan, shaded drop-shadow dimmed). Lightweight figlet-inspired rendering per character class, not per character
  • DiffCard — Inline diff for edit_file/apply_patch tool calls, capped at 16 lines with "N more..." overflow. buildEditDiff is a simple old→new concatenation (no unified-patch parsing)
  • LiveDot — 2 Hz pulsing indicator (●/◌), owns its own interval so only the dot repaints, not the whole status bar
  • TuiHeader — Now shows active file path (collapsed $HOME → ~) on the left, git branch + ↑ahead ↓behind on the right. Model/provider moved to status bar
  • TuiStatusBarmodel · tokens · cost · ctx% on the left, LiveDot + "live" on the right. Token count estimated at chars/4 until real usage events land
  • TuiPromptBox — Mode-aware placeholder text ("Zero is working...", "Plan the next change...", default). Cursor character uses border color for visibility
  • ToolCallRenderer — Completely rewritten: per-tool LABELS (Read, Grep, Bash, Edit...), smart summarize() with line counts, match counts, +N -M diffs, inline DiffCard for edits, animated ink-spinner while running
  • Transcript — User messages get background + symbol styling. System messages detect 'Error:' prefix for red coloring. Logos only shown at startup
  • Logo — Compact inline "ZERO" badge rather than ASCII art block during chat
  • CommandSuggestions — Labeled "commands" prefix, clearer Tab hint
  • theme.ts — Now uses custom hex colors (#05080a dark bg, cyan/mint/blue accents) instead of Ink named colors. Full dark theme palette
  • App.tsx — Uses useWindowSize from Ink, git branch tracking via execa, deriveActiveFile() from tool call args, estimateTokens() rough count, error redaction
  • tests/tui-shell-render.test.ts — Ink renderToString tests: startup splash content check, working view with messages/commands

Minor observations

  • Token estimationestimateTokens uses chars/4 with a fixed 200K context window and $0.003/1K rate. Rough placeholder until real usage tracking arrives
  • deriveActiveFile — Parses m.args from tool calls to find path/file fields. Args have been redactZeroString'd by this point, so file paths containing secret-like substrings would be corrupted (extremely unlikely for paths)
  • showLogomessages.every(m => m.type === 'system') — switches to working view once any non-system message appears. Clean
  • useWindowSize + manual resize listener — Both present; useWindowSize provides rows with the manual process.stdout.rows as fallback. Redundant but harmless
  • Startup theme — Has its own theme.ts separate from the main tuiTheme. Keeps the startup splash self-contained; some color overlap (both use cyan)
  • No --connectivity equivalent — Not expected here, just noting the TUI has no health check integration yet

@Vasanthdev2004
Vasanthdev2004 merged commit 048d8de into main Jun 3, 2026
@Vasanthdev2004
Vasanthdev2004 deleted the codex/tui-shell-redesign branch June 28, 2026 08:27
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.

3 participants