summaryrefslogtreecommitdiff
path: root/test/column_drag.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-15 17:24:57 -0300
committerGabriel Schneider <[email protected]>2026-09-15 17:26:23 -0300
commitebe561b8083782a105a2ee29fb0a031d1c2427d3 (patch)
tree73d8fae6c7345449b6235b54a44eba87655823d9 /test/column_drag.zig
parent6560da36cf8111575cd3fec443a42de6eff82f5f (diff)
downloadpardes-ebe561b8083782a105a2ee29fb0a031d1c2427d3.tar.gz
pardes-ebe561b8083782a105a2ee29fb0a031d1c2427d3.zip
Keep column grips blank and muted in every focus state
Diffstat (limited to 'test/column_drag.zig')
-rw-r--r--test/column_drag.zig37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/column_drag.zig b/test/column_drag.zig
index 341c8b70..1c9a344e 100644
--- a/test/column_drag.zig
+++ b/test/column_drag.zig
@@ -169,3 +169,40 @@ test "column grip is separate from compact text and the resize seam" {
try std.testing.expect(p.drag == .border_v);
p.update(.{ .mouse = .{ .button = .left, .kind = .release, .col = seam, .row = body_row } });
}
+
+test "column grips stay blank and muted across focus hover and drag" {
+ const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 20 });
+ defer p.deinit();
+ _ = try p.setTestFile("left\n");
+ p.presentation.enabled = false;
+ p.settings.column_tags = true;
+ p.row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 5, .tagline_h = 10 };
+ try std.testing.expect(p.executeBuiltinLine(0, "New"));
+ try std.testing.expect(layout.splitColumn(p, p.active, p.active, false));
+ var frame = std.heap.ArenaAllocator.init(p.gpa);
+ defer frame.deinit();
+ for ([_]bool{ false, true }) |focus_tint| {
+ p.settings.focus_tint = focus_tint;
+ for (0..p.ncol) |active_column| {
+ p.active = p.col_panes[active_column][0];
+ const x = p.col_x[active_column];
+ p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = x, .row = pardes.TOPBAR_H } });
+ for ([_]bool{ false, true }) |dragging| {
+ if (dragging) mouse(p, .press, x);
+ _ = frame.reset(.retain_capacity);
+ const surface = try p.render(frame.allocator());
+ const muted: pardes.Color = .{ .rgb = p.chromeTheme().column_box_dim };
+ for (0..p.ncol) |column| {
+ for (0..config.GUTTER) |offset| {
+ const cell = surface.at(p.col_x[column] + @as(u16, @intCast(offset)), pardes.TOPBAR_H);
+ try std.testing.expectEqualStrings(" ", cell.grapheme());
+ try std.testing.expectEqual(muted, cell.style.bg);
+ try std.testing.expectEqual(pardes.FontRole.tagline, cell.style.font_role);
+ }
+ try std.testing.expectEqual(p.col_x[column] + config.GUTTER, (try tagLayer(p, column)).viewport.x);
+ }
+ if (dragging) mouse(p, .release, x);
+ }
+ }
+ }
+}