diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 13:28:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 15:23:49 -0300 |
| commit | 23c9932afe9bbf01aa84d780e9030dfb6e333475 (patch) | |
| tree | 01f801fe4e9f286cc44eb8ad206ed4ab8585ab77 /src/pardes.zig | |
| parent | 1b2ac091200e9192f3677abe161217ba82463606 (diff) | |
| download | pardes-23c9932afe9bbf01aa84d780e9030dfb6e333475.tar.gz pardes-23c9932afe9bbf01aa84d780e9030dfb6e333475.zip | |
effects out, the theme crossfade: a theme change takes the chrome at once, as it always took the content; colors.ChromeAnimation (its OKLab steps, its retarget, the ticks and the frames it asked of nextWake) goes, Pardes.chrome is the theme's chrome, set as the theme changes, and the `animate` flag goes from loadThemeFile and applyThemeEffect with it, as does the build's -Dtheme-animation option (and its place in the wire's fingerprint); no frontend fades a theme of its own (a window crossfading every cell's colour for 160 ms is a copy of the last frame kept and blended, for one keystroke's change); the fade's tests go, the PDF test loses its ticks through a fade, and `core animation keeps wall time at 60, 120 and 144 Hz and across a stall` goes with the one animation that ran it; the perf baselines lose the option from their build identity; GUI goldens 16-debug and 17-terminal change, the golden session having faded its themes by default: a fade's frames kept the Debug word's announcement up in the picture's pane, which gave up a row to it under the Debug box; the tree before this change built with -Dtheme-animation=false 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/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 52 |
1 files changed, 4 insertions, 48 deletions
diff --git a/src/pardes.zig b/src/pardes.zig index 63f8b61a..8204915d 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -1065,7 +1065,6 @@ test "an empty column shows its theme's empty_col under its tag: acme's white, e tagline.exitHeader(p); inline for (.{ "acme", "dark" }) |name| { try std.testing.expect(p.executeBuiltinLine(0, "Theme " ++ name)); - p.chrome_animation.displayed = colors.ChromeTheme.fromTheme(p.theme()); p.sync(); var arena: std.heap.ArenaAllocator = .init(std.testing.allocator); defer arena.deinit(); @@ -3367,7 +3366,7 @@ pub const Pardes = struct { theme_file_loaded: config.Runtime.Text(limits.host_path_cap) = .{}, theme_file_generation: u32 = 0, theme_file_pane: u8 = 0, - chrome_animation: colors.ChromeAnimation = colors.ChromeAnimation.init(colors.initial_chrome), + chrome: colors.ChromeTheme = colors.initial_chrome, /// The focused cursor's quad on its springs (animation.CursorGlide), /// the pane and view origin it was last aimed in, and the last key or /// click, which a blink holds for. @@ -3385,7 +3384,6 @@ pub const Pardes = struct { /// cursor waits where it was drawn for the release that places it. cursor_held: bool = false, input_ns: u64 = 0, - animate_theme_changes: bool = false, native_images: bool = false, /// The shell can take a changed image a few rows at a time (a texture row /// upload, a shared-memory hand-off), so a PDF selection is repainted as @@ -3602,7 +3600,7 @@ pub const Pardes = struct { pub const replica = .{ .local = .{ // A frame, and the animations and timings that make it. - "surface", "frames", "chrome_animation", + "surface", "frames", "chrome", "cursor_glide", "cursor_view", "cursor_crossing", "cursor_held", "frame_arena", "scratch", "needs_frame", "present_skipped", "shell_continuous", "native_image_patches", "echo", @@ -5295,7 +5293,6 @@ pub const Pardes = struct { }, .tick => { mouse.edgeScroll(p); - p.chrome_animation.advance(); look.advanceLookHover(p); }, } @@ -6802,10 +6799,9 @@ pub const Pardes = struct { return &themes[p.settings.theme]; } - /// Displayed colors for anchored UI chrome. Unlike `theme()`, this may be - /// between themes while a live transition is active. + /// The colours of the chrome: the theme's, set as it changes. pub fn chromeTheme(p: *const Pardes) *const ChromeTheme { - return &p.chrome_animation.displayed; + return &p.chrome; } /// The theme's own chrome, not a fade's (`theme()`'s, worked out once @@ -6830,7 +6826,6 @@ pub const Pardes = struct { // the next frame (writes served before the shell's clock was first // seen are stamped 0, which `advance` would count back from). if (p.fs.batch.bytes.items.len > 0) return @max(next, p.fs.batch.last_ns + ctlfs.pane.batch_pause_ns); - if (p.chrome_animation.isActive()) return next; // Places still to find resume on the next frame; a picture being // decoded is looked for. for (p.panes) |slot| if (slot) |pane| if (pane.places.busy(pane)) return next; @@ -8066,45 +8061,6 @@ test "jump history terminal rectangle follows output and clears on reflow" { try std.testing.expectEqual(.none, pane.sel[0].state); } -test "core animation keeps wall time at 60, 120 and 144 Hz and across a stall" { - const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 }); - defer p.deinit(); - const frame = animation.frame_ns; - // Something that animates for as long as the test wants: the theme - // fade, held at its start before every step. - for ([_]u64{ 60, 120, 144 }) |hz| { - const start: u64 = 5 * std.time.ns_per_s; - p.clock_started = false; - p.advance(start); - var steps: u64 = 0; - var at: u64 = 1; - while (at <= hz) : (at += 1) { - const before = p.stepped_ns; - p.chrome_animation.step = 0; - p.advance(start + at * std.time.ns_per_s / hz); - const taken = (p.stepped_ns - before + frame / 2) / frame; - // Never two steps in one display frame: that is a visible hitch. - try std.testing.expect(taken <= 1); - steps += taken; - } - switch (hz) { - // One step a display frame, every display frame. - 60 => try std.testing.expectEqual(@as(u64, 60), steps), - 120 => try std.testing.expectEqual(@as(u64, 60), steps), - // The frame's own rate: 62 a second, give or take one. - else => try std.testing.expect(steps >= 61 and steps <= 63), - } - } - // A stall of minutes is not minutes of frames. - const before = p.stepped_ns; - p.chrome_animation.step = 0; - p.advance(before + 600 * std.time.ns_per_s); - try std.testing.expectEqual(before + 600 * std.time.ns_per_s, p.stepped_ns); - p.chrome_animation.step = animation.transition_steps; - p.advance(p.stepped_ns + frame); - try std.testing.expectEqual(@as(?u64, null), p.nextWake()); -} - test "a Save the host could not do logs no save record" { const th = @import("ninep/testing.zig"); const p = try th.withFile(std.testing.allocator, "x\n"); |
