Skip to content

feat: banner gradient toggle that follows the terminal palette (#336)#377

Merged
LargeModGames merged 2 commits into
mainfrom
feature/banner-gradient-toggle
Jul 15, 2026
Merged

feat: banner gradient toggle that follows the terminal palette (#336)#377
LargeModGames merged 2 commits into
mainfrom
feature/banner-gradient-toggle

Conversation

@LargeModGames

@LargeModGames LargeModGames commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Closes the follow-up request on #336: the Terminal (ANSI) theme preset recolors the whole UI live with the terminal palette, but the home banner kept its animated RGB gradient, which converts theme colors to hardcoded RGB and therefore never follows palette changes.

What's new

  • Banner Gradient toggle (Settings -> Theme -> Banner Gradient, or behavior.banner_gradient in config.yml). When off, the banner is drawn in the theme's banner color as-is, so ANSI colors pass through and tools like pywal recolor the banner live along with the rest of the UI.
  • Preset-aware default: the Terminal (ANSI) preset defaults the gradient off (a fixed RGB gradient defeats the preset's purpose); every other preset defaults to on. An explicit banner_gradient: value in the config always wins. Cycling presets in the Settings screen syncs the toggle to the new preset's default, same as the color slots; Custom leaves it untouched.
  • No wasted redraws: the Home screen's fast animation tick only ran to animate the gradient, so it is skipped when the banner is static.

Tests

  • banner_gradient_toggle_switches_between_rgb_and_theme_color: renders Home both ways and asserts banner glyphs are RGB with the gradient on and exactly theme.banner (ANSI Cyan under the Terminal preset) with it off.
  • banner_gradient_defaults_off_for_terminal_preset_unless_explicit: config-load resolution (preset default vs explicit override).
  • cycling_preset_to_terminal_turns_banner_gradient_setting_off: Settings preset cycling flips the toggle Default -> Terminal -> Pookie Pink.

Verified manually on Windows Terminal: with the Terminal preset and the gradient off, the banner renders solid in the scheme's cyan and recolors instantly when switching color schemes (Campbell, Solarized Dark, One Half Light), no restart needed.

cargo fmt, clippy -D warnings (telemetry feature set), and the full test suite (439) pass.

Summary by CodeRabbit

  • New Features

    • Added a Banner Gradient setting for the home screen.
    • Choose between an animated RGB gradient and a solid theme-based banner color.
    • Theme presets can provide default behavior, while explicit configuration overrides those defaults.
    • The Terminal (ANSI) preset now defaults to a solid banner.
  • Documentation

    • Added configuration documentation and changelog details for the new setting.

Add behavior.banner_gradient (Settings -> Theme -> Banner Gradient). When
off, the home banner is drawn in the theme's banner color instead of the
animated RGB gradient, so with the Terminal (ANSI) preset the banner
follows the terminal palette live (pywal etc.). The Terminal preset
defaults the gradient off; an explicit config value wins. Preset cycling
in Settings syncs the toggle, and the Home fast animation tick is skipped
when the banner is static.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c65f9a7-cef1-4353-b19b-36ac6ab1313a

📥 Commits

Reviewing files that changed from the base of the PR and between fba6d73 and 532751b.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • docs/configuration.md
  • src/core/app.rs
  • src/core/user_config.rs
  • src/tui/handlers/settings.rs
  • src/tui/runner.rs
  • src/tui/ui/home.rs

📝 Walkthrough

Walkthrough

Adds a configurable behavior.banner_gradient setting with preset defaults, YAML persistence, settings UI synchronization, and conditional home-banner rendering. The Terminal preset disables the gradient by default, while explicit configuration values take precedence.

Changes

Banner Gradient Toggle

Layer / File(s) Summary
Configuration and preset defaults
src/core/user_config.rs, docs/configuration.md, CHANGELOG.md
Adds the configurable and resolved banner_gradient fields, preset defaults, explicit-value precedence, YAML persistence, tests, and documentation.
Settings and preset synchronization
src/core/app.rs, src/tui/handlers/settings.rs
Adds the Theme settings toggle, applies edits to user configuration, and synchronizes the toggle when previewing or cycling theme presets.
Home banner rendering
src/tui/runner.rs, src/tui/ui/home.rs
Gates Home animation ticks with banner_gradient, and renders either animated RGB text or the theme banner color, with coverage tests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant UserConfig
  participant SettingsHandler
  participant start_ui
  participant draw_home
  UserConfig->>SettingsHandler: resolved banner_gradient
  SettingsHandler->>SettingsHandler: sync preset default or apply toggle
  SettingsHandler->>start_ui: updated user configuration
  start_ui->>draw_home: animation state and banner_gradient
  draw_home->>draw_home: render gradient or theme.banner color
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required feat prefix and accurately summarizes the banner gradient toggle and terminal palette behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/banner-gradient-toggle
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/banner-gradient-toggle

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

@LargeModGames
LargeModGames merged commit b7fc96c into main Jul 15, 2026
16 checks passed
@LargeModGames
LargeModGames deleted the feature/banner-gradient-toggle branch July 15, 2026 21:11
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.

1 participant