summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 13:08:44 -0300
committerGabriel Schneider <[email protected]>2026-11-05 15:21:15 -0300
commit1b2ac091200e9192f3677abe161217ba82463606 (patch)
tree8fe35cf6edaa032e4650a631598dfab2fc4aabb5 /src/config.zig
parent1870d06248f884439cb2ec4ef8f1b03952df2eb8 (diff)
downloadpardes-1b2ac091200e9192f3677abe161217ba82463606.tar.gz
pardes-1b2ac091200e9192f3677abe161217ba82463606.zip
effects out, the message animations: a message no longer falls into its row and dissolves out of it; it shows at once and goes when it has lingered, its lifetime the one deadline the core keeps for it (MessageLinger, a wait nextWake jumps in one step); MessageAnimation, MessageFall and MessageDissolve go with their settings, the entering and leaving phases (Pane.MessagePhase is shown or lingering), Messages.messageMotion and noticeLife, the notice band's colour blend toward the page, Layer.slide and fade, and the window's offset band, its clip to the body and its rule's fade; no frontend fades a message of its own (the window would have to see a notice come and go between frames for a 150 ms fade); the snapshot harness's, kitty harness's and casts' inits lose `MessageAnimation off`; the message tests keep their linger and stacking and lose the fall and dissolve, and `a notice leaves quicker than it arrives` goes; GUI goldens 10 and 12 to 17 change, the golden session having run with MessageAnimation on by default: a message dismissed while it fell stayed up (its dismissal undone by the next announcement), and FocusTint's stood on in every scene after; the tree before this change with MessageAnimation off draws exactly these frames, all sixteen byte for byte
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.zig48
1 files changed, 11 insertions, 37 deletions
diff --git a/src/config.zig b/src/config.zig
index dbe4e9b7..9a7e6848 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -158,10 +158,7 @@ pub const leader_path = paths: {
table.set(.Font, null);
table.set(.TaglineSize, null);
}
- table.set(.MessageAnimation, null);
table.set(.MessageLinger, null);
- table.set(.MessageFall, null);
- table.set(.MessageDissolve, null);
table.set(.DumpDir, null);
if (builtins.capabilities.window_opacity) table.set(.WindowOpacity, null);
if (builtins.capabilities.window_blur) table.set(.WindowBlur, null);
@@ -365,8 +362,7 @@ pub const wheel_cols: i32 = 4;
pub const look_preview_delay_frames: u16 = 2;
-/// The longest any message timing (MessageLinger, MessageFall,
-/// MessageDissolve) may be set to, in milliseconds.
+/// The longest MessageLinger may be set to, in milliseconds.
pub const message_ms_max: u16 = 60_000;
// Tag fonts keep body-cell geometry; valid sizes are 1...100 percent.
@@ -725,8 +721,6 @@ pub const Runtime = struct {
/// Builtins announce themselves on the message row.
verbose: bool = true,
- /// A message falls into its row and dissolves out of it.
- message_animation: bool = true,
/// The cursor blinks, a pixel shell's (docs/render-pipeline.md §5.4):
/// solid while typing and for half a second after, eased at each edge,
/// solid again after ten idle seconds.
@@ -739,12 +733,6 @@ pub const Runtime = struct {
program_esc: bool = false,
/// How long a message stays after the key or click that dismisses it.
message_linger_ms: u16 = 800,
- /// How long its fall into the row takes, easing out (§8.1: arriving,
- /// 150 to 220 ms).
- message_fall_ms: u16 = 180,
- /// How long its dissolve takes, easing in: leaving is quicker than
- /// arriving (§8.1: 100 to 160 ms).
- message_dissolve_ms: u16 = 150,
/// Where Dump writes and a relative Restore looks; empty is the default
/// ($XDG_DATA_HOME/pardes, else ~/.local/share/pardes).
dump_dir: Text(limits.host_path_cap) = .{},
@@ -879,10 +867,7 @@ pub const Runtime = struct {
pub const Capability = std.meta.FieldEnum(Capabilities);
- /// The message timings a setting word sets, each in milliseconds.
- pub const MessageTime = enum { linger, fall, dissolve };
-
- pub const Toggle = enum { colors, wrap, tree_context_tag_style, tag_bottom, debug, focus_tint, syntax_bold, pager_color, verbose, message_animation, ligatures, cursor_blink, jump_trail, program_esc };
+ pub const Toggle = enum { colors, wrap, tree_context_tag_style, tag_bottom, debug, focus_tint, syntax_bold, pager_color, verbose, ligatures, cursor_blink, jump_trail, program_esc };
pub const Action = union(enum) {
toggle: Toggle,
@@ -892,7 +877,7 @@ pub const Runtime = struct {
tagline_size,
window_opacity,
window_blur,
- message_ms: MessageTime,
+ message_linger,
dump_dir,
/// A motion flavour.
motion,
@@ -948,7 +933,6 @@ pub const Runtime = struct {
.{ .word = "FocusTint", .action = .{ .toggle = .focus_tint }, .doc = "The focused pane's and column's tags are tinted, on or off." },
.{ .word = "SyntaxBold", .action = .{ .toggle = .syntax_bold }, .doc = "Keywords and the like are drawn bold, on or off." },
.{ .word = "Verbose", .action = .{ .toggle = .verbose }, .doc = "A builtin says its own name on the message row as it runs, on or off." },
- .{ .word = "MessageAnimation", .action = .{ .toggle = .message_animation }, .doc = "A message falls into its row and dissolves out of it, on or off." },
.{ .word = "Ligatures", .action = .{ .toggle = .ligatures }, .doc = "A font's programming ligatures draw across their cells, on or off." },
.{ .word = "CursorBlink", .action = .{ .toggle = .cursor_blink }, .doc = "The cursor blinks, solid while typing, on or off." },
.{ .word = "JumpTrail", .action = .{ .toggle = .jump_trail }, .doc = "A jump of the cursor leaves a short trail that fades, on or off." },
@@ -957,9 +941,7 @@ pub const Runtime = struct {
.{ .word = "GripWidth", .action = .grip_width, .doc = "The grip and scrollbar width, as a percent of the theme's rail." },
.{ .word = "InactiveDim", .action = .inactive_dim, .doc = "Fade the unfocused panes' text by a percentage, 0 through 100, 0 off." },
.{ .word = "Pet", .action = .{ .choice = .pet }, .doc = "The window's companion in the workspace tag's blank space: off, cat or frog." },
- .{ .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." },
- .{ .word = "MessageDissolve", .action = .{ .message_ms = .dissolve }, .doc = "How long, in milliseconds, a message takes to dissolve." },
+ .{ .word = "MessageLinger", .action = .message_linger, .doc = "How long, in milliseconds, a message stays after what dismisses it." },
.{ .word = "DumpDir", .action = .dump_dir, .doc = "The directory Dump writes to and a relative Restore reads from; bare, the default." },
.{ .word = "Theme", .action = .theme, .doc = "Switch to the named theme." },
.{ .word = "Shell", .action = .shell, .doc = "The shell new terminals run; bare, $SHELL if it is executable, else /bin/sh." },
@@ -1045,12 +1027,7 @@ pub const Runtime = struct {
}
if (!state.dump_dir.set(text)) return false;
},
- .message_ms => |which| {
- const ms = number(u16, argument, " \t\r\n", 0, message_ms_max) orelse return false;
- switch (which) {
- inline else => |w| @field(state, "message_" ++ @tagName(w) ++ "_ms") = ms,
- }
- },
+ .message_linger => state.message_linger_ms = number(u16, argument, " \t\r\n", 0, message_ms_max) orelse return false,
// Bare, it steps to the next word, as a tag word should.
.choice => |which| switch (which) {
inline else => |field| {
@@ -1100,7 +1077,7 @@ pub const Runtime = struct {
.callstack_depth => "1-64 (levels)",
.search_rows => "1-100 (rows)",
.tagline_size => std.fmt.comptimePrint("{d}-{d} (a percentage)", .{ tagline_percent_min, tagline_percent_max }),
- .message_ms => std.fmt.comptimePrint("0-{d} (milliseconds)", .{message_ms_max}),
+ .message_linger => std.fmt.comptimePrint("0-{d} (milliseconds)", .{message_ms_max}),
.shell => "a path of at most 255 bytes; bare, $SHELL, else /bin/sh",
.dump_dir => std.fmt.comptimePrint("an absolute or ~ path of at most {d} bytes, to a directory that may be written; bare, the default", .{limits.host_path_cap}),
.font => "a name or path, :8 to :72 after it (Mono:14)",
@@ -1193,9 +1170,7 @@ pub const Runtime = struct {
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});
},
- .message_ms => |which| try out.print("{s} {d}\n", .{ setting.word, switch (which) {
- inline else => |w| @field(state, "message_" ++ @tagName(w) ++ "_ms"),
- } }),
+ .message_linger => try out.print("{s} {d}\n", .{ setting.word, state.message_linger_ms }),
.shell => {
const chosen = state.shell.requested.get();
try out.print("{s} {s}\n", .{ setting.word, if (chosen.len == 0) context.compiled_default_shell else chosen });
@@ -1393,11 +1368,10 @@ pub const Runtime = struct {
};
const values = [_][2][]const u8{
.{ "TaglineSize", "73" }, .{ "WindowOpacity", "85" }, .{ "WindowBlur", "40" },
- .{ "MessageLinger", "1500" }, .{ "MessageFall", "1500" }, .{ "MessageDissolve", "1500" },
- .{ "DumpDir", "~/dumps" }, .{ "TermImages", "petscii" }, .{ "JumpScope", "all" },
- .{ "SearchPlace", "column" }, .{ "SearchPane", "new" }, .{ "Motion", "playful" },
- .{ "GripWidth", "200" }, .{ "InactiveDim", "35" }, .{ "CallstackDepth", "16" },
- .{ "Tab", "8" }, .{ "SearchRows", "12" },
+ .{ "MessageLinger", "1500" }, .{ "DumpDir", "~/dumps" }, .{ "TermImages", "petscii" },
+ .{ "JumpScope", "all" }, .{ "SearchPlace", "column" }, .{ "SearchPane", "new" },
+ .{ "Motion", "playful" }, .{ "GripWidth", "200" }, .{ "InactiveDim", "35" },
+ .{ "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"));