-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
code-qualityInternal code improvement, no user-visible changeInternal code improvement, no user-visible changeenhancementNew feature or requestNew feature or requestuxUser experience improvementUser experience improvement
Milestone
Description
Context
This evolves #109 (replace hardcoded colors) from a mechanical refactor into a feature foundation. Instead of just moving colors to constants, we build the infrastructure for user-selectable themes.
User Story
As a contributor, I want all colors in one place so I can add a new theme without touching 13 files. As a user, I want Vortix to look good in both dark and light terminals.
Design
Phase 1 (v0.1.8): Foundation
- All
Color::Rgb(...)insrc/ui/→theme::current().panel_borderetc. - Theme struct with named semantic colors (not "blue" but "panel_border", "active_indicator", "warning_text")
- Default theme: current Nord-inspired palette
theme::current()returns a static reference to the active theme
Phase 2 (future): User Selection
themefield inconfig.toml- Built-in themes: Nord, Dracula, Solarized Dark, Solarized Light
- Runtime theme switching
Implementation (Phase 1 only)
Step 1: Define the Theme struct in src/theme.rs:
pub struct Theme {
pub panel_border: Color,
pub panel_border_focused: Color,
pub text_primary: Color,
pub text_secondary: Color,
pub text_dim: Color,
pub accent: Color,
pub success: Color,
pub warning: Color,
pub error: Color,
pub connected_badge: Color,
pub sidebar_selected: Color,
pub header_bg: Color,
// ... etc
}
pub const NORD: Theme = Theme { ... };
pub fn current() -> &'static Theme {
&NORD // For now, always Nord. Phase 2 makes this configurable.
}Step 2: Replace all Color::Rgb(...) in src/ui/**/*.rs with theme::current().field_name.
Step 3: Verify: rg "Color::Rgb" src/ui/ returns zero results.
Acceptance Criteria
-
Themestruct with semantic color names - All UI colors reference
theme::current() - Zero
Color::Rgbcalls insrc/ui/ - Visual appearance unchanged (same palette, just referenced differently)
- Adding a new theme = adding one
const Themeblock
Supersedes
Closes #109 when merged.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
code-qualityInternal code improvement, no user-visible changeInternal code improvement, no user-visible changeenhancementNew feature or requestNew feature or requestuxUser experience improvementUser experience improvement