Skip to content

refactor(ui): centralize theme style initialization - #472

Merged
gjermundgaraba merged 1 commit into
mainfrom
theme-cleanup
Sep 12, 2026
Merged

refactor(ui): centralize theme style initialization#472
gjermundgaraba merged 1 commit into
mainfrom
theme-cleanup

Conversation

@gjermundgaraba

@gjermundgaraba gjermundgaraba commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Initialize the default palette through ApplyThemeColors.
  • Build model and spectrum styles through the existing theme rebuild paths, removing duplicate initializers.

Validation

  • make test
  • make fmt-check vet
  • git diff --check

Summary by CodeRabbit

  • New Features

    • UI colors and visualizer spectrum styling now update consistently when the application theme changes.
    • Theme colors are applied automatically at startup, providing consistent default styling throughout the interface.
  • Bug Fixes

    • Improved visual consistency for model views, controls, and spectrum displays after switching themes.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 58422d2c-5530-4040-9e26-fad4fcda2277

📥 Commits

Reviewing files that changed from the base of the PR and between 6b2e85b and 033f998.

📒 Files selected for processing (4)
  • ui/model/styles.go
  • ui/model/view.go
  • ui/styles.go
  • ui/visualizer.go

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

UI colors and Lipgloss styles now initialize through centralized theme application and rebuild functions. Default theme initialization occurs during package startup, and visualizer ANSI caching runs through the same path.

Changes

Theme-aware style initialization

Layer / File(s) Summary
Centralized palette and visualizer initialization
ui/styles.go, ui/visualizer.go
Palette variables now initialize through ApplyThemeColors. Visualizer styles use the current palette, and ANSI caching is triggered by theme application.
Model style rebuilding
ui/model/styles.go, ui/model/view.go
Model styles use zero-value declarations and initialize through rebuildModelStyles during package startup.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: bjarneo

Merge Risk: ⚪ Minimal · up to 033f9

Theme palette and style initialization are centralized with startup initialization in place; no merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly and concisely describes the main change: centralizing UI theme style initialization.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gjermundgaraba
gjermundgaraba merged commit 3f71671 into main Sep 12, 2026
7 checks passed
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