Feature/base16 themes#19
Merged
Merged
Conversation
Adds Base16Scheme + Theme structs, Theme::from_scheme slot mapping, and MOCHA constant. New deps: dirs, serde, toml; tempfile dev-dep. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… Nord, Dracula, Solarized, Tokyo Night) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…dence Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…slots Add `theme: &'static Theme` to App, plumb the resolved theme from main.rs through App::new, and replace ~140 hardcoded `c(m.<color>)` Catppuccin Mocha references in src/ui.rs and src/browser/ui.rs with semantic Theme slots (`theme.bg`, `theme.accent`, `theme.error`, `theme.series[N]`, …) per the Base16 mapping table. BrowserApp uses default_theme() as a Task 8 placeholder. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add `theme: &'static Theme` to BrowserApp, propagate from main.rs and into the embedded viewer when a file is opened. browser_ui now reads `app.theme` instead of the temporary `default_theme()` placeholder. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All theme colors now come from the in-repo Base16 schemes in src/theme.rs; the Catppuccin Mocha palette is one of nine built-in schemes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ThemePicker holds a cursor into list_themes() and remembers the original theme name so Esc can revert. render_picker draws a centered popup with the theme list, current selection highlight, and a key-hint footer. Wired into App in Task 11 — module-level #![allow(dead_code)] is removed there. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
T opens the picker; j/k navigate with live preview (App.theme reassigned on each move); Enter persists the choice to ~/.config/datasight/state.toml and exits; Esc reverts to the original theme. Mode::ThemePicker is added with PartialEq so the matches! → == switch in ui.rs reads naturally. Drops the temporary `#[allow(dead_code)]` on display_name, write_state_theme_at, and the theme_picker module — all wired in now. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
T (uppercase) opens the picker globally; the handler runs before the ctrl-e and Tab interceptors so the picker takes precedence. j/k previews update both BrowserApp.theme and the embedded viewer.theme so both panes re-render in the new theme. Enter persists; Esc reverts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a Suite Y that opens the picker with T, verifies the popup is visible and cancellable with Esc, then re-opens, navigates with j, and persists with Enter — checking ~/.config/datasight/state.toml ends up with a theme= entry. Covers both the file-viewer and browse entry points. Cleans up the state file at the end. The block also resets cwd to REPO_ROOT first, since X6 leaves the shell in tests/fixtures.
Updates README with a Themes section, the T keybind, a Base16-themed Features bullet, and refreshed tagline. CLAUDE.md gets entries for theme.rs and theme_picker.rs, the new ThemePicker mode variant, and a note on how browse mode keeps the viewer's theme in sync.
b4e7790 to
9b3ac89
Compare
- Fix help_text: p entered pick-Y not pick-X; add Space entry; clarify Enter behaviour per mode; expand t to mention histogram for single-Y - Add Theme section to help popup (T, j/k, Enter, Esc) - README: add missing `i` (row-index X) to Plot table - README: add missing `T` (theme picker) to Browse keybindings table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
"Use row index as X" didn't convey that i skips X selection and plots immediately. Renamed to "Plot now (row index as X)" and updated "Pick X" to "Pick X axis" for symmetry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The i key was only visible in the shortcut badge row and could be cut off on narrow terminals. Added it to the bold info bar where users look first, and shortened the badge label to "Plot with index". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the hardcoded Catppuccin Mocha palette with a full Base16 theme system, adding live theme switching via an in-TUI picker and multiple built-in schemes.
What's new
--theme <name>CLI flag — select a theme at startupDATASIGHT_THEMEenv var — override the theme without touching the command line~/.config/datasight/state.tomland restored on next launchtkey) — popup overlay with arrow-key navigation and immediate live preview; works in both normal viewer and browse modeThemestruct — all UI colours are resolved from named slots (bg,bg_alt,accent,error,series[6], …); no hardcoded palette references remain inui.rsorbrowser/ui.rsPrecedence
Files added
src/theme.rsThemestruct, state I/O,resolve_themesrc/theme_picker.rsThemePickerstate +render_picker()popup, shared by both app modesBreaking changes
None — the default theme (Mocha) is visually identical to the previous hardcoded palette. The
catppuccincrate dependency has been removed.