From 806dc79a694c9df50cf3e13e9091986ebc74cb96 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 24 Nov 2026 22:46:35 -0300 Subject: Pick: SPC t t (Themes) is a picker of the themes in the asking pane's own tag, the whole window wearing the theme under the cursor and no pane dimmed (every one flagged previewing), Enter wearing it, Esc putting the session's own back (pick-ui SPEC §5.1, §3.6, walk UI line F item 4): a source `themes` (Pick.Source; its rows the themes in their order, the cursor starting on the one worn; no reader, no acts, no other sources, no second row), its preview colors.previewTheme, the one function the `:theme ` argument rows can call too: Pardes.theme_preview over the session's theme in theme() and chromeTheme() (its chrome worked out once a theme, never a frame; nothing loaded, a ThemeFile and a custom theme untouched under it), set in the step of the key that moved the cursor (Pick.produceAll) and cleared at the roll-up; both fields on root.zig's kept_out list (derived from the picker's cursor, which the digest has); Themes from a 9P script or under `Jumps new-pane` opens +Themes as before; TEST: Pick.zig "SPC t t is a picker of the themes ..." (its host, the cursor on the worn theme, every pane previewing, Down wears the next with the session's unchanged, Esc, Enter); core-test 1027/1194 (167 skipped), 0 failed, load 8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- core/Core.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'core/Core.zig') diff --git a/core/Core.zig b/core/Core.zig index 6ee82370..d0011048 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -337,6 +337,11 @@ locations_cache: locations.Cache = .{}, tty_filter_palette: pardes.Term.FilterPalette = .{}, font_request_taken: bool = false, custom_theme: ?Theme = null, +/// The theme the window wears while a picker of them (or `:theme `) +/// previews one, by index, and its chrome (colors.previewTheme); the +/// session's own theme untouched under it. +theme_preview: ?u16 = null, +preview_chrome: ChromeTheme = colors.initial_chrome, /// bodyChrome's: the theme it was worked out for, and it. body_chrome: ?struct { theme: Theme, chrome: ChromeTheme } = null, theme_file_path: config.Settings.Text(limits.host_path_cap) = .{}, @@ -525,7 +530,7 @@ pub const replica = .{ "opts", "dump_out", "dump_export", "tape", }, - .derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "body_chrome" }, + .derived = .{ "shell_rows", "diff_output", "locations_cache", "retired_panes", "tty_filter_palette", "body_chrome", "theme_preview", "preview_chrome" }, // The host's handles, the state file every session of the user // shares (and Recent read from it), this session's closed panes, and // the files of a host with no file system of its own. (The 9P @@ -2130,12 +2135,14 @@ fn sizes(p: *const Pardes, pane: *const Pane) bool { } pub fn theme(p: *const Pardes) *const Theme { + if (p.theme_preview) |i| return &themes[i]; if (p.custom_theme) |*custom| return custom; return &themes[p.settings.theme]; } /// The colours of the chrome: the theme's, set as it changes. pub fn chromeTheme(p: *const Pardes) *const ChromeTheme { + if (p.theme_preview != null) return &p.preview_chrome; return &p.chrome; } -- cgit v1.3