Skip to content

feat: paint the TUI from the theme and route first runs into setup - #57

Open
N4M3Z wants to merge 1 commit into
mainfrom
change/tui-first-run
Open

feat: paint the TUI from the theme and route first runs into setup#57
N4M3Z wants to merge 1 commit into
mainfrom
change/tui-first-run

Conversation

@N4M3Z

@N4M3Z N4M3Z commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Paint the TUI from the resolved theme, show the workspace facts in the status bar, and route an unconfigured root into setup.

  • src/tui/styles.rs: one Palette derived from theme::current(); the five tones carry the meaning and a new light flag on each theme picks light or dark surfaces. Accessor functions replace the constants; every named Color:: in the TUI goes through them.
  • Status bar: deck name, bound target, and one glyph per enabled provider ( current, outdated, needs repair, ~ modified, · not installed). Detection runs once at load through the shared registry.
  • First run: after a scan that finds no deck and no modules, a panel names the root and rune setup, rune config set deck, rune tui --source; the footer points at setup.
  • Help overlay: title carries the version and the close keys; groups and keys use the theme.
  • Closes tasks 1.5 and 2.3 of herdr-theme-system. New change tui-first-run, decision CLI-0036.

Verified with rune tui --snapshot on an empty root and on the deck. 1365 tests, clippy clean.

Release Notes

  • tui: derive the palette from the configured theme, light themes included
  • tui: show deck, target, and provider states in the status bar
  • tui: open a first-run panel that leads into rune setup when no deck is configured
  • tui: name the close keys and version in the help overlay

https://claude.ai/code/session_01Fds3tf5rS1Ep47q5DGhsr3

Note

Derive TUI styles from theme palette and add first-run setup panel

  • Introduces a Palette struct in styles.rs that maps the current theme to light/dark TUI colors. Replaces hardcoded colors across all TUI renderers with shared palette accessors.
  • Adds a first-run panel in app.rs that guides users to setup when an empty dashboard is detected after scanning finishes.
  • Updates the TUI status bar to show bound-target labels and provider deployment states, omitting disabled providers.
  • Adds a light_background flag to ThemeTones in theme.rs to drive palette surface and text roles.
  • Risk: Changing all hardcoded TUI colors to palette-derived values means any untested rendering path may display unexpected colors or low contrast. Review Palette::from_theme branches and renderer migrations in app.rs.

Macroscope summarized 972e088.

The TUI palette now derives from the resolved theme: the five tones carry the
meaning and a light flag on each theme picks light or dark surfaces, so a
light theme restyles the TUI without a second setting. The status bar shows
the deck name, the bound target, and one glyph per enabled provider state.
When the scan finds no deck and no modules, a first-run panel replaces the
list and names rune setup, rune config set deck, and rune tui --source. The
help overlay names its close keys and the version.

Closes tasks 1.5 and 2.3 of the herdr-theme-system change. Decision: CLI-0036.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
Claude-Session: https://claude.ai/code/session_01Fds3tf5rS1Ep47q5DGhsr3
@N4M3Z N4M3Z added the review:runeseer Summons the adjudicating correctness lane label Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • review:coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 39fa054f-e6ba-4593-b444-cb6d3a7a76a1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:large auto: changed-lines bucket area:docs auto: documentation and markdown labels Sep 2, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 2, 2026

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a new first-run TUI workflow and startup provider/target detection while replacing styling across many existing TUI surfaces. The resulting user-facing and startup behavior changes are broader than a small isolated UI adjustment.

Notes:

  • Macroscope's correctness review did not run, so approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

Comment thread src/tui/app.rs
/// The scan finished and found neither a deck nor modules: the first-run
/// state, which routes into setup instead of an empty list.
fn is_first_run(&self) -> bool {
self.scan_state != ScanState::Loading

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.

🚫 [runeseer] reported by reviewdog 🐶
High — A failed scan leaves the view empty with scan_state back at Idle, so is_first_run reports true and the TUI tells the user there is no deck instead of showing the scan error.

  • src/tui/app.rs:884 the scan-error arm sets scan_state = ScanState::Idle and stores the message in palette_error while self.view stays the empty dashboard.
  • src/tui/app.rs:1437 the first-run footer replaces footer_text(), the only reader of palette_error, so the stored error never reaches the screen.

@runeseer

runeseer Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Runeseer review — 1 open finding

Risk Finding Location
High Scan failure renders as the first-run no-deck panel src/tui/app.rs:724

Request changes. A scan that fails ends with an empty view and an idle scan state, so the new first-run panel claims there is no deck and the recorded scan error never reaches the screen.

  • The theme-driven palette itself is consistent: every replaced fixed color maps onto a theme tone.
  • Minor: the widened status bar can push the scan and validation counts off a narrow terminal, since padding clamps to zero.

1 open · Reviewed 972e0888 · review run · $1.58 · 2m37s · 32 turns

@runeseer

runeseer Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@N4M3Z, the following findings block this head:

  • src/tui/app.rs:724: Scan failure renders as the first-run no-deck panel

Choose one action:

  • Fix all findings. Then apply review:runeseer to review the new head.
  • Apply ignore:runeseer to accept the complete current verdict.

@github-actions github-actions Bot removed the review:runeseer Summons the adjudicating correctness lane label Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs auto: documentation and markdown size:large auto: changed-lines bucket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant