summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 11:34:44 -0300
committerGabriel Schneider <[email protected]>2026-11-05 15:15:07 -0300
commit2bd4066a932ec8fc401e4b85e9f8441b17df3cfb (patch)
tree024f6180ed665fbe821e4a4a46e54551e6a0b31e /src/config.zig
parent7ec1181244c039db72986eec46f21a9d5ac2e171 (diff)
downloadpardes-2bd4066a932ec8fc401e4b85e9f8441b17df3cfb.tar.gz
pardes-2bd4066a932ec8fc401e4b85e9f8441b17df3cfb.zip
effects out, Lift and InactiveDim: the core's per-pane lift springs (Pardes.lifts, lift_serials, Region.lift, Chrome.lift_style) and the unfocused panes' recede (draw.zig's dim, its contrast memo and linear blend) go with the words, their settings and tests; the window loses its soft shadows (addSoft, the lift and rim casting, the shadow a sliding pane cast, the contrast ceilings, decor.frag's Gaussian path) and Chrome.sel_fg and sel_bg, which only the ceilings read; a pane closed mid-lift left its spring unsettled and continuous() true for ever, so a window could never go idle (monkey-gui failed `never settled` in the Lift combinations, and passes now); GUI golden 18-mid-transition changes, its sliding pane casting no shadow (the scene leaves with the transitions); root_ctl's out-of-range case is SearchRows', settings' GUI-only case GripWidth's, the window monkey loses its Lift axis
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig65
1 files changed, 6 insertions, 59 deletions
diff --git a/src/config.zig b/src/config.zig
index e2d81c6d..647f3112 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -169,9 +169,7 @@ pub const leader_path = paths: {
if (builtins.capabilities.lift) table.set(.CursorBlink, null);
if (builtins.capabilities.lift) table.set(.Parallax, null);
table.set(.ProgramEsc, null);
- if (builtins.capabilities.lift) table.set(.Lift, null);
table.set(.Motion, null);
- table.set(.InactiveDim, null);
if (builtins.capabilities.lift) table.set(.GripWidth, null);
if (builtins.capabilities.panel_transitions) {
table.set(.PanelSlide, "as");
@@ -721,14 +719,6 @@ pub const Runtime = struct {
/// A font's programming ligatures (`->`, `!=`) draw across their cells.
/// Only a shell that shapes text has the setting (`Capabilities.ligatures`).
ligatures: bool = true,
- /// How the focused pane and the notices stand off the page (G1,
- /// docs/render-pipeline.md ยง9.1), or off. Opt-in until the focus lift's
- /// default is decided. Only a pixel shell draws it (`Capabilities.lift`).
- lift: LiftStyle = .off,
- /// Blends the unfocused panes' text toward each cell's own ground,
- /// percent (0 off): the focused pane wins by comparison, its tag tint
- /// untouched. Kept above min(each cell's contrast, 4.5).
- inactive_dim: u8 = 0,
/// The grip's button and the scrollbar under it, one width, as a percent
/// of the theme's `rail_px` (acme's 12px Scrollwid at a 17px tagline):
/// a pixel shell's (docs/typ/themes.typ).
@@ -824,16 +814,6 @@ pub const Runtime = struct {
/// A setting that is one of a few words, each an enum field of Runtime.
pub const Choice = enum { pager, term_images, jump_scope, search_place, search_pane };
- /// shadow: a soft drop shadow. rim: a light hairline along the top of
- /// the focused pane's tag rows. auto: a shadow on a light page; on a
- /// dark one, where a shadow has nothing to darken, the other panes
- /// recede instead (InactiveDim, at `auto_dim` unless it is set).
- pub const LiftStyle = enum(u8) { off, shadow, rim, auto };
- /// What `Lift auto` dims the unfocused panes by on a dark page when
- /// InactiveDim is 0: enough to read at a glance (the user's own init
- /// sets 35), not so much that they stop being worth reading.
- pub const auto_dim: u8 = 30;
-
pub const tagline_percent_min: u8 = 1;
pub const tagline_percent_max: u8 = 100;
@@ -918,12 +898,8 @@ pub const Runtime = struct {
window_blur,
message_ms: MessageTime,
dump_dir,
- /// A lift style, `on` (auto) or `off`; bare flips auto and off.
- lift,
/// A motion flavour.
motion,
- /// A percentage, 0 through 100.
- inactive_dim,
grip_width,
tab,
callstack_depth,
@@ -955,7 +931,7 @@ pub const Runtime = struct {
.window_opacity => .window_opacity,
.window_blur => .window_blur,
.transition => .panel_transitions,
- .lift, .grip_width => .lift,
+ .grip_width => .lift,
.toggle => |field| switch (field) {
.ligatures => .ligatures,
.cursor_blink, .parallax => .lift,
@@ -980,9 +956,7 @@ pub const Runtime = struct {
.{ .word = "CursorBlink", .action = .{ .toggle = .cursor_blink }, .doc = "The cursor blinks, solid while typing, on or off." },
.{ .word = "Parallax", .action = .{ .toggle = .parallax }, .doc = "A theme's page pattern moves with the text at a quarter of its speed, on or off." },
.{ .word = "ProgramEsc", .action = .{ .toggle = .program_esc }, .doc = "In a raw terminal, Esc goes to the program and Shift-Esc backs out, on; off (the default) swaps them." },
- .{ .word = "Lift", .action = .lift, .doc = "How the focused pane stands off the page: off, shadow, rim or auto." },
.{ .word = "Motion", .action = .motion, .doc = "How animations move: off, crisp, smooth, bouncy or playful." },
- .{ .word = "InactiveDim", .action = .inactive_dim, .doc = "Fade the unfocused panes' text by a percentage, 0 through 100, 0 off." },
.{ .word = "GripWidth", .action = .grip_width, .doc = "The grip and scrollbar width, as a percent of the theme's rail." },
.{ .word = "MessageLinger", .action = .{ .message_ms = .linger }, .doc = "How long, in milliseconds, a message stays after what dismisses it." },
.{ .word = "MessageFall", .action = .{ .message_ms = .fall }, .doc = "How long, in milliseconds, a message takes to fall into its row." },
@@ -1113,17 +1087,7 @@ pub const Runtime = struct {
now.* = stepped(@TypeOf(now.*), now.*, argument) orelse return false;
},
},
- .lift => {
- const text = std.mem.trim(u8, argument orelse "", " \t\r\n");
- state.lift = if (text.len == 0)
- (if (state.lift == .off) .auto else .off)
- else if (std.mem.eql(u8, text, "on"))
- .auto
- else
- std.meta.stringToEnum(LiftStyle, text) orelse return false;
- },
.motion => state.motion = stepped(animation.Motion.Flavour, state.motion, argument) orelse return false,
- .inactive_dim => state.inactive_dim = number(u8, argument, " \t\r\n%", 0, 100) orelse return false,
.grip_width => state.grip_width = number(u16, argument, " \t\r\n%", 50, 300) orelse return false,
.callstack_depth => state.callstack_depth = number(u8, argument, " \t\r\n", 1, @import("lsp/lsp.zig").callstack_max_depth) orelse return false,
.tab => state.tab = number(u16, argument, " \t\r\n", 1, 16) orelse return false,
@@ -1149,7 +1113,6 @@ pub const Runtime = struct {
.choice => |which| switch (which) {
inline else => |field| comptime words.of(@FieldType(Runtime, @tagName(field))),
},
- .lift => "on, " ++ comptime words.of(LiftStyle),
.motion => comptime words.of(animation.Motion.Flavour),
else => null,
};
@@ -1159,7 +1122,7 @@ pub const Runtime = struct {
/// words (`choices`), else its range or the kind of thing it takes.
pub fn takes(action: Action) ?[]const u8 {
return choices(action) orelse switch (action) {
- .inactive_dim, .window_opacity, .window_blur => "0-100 (a percentage)",
+ .window_opacity, .window_blur => "0-100 (a percentage)",
.grip_width => "50-300 (a percentage)",
.tab => "1-16 (cells)",
.callstack_depth => "1-64 (levels)",
@@ -1253,7 +1216,7 @@ pub const Runtime = struct {
else
try out.print("{s} {s}\n", .{ setting.word, context.theme_name }),
// A number in a field named as its action.
- inline .window_opacity, .window_blur, .inactive_dim, .callstack_depth, .tab, .search_rows, .grip_width => |_, tag| try out.print("{s} {d}\n", .{ setting.word, @field(state, @tagName(tag)) }),
+ inline .window_opacity, .window_blur, .callstack_depth, .tab, .search_rows, .grip_width => |_, tag| try out.print("{s} {d}\n", .{ setting.word, @field(state, @tagName(tag)) }),
.dump_dir => {
const dir = if (state.dump_dir.len > 0) state.dump_dir.get() else context.default_dump_dir;
if (dir.len > 0) try out.print("{s} {s}\n", .{ setting.word, dir }) else try out.print("# {s} (none)\n", .{setting.word});
@@ -1286,7 +1249,6 @@ pub const Runtime = struct {
.choice => |which| switch (which) {
inline else => |field| try out.print("{s} {s}\n", .{ setting.word, @tagName(@field(state, @tagName(field))) }),
},
- .lift => try out.print("{s} {s}\n", .{ setting.word, @tagName(state.lift) }),
.motion => try out.print("{s} {s}\n", .{ setting.word, @tagName(state.motion) }),
};
if (context.locations.len > 0) try out.print("LocationsConfig {s}\n", .{context.locations});
@@ -1372,21 +1334,6 @@ pub const Runtime = struct {
try std.testing.expectEqual(animation.Transition.off, state.panel_transition);
}
- test "Lift takes a style, on is auto, and bare flips it off and back to auto" {
- var state: Runtime = .{};
- const lift = find("Lift").?;
- try std.testing.expect(apply(&state, lift, null));
- try std.testing.expectEqual(LiftStyle.auto, state.lift);
- try std.testing.expect(apply(&state, lift, "rim"));
- try std.testing.expectEqual(LiftStyle.rim, state.lift);
- try std.testing.expect(apply(&state, lift, null));
- try std.testing.expectEqual(LiftStyle.off, state.lift);
- try std.testing.expect(apply(&state, lift, "on"));
- try std.testing.expectEqual(LiftStyle.auto, state.lift);
- try std.testing.expect(!apply(&state, lift, "sparkle"));
- try std.testing.expectEqual(LiftStyle.auto, state.lift);
- }
-
test "tagline size validates before mutating live state" {
const setting = find("TaglineSize").?;
var state: Runtime = .{};
@@ -1498,9 +1445,9 @@ pub const Runtime = struct {
.{ "TaglineSize", "73" }, .{ "WindowOpacity", "85" }, .{ "WindowBlur", "40" },
.{ "MessageLinger", "1500" }, .{ "MessageFall", "1500" }, .{ "MessageDissolve", "1500" },
.{ "DumpDir", "~/dumps" }, .{ "TermImages", "petscii" }, .{ "JumpScope", "all" },
- .{ "SearchPlace", "column" }, .{ "SearchPane", "new" }, .{ "Lift", "rim" },
- .{ "Motion", "playful" }, .{ "InactiveDim", "35" }, .{ "GripWidth", "200" },
- .{ "CallstackDepth", "16" }, .{ "Tab", "8" }, .{ "SearchRows", "12" },
+ .{ "SearchPlace", "column" }, .{ "SearchPane", "new" }, .{ "Motion", "playful" },
+ .{ "GripWidth", "200" }, .{ "CallstackDepth", "16" }, .{ "Tab", "8" },
+ .{ "SearchRows", "12" },
};
for (values) |v| try std.testing.expect(apply(&state, find(v[0]).?, v[1]));
try std.testing.expect(state.font.requested_name.set("Wanted Mono"));