summaryrefslogtreecommitdiff
path: root/test/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 20:30:29 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit799bfc56f75535ad13089ee2fcbe907f91305ca3 (patch)
tree1d22ca52a8fab2cfb90c80926c2df5f001197a98 /test/panes.zig
parent0fd908eea63d04886b269438aa7529d3dd422256 (diff)
downloadpardes-799bfc56f75535ad13089ee2fcbe907f91305ca3.tar.gz
pardes-799bfc56f75535ad13089ee2fcbe907f91305ca3.zip
A theme that names no tint for its tags' names takes one of its own hues, so every theme draws a file's name, a +Name and the Tty word off the tag's ink
The faithful ports (neobones_dark, dracula, tokyonight, the *bones, ...), every helix import and any theme file set no tag_name_fg, and ChromeTheme fell back to the plain ink: their tags lost the accent the pardes themes have. The user's neobones_dark looked tinted before only because the Sep 24 build had no such theme and fell back to orchard. The tint is now derived when unset: the theme's keyword colour, else the first of its ANSI accents, syntax, grip, selection or diagnostic colours with a hue, placed at the lightness nearest the ink where the hue holds, at least 4.5:1 on its ground (half a point under the ink's own where the ink has less to spare) and 0.07 off the ink in OKLab. Each ground, plain and focused, gets its own. A theme that names its tint keeps it exactly. Tests: every theme's chrome keeps both tints off the ink and legible; every theme draws a file's basename, +Errors and Tty+sh in a tint, focused or not. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/panes.zig')
-rw-r--r--test/panes.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/panes.zig b/test/panes.zig
index c1ae1666..3b2bea0a 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -1554,7 +1554,7 @@ const TagNameTintTests = struct {
try std.testing.expectEqual(pardes.Color{ .rgb = p.theme().sel_fg }, surface.at(x + 1, y).style.fg);
}
- test "tag filename tint legacy themes retain distinct active foreground" {
+ test "tag filename tint legacy themes keep their active foreground and tint the name with a hue of their own" {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 70, .rows = 14 });
defer p.deinit();
const pane = try p.setTestFile("body\n");
@@ -1574,8 +1574,12 @@ const TagNameTintTests = struct {
const x = p.rects[0].x + pardes.TAG_TEXT_INSET;
const y = tagY(p, p.rects[0]);
const fg = if (active) active_fg else tag_fg;
+ // The directory in the ink; the name tinted, never in it.
+ const chrome = p.chromeTheme();
+ const tint = if (active) chrome.tag_active_name_fg else chrome.tag_name_fg;
+ try std.testing.expect(!std.meta.eql(tint, fg));
try std.testing.expectEqual(pardes.Color{ .rgb = fg }, surface.at(x + 1, y).style.fg);
- try std.testing.expectEqual(pardes.Color{ .rgb = fg }, surface.at(x + 5, y).style.fg);
+ try std.testing.expectEqual(pardes.Color{ .rgb = tint }, surface.at(x + 5, y).style.fg);
}
}
};