summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-26 09:29:45 -0300
committerGabriel Schneider <[email protected]>2026-11-26 11:19:58 -0300
commit6b2b63f654561ba9d64c134e6ccc6c0784e15220 (patch)
tree4d3c140f7c26714bb47cae6c2d811928f7170e57 /dev
parent8959b031dc330b4da21c0e89e0831d6fadbcd757 (diff)
downloadpardes-6b2b63f654561ba9d64c134e6ccc6c0784e15220.tar.gz
pardes-6b2b63f654561ba9d64c134e6ccc6c0784e15220.zip
draw, colors, gui: the tags, grips, window and column rows and the notice row drawn from the chrome (the themes programme's L2a, DESIGN.md part F's L2a row, G1' and H): a tag's ground says focus only, two grounds (`chrome.on(.plain/.focus)`), a reading pane's on its focus's as a held one's, its mode on its grip; in a pane tag the trail, path, `Keep` and the user's text in the full ink (`text`, 7:1 where the gamut allows), its computed words (UX K'1, K'3) in the words' ink (`word`, 4.5:1), the basename in `name[g]`, its forward steps, fold and head hints `dim`, the walked word and the head's keys `key`, the head's error `severity[0]`, its own selection and a pointer sweep the ground's selection, window mode's outline the plain tag's selection whichever pane it is on (one outline walked from pane to pane), a hovered word its half selection (B5: `Selection.secondary`, new, the ground halfway to its selection, worked out with the ground's inks); the window row and the column tags on the page, no band and no focus, every word in `page.word` (a terminal's own page where the theme leaves it to the host: dark), their hovered word the page's half selection, a server's progress the page's dim ink; a column's grip `grip.column_rest` (2:1) at rest, `grip.column` (3:1) grabbed, never focus; the notice row on `status` (its ground, ink, dim and its lead's severity per ground); a pane's notice chips on the plain tag; the grid's grip (R5', R6): focused `grip.focus` with its glyph in `grip.ink`, or in `grip.mode_glyph` reading; at rest its ring `grip.ring` as the cell (the theme's own where it rings its grips, acme's #8888cc, lapis's #9aa6d9, where the cell was half that and the box's fill) with the tag's ink; reading unfocused the mode's mark `grip.mode` filled, glyph `grip.ink`; unsaved a bold `*` in `grip.ink` on `grip.dirty`; a message's mark in its kind's ink held on its fill (`Grip.marks`, new: each severity and the dim ink held at a theme change on the four fills a grid gives a grip, at rest and reading on the plain tag too, where a window draws them hollow), so the gui draws the cell's ink and its per-frame pushAway goes; both copies of `inkOn` deleted (draw.zig's, and the gui's use of pushAway); the rail's ticks the hit's and the current hit's (R8), the body's pan arrow the page's key ink, the debug box the rail and the tag's ink; the surface's chrome from the chrome alone (`tag_reading_bg` deleted, `tagline_bg` the page and `tagline_rows` over the column row too, so a window's underlay there is the page); the gui: no reading underlay, the column bar's focus cover and the reading cover gone (nothing reads them now), a column grip's band the page; Messages.ink deleted (`inkOn` takes a ground's inks or a fill's marks); THE BAND is untouched here (its inks are the next change's); RUN (TEST FIRST): draw.zig "a grip in the grid is the chrome's in every theme ..." (every theme in the ring, not the natives: focus, rest, mode, dirty, focused reading; the four each its own), "a reading pane's tag is on the plain or the focused ground, as a held one's; its grip carries the mode's mark ..." (acme, orchard, dark, neonotte84; held and reading, focused and not), "a pane tag's trail, path, Keep and the user's text are in its full ink, its computed words in the words' ink; the window row and the column tags on the page ... the notice row on its own ground" (dark: the host's page), each failing on the base (the old grip mix, the reading tint, the tag's own unheld ink on `Del`, the tagline ground); re-pinned: Trail.zig's reading-tint tests (the reader on the focused ground and its grip region reading, the held one plain), the name tint test (against the full ink, not ` Del`'s), Core.zig's window-row hover and empty column, replica's themed dump, test/column_drag.zig, test/panes.zig's tint tests (the name in `name[g]`, the words in `word`, the rest in `text`), the gui's mark test (the cell's ink, held by the core), look.zig's tag hover (the focused ground's half selection), behaviour's column-tag sweep (the swept cells the selection, the hovered word its half) and tags' tint (the directory in the full ink, the computed words in the words'); GOLDENS (36 of 103, orchard unless said), each moved cell read by goldsum.py/rowpairs.py against the base: (1) the window and column rows to the page: tagline #b2c3b8 on #1d2824 to page.word #788079 on #0d1410 (3932 cells in 33) and their blanks (1834), the active column's #becfc4 on #314738 too (1268); (2) a pane tag's computed words in `word`: plain #819188 (1607), focused #a1b1a8 on the focus ground #394440 (1088); (3) the focused tag's ground #314738 (the old focus tint) to the chrome's #394440 and its full ink #becfc4 to #cadbd0 (991), the name tint on it (701); (4) a reading pane's tint #2c2c0f gone: focused to #394440 (746 + 647 words + 101 names), unfocused to the plain tag (234 + 219 words + 50 names), the head's dim on it to the focused dim #8e9d94 (165), its key #bada9d to #add38a (28 + 6); (5) grips: a reading unfocused one's ring #465a43 to the mode's sky #3096c0 (10 + 2), a focused reading one's glyph black to `mode_glyph` #06779d (6); (6) the rail's current tick, the text #e5eee5, to the current hit #917a53 (8 + 1); (7) a server's progress on the window row, hint #b7cb98, to the page's dim #666f68 (135, callstack, lsprelpath); (8) a hovered header word, the full selection, to the page's half #24382c in page.word (9 + 2, load, windowops); the tag's selection's ink #f5f7ee to the focused ink held on it #cadbd0 (65 + 1, tagpath); (9) blanks only: the dump's runs carry a blank cell's ink from the cell before it, so blanks after `Del`, on a grip's second cell and the column grips show the new ink with no glyph (271 + 253 + 22 + 18 + 6 + 4 + 4 + 4); theme.golden and themesel.golden (24 themes each), the same classes per theme: the window and column rows on each page (dark's the host's: `d`), dark_plus's blue status bar now the notice row's alone (H), acme's cyan header rows on its page #ffffea in #74746a, the focused tag on R4's step (acme #d1e6e6, dark_plus #565656, light #d1cfdb), the notice row's ink `status.text` (the tag's held), paper's and solarium's on the lifted plain tag (H's 1.1), acme's and lapis's resting grip their own ring as the cell; mini, collapse, ninep carry the same in their 9P captures' style rows; GATES (tui): core-test 1155/1329 (174 skipped), pane-test 184/185 (1 skipped), process-test 0 of 103 failed with --update (36 re-recorded, read above); THE END GATE's finds, fixed here: shell-test's look.zig tag hover and behaviour's column-tag sweep and tags' tint asked the old looks (re-pinned above), and behaviour's window mode lost its outline walking from the focused pane to another (each tag's own selection differs by ground: the outline is the plain tag's selection on every pane now); the whole stack's gates are in its last change's description; load 2.5 to 9.5; OUTSIDE draw.zig/Messages.zig: core/colors.zig (Selection.secondary, Grip.marks/Fill/Marks, three hunks), core/surface.zig (Chrome's reading underlay gone, two docs), dev/gui/gui.zig (underlay, gripFill, mark ink, gripDecor's band, coverFrame, two tests), core/Trail.zig, core/Core.zig, core/replica.zig, core/look.zig, test/column_drag.zig, test/panes.zig, test/behaviour/columns_and_tags.zig, test/behaviour/tags.zig (tests), test/snapshots (36)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'dev')
-rw-r--r--dev/gui/gui.zig57
1 files changed, 20 insertions, 37 deletions
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index ccf9387b..b0d5d3ec 100644
--- a/dev/gui/gui.zig
+++ b/dev/gui/gui.zig
@@ -679,7 +679,7 @@ const Cover = packed struct(u16) {
/// glyph is the cell that far to the left.
grip: bool = false,
grip_offset: u4 = 0,
- /// In the focused pane's or column's tag rows.
+ /// In the focused pane's tag rows.
focus: bool = false,
/// At a column's left edge, where a tag's anchor is inset.
anchor: bool = false,
@@ -691,10 +691,7 @@ const Cover = packed struct(u16) {
grip_top: bool = false,
/// In an unfocused pane's tag or body rows while InactiveDim fades them.
dim: bool = false,
- /// In a reading pane's grip or tag rows (Region.reading): their
- /// underlay is the reading tint.
- reading: bool = false,
- _: u2 = 0,
+ _: u3 = 0,
};
/// Marks the grid cells a body or tag layer covers, which the layers paint
@@ -720,11 +717,6 @@ fn coverFrame(cover: []Cover, cols: u16, rows: u16, body_layers: []const pardes.
for (tag_layers) |*layer| {
if (layer.rows != 0) mark.rect(cover, cols, rows, .{ .x = layer.viewport.x, .y = layer.viewport.y, .w = layer.viewport.w, .h = layer.rows }, "layer", true);
}
- // The column bar's rows, which the focused column's tint spans.
- var bar: ?pardes.Rect = null;
- for (regions) |region| {
- if (region.kind == .column_grip) bar = region.rect;
- }
// InactiveDim: an unfocused pane's tag and body rows (Dim.begin).
if (dim.amount > 0) for (regions) |region| {
if ((region.kind == .tag or region.kind == .body) and dim.of(region.owner)) mark.rect(cover, cols, rows, region.rect, "dim", true);
@@ -735,18 +727,13 @@ fn coverFrame(cover: []Cover, cols: u16, rows: u16, body_layers: []const pardes.
for (0..@min(region.rect.w, 16)) |offset| mark.rect(cover, cols, rows, .{ .x = region.rect.x +| @as(u16, @intCast(offset)), .y = region.rect.y, .w = 1, .h = region.rect.h }, "grip_offset", @as(u4, @intCast(offset)));
if (region.kind == .grip and region.active) mark.rect(cover, cols, rows, region.rect, "focus", true);
if (region.dirty) mark.rect(cover, cols, rows, region.rect, "dirty", true);
- if (region.reading) mark.rect(cover, cols, rows, region.rect, "reading", true);
if (region.kind == .grip) mark.rect(cover, cols, rows, region.rect, "pane_grip", true);
mark.rect(cover, cols, rows, .{ .x = region.rect.x, .y = region.rect.y, .w = region.rect.w, .h = @min(1, region.rect.h) }, "grip_top", true);
},
.tag => {
if (region.active) mark.rect(cover, cols, rows, region.rect, "focus", true);
- if (region.reading) mark.rect(cover, cols, rows, region.rect, "reading", true);
- },
- .column => {
- mark.rect(cover, cols, rows, .{ .x = region.rect.x, .y = 0, .w = 1, .h = rows }, "anchor", true);
- if (region.active) if (bar) |b| mark.rect(cover, cols, rows, .{ .x = region.rect.x, .y = b.y, .w = region.rect.w, .h = b.h }, "focus", true);
},
+ .column => mark.rect(cover, cols, rows, .{ .x = region.rect.x, .y = 0, .w = 1, .h = rows }, "anchor", true),
.debug => mark.rect(cover, cols, rows, region.rect, "floating", true),
else => {},
};
@@ -4352,11 +4339,11 @@ fn gripButton(g: *const Gui, chrome: *const pardes.Chrome, col: u16, row: u16, l
/// A pane's button fill, from its region's state, not the grid's cells
/// (which are drawn for cell shells): dirty, focused, or the tag's ground.
-fn gripFill(chrome: *const pardes.Chrome, focus: bool, dirty: bool, reading: bool) [3]u8 {
+fn gripFill(chrome: *const pardes.Chrome, focus: bool, dirty: bool) [3]u8 {
if (dirty) return chrome.grip_dirty;
if (focus) return chrome.grip_focus_ring;
// The ring's inside is the tag's ground.
- return if (reading) chrome.tag_reading_bg else chrome.tag_bg;
+ return chrome.tag_bg;
}
/// The ink on a pane's button (DESIGN.md R6): the chrome's grip ink on a
@@ -4421,10 +4408,10 @@ fn emitSurfaceCell(
const role = cellFontRole(&line[at]);
if (role == .tagline) {
const here = line_cover[at];
- // The workspace row's underlay is its own ground (a theme's status
- // bar), else a reading pane's tint, the focused or the plain tag's.
+ // The window and column rows' underlay is their own ground (the
+ // page), else the focused or the plain tag's.
const band_base: pardes.Cell = .{
- .style = .{ .bg = .{ .rgb = if (row < chrome.tagline_rows) chrome.tagline_bg else if (here.reading) chrome.tag_reading_bg else if (here.focus) chrome.tag_focus_bg else chrome.tag_bg }, .font_role = .tagline },
+ .style = .{ .bg = .{ .rgb = if (row < chrome.tagline_rows) chrome.tagline_bg else if (here.focus) chrome.tag_focus_bg else chrome.tag_bg }, .font_role = .tagline },
.default = false,
};
// The smaller font changes the ink, not the chrome's coverage. Painting
@@ -4468,12 +4455,11 @@ fn emitSurfaceCell(
const center = (b[0] + b[2]) / 2 - @as(f32, @floatFromInt(col - offset)) * body_layout.w;
const shift: f32 = if (cached != null) @as(f32, @floatFromInt(@as(u32, offset) * g.cell_w)) + @as(f32, @floatFromInt(config.GUTTER * g.cell_w)) / 2 - center else 0;
const resolved = resolveCell(g, glyph[0..1], 0, null, .tagline, false, page);
- const fill = gripFill(chrome, here.focus, here.dirty, here.reading);
- // A mark in its kind's ink (Messages.ink), held to its floor on
- // the button's fill, which is not a tag's ground when focused
- // or dirty (UX D4).
+ // A mark in its kind's ink, held on the button's fill and on
+ // the plain tag where the button is hollow (colors.Chrome.Marks,
+ // the grid's cell).
const ink = if (mark) switch (glyph.style.fg) {
- .rgb => |rgb| pardes.colors.pushAway(rgb, &.{fill}, pardes.colors.Roles.ink_floor),
+ .rgb => |rgb| rgb,
else => gripInk(chrome, here.focus, here.dirty),
} else if (here.pane_grip) gripInk(chrome, here.focus, here.dirty) else resolved.fg;
instances[next.*].fr = @as(f32, @floatFromInt(ink[0])) / 255;
@@ -4492,7 +4478,7 @@ fn emitSurfaceCell(
const base = &instances[next.* - 1];
const own: [3]f32 = .{ instances[next.*].br, instances[next.*].bg, instances[next.*].bb };
if (here.pane_grip) {
- const fill = gripFill(chrome, here.focus, here.dirty, here.reading);
+ const fill = gripFill(chrome, here.focus, here.dirty);
base.br = @as(f32, @floatFromInt(fill[0])) / 255;
base.bg = @as(f32, @floatFromInt(fill[1])) / 255;
base.bb = @as(f32, @floatFromInt(fill[2])) / 255;
@@ -5370,7 +5356,7 @@ fn gripDecor(g: *Gui, gpa: std.mem.Allocator, regions: []const pardes.Region, ce
const button = gripButton(g, chrome, grip.rect.x, grip.rect.y, layout);
// Round the button, its first row is the tag's band: nothing of the
// cells under it shows there.
- const band = if (grip.reading) chrome.tag_reading_bg else if (grip.active) chrome.tag_focus_bg else chrome.tag_bg;
+ const band = if (grip.kind == .column_grip) chrome.tagline_bg else if (grip.active) chrome.tag_focus_bg else chrome.tag_bg;
const left = @as(f32, @floatFromInt(grip.rect.x)) * layout.w;
const right = @as(f32, @floatFromInt(grip.rect.x + grip.rect.w)) * layout.w;
try addDecor(g, gpa, left, button[1], button[0], button[3], band, 1, win_w, win_h);
@@ -7366,10 +7352,9 @@ test "every pixel of a grip column is band, button or ring, and the button sits
}
}.of;
const chrome = &s.chrome;
- // The tag's ground (draw.zig tagGround): a reading pane's tint where
- // jumps walk (the pane's file never edited), else the focused tag's
- // or the tag's; round the button and under it alike.
- const band = if (pardes.Trail.reading(core, core.panes[0].?)) chrome.tag_reading_bg else if (focus == 0) chrome.tag_focus_bg else chrome.tag_bg;
+ // The tag's ground, the focused tag's or the tag's, reading or not
+ // (DESIGN.md G1'); round the button and under it alike.
+ const band = if (focus == 0) chrome.tag_focus_bg else chrome.tag_bg;
// Band, fills, rings, the rules between stacked panes and under the
// tag, and the mode marks' ink (the grip's first cell's).
const ink = gripInk(chrome, grip.active, grip.dirty);
@@ -8383,7 +8368,7 @@ test "a band over a terminal's body has the tag rule under its last row, as a ba
try std.testing.expect(found);
}
-test "a pane's mark is its button's glyph where the mode draws none, in its kind's ink held to 4.5:1 on the button's fill, and the mode's bars give way to it (S2 09a: the window drew the box, then the path)" {
+test "a pane's mark is its button's glyph where the mode draws none, in its cell's ink (the core's, held on the button's fill: colors.Chrome.Marks), and the mode's bars give way to it (S2 09a: the window drew the box, then the path)" {
const gpa = std.testing.allocator;
var cells: [12]pardes.Cell = @splat(.{ .default = false, .style = .{ .font_role = .tagline } });
// draw.zig renderPane's box: the mode blank (normal), the mark beside it.
@@ -8407,10 +8392,8 @@ test "a pane's mark is its button's glyph where the mode draws none, in its kind
for (0..2) |col| emitSurfaceCell(&g, &chrome, &instances, &next, @intCast(col), 0, fixedCellLayout(&g), 100, 100, cells[0..6], cover[0..6], col, null, false, null_page);
try std.testing.expectEqual(@as(u32, 4), next);
// Each of the box's two cells draws its slice of the mark's glyph, in
- // the err ink pushed off the focused button's fill.
- const fill = gripFill(&chrome, true, false, false);
- const want = pardes.colors.pushAway(err, &.{fill}, pardes.colors.Roles.ink_floor);
- try std.testing.expect(pardes.colors.contrast(want, fill) >= pardes.colors.Roles.ink_floor);
+ // the cell's ink as the core held it.
+ const want = err;
const drawn = g.atlas.glyphForCodepoint(0x2717);
try std.testing.expect(g.atlas.glyphs.get(.{ .face = drawn.face, .glyph = drawn.glyph, .role = .tagline, .decoration = .{ .bold = true }, .centered = true }) != null);
for ([_]usize{ 1, 3 }) |i| {