diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 11:50:43 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 15:17:05 -0300 |
| commit | ecdb0996147f319a4427273bf276e1fc5bf89156 (patch) | |
| tree | 0b1be457ce4b8ce99db4acd713ff2620cde2d015 /src/look.zig | |
| parent | 2bd4066a932ec8fc401e4b85e9f8441b17df3cfb (diff) | |
| download | pardes-ecdb0996147f319a4427273bf276e1fc5bf89156.tar.gz pardes-ecdb0996147f319a4427273bf276e1fc5bf89156.zip | |
effects out, the panel transitions: the eleven Panel words in both tracks go, with the core's Presentation (tracks, the frozen previous grid, cell diffs, the acknowledged-geometry pending guard, and the pointer's mapping through a moving pane, so a pointer's cell is the cell it is over), draw.zig's core-composed character effects, animation.zig's transition half, the Surface's tracks and previous grid, the tty's compositor (src/tui/panel_compositor.zig: the glide's rows move into tui.zig) and the window's track groups, frozen old layers, last-frame image snapshot, transition instance fields and shader paths (ui.vert, ui.frag's crossfade, image.vert and image.frag, the transition-<n>.ppm capture); acknowledgePanelPresentation becomes `presented`, which a frontend calls after drawing a frame (a drag's moving end and a look-hover follow what is under the pointer now), and its tape site with it; the pointer tape site goes; GUI golden 18-mid-transition goes, ttyhelp's golden loses the `SPC a` rows (its wait is on `SPC Y` now), the window monkey loses PanelSlide, and the settings behaviour test's floor of on/off words is ten
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/look.zig')
| -rw-r--r-- | src/look.zig | 69 |
1 files changed, 3 insertions, 66 deletions
diff --git a/src/look.zig b/src/look.zig index 634310f1..0574985b 100644 --- a/src/look.zig +++ b/src/look.zig @@ -8,7 +8,6 @@ const pdf_enabled = @import("pardes_config").mupdf; const diff = @import("diff.zig"); const platform_has_fs = filesystem.platform_has_fs; const layout = @import("layout.zig"); -const animation = @import("animation.zig"); const modal = @import("modal.zig"); const tagline = @import("tagline.zig"); const filesystem = @import("fs.zig"); @@ -937,8 +936,7 @@ fn noteLookHover(p: *Pardes, col: u16, row: u16, body_hit: ?Mouse.BodyHit, tag_h pub fn refreshLookHoverFromRaw(p: *Pardes) void { if (!p.pointer_inside or !p.raw_hover_intent) return; - const mapped = p.pointerCell(p.pointer_raw_col, p.pointer_raw_row) orelse - return cancelLookHover(p); + const mapped: struct { col: u16, row: u16 } = .{ .col = p.pointer_raw_col, .row = p.pointer_raw_row }; p.hover_col = mapped.col; p.hover_row = mapped.row; const body_hit: ?Mouse.BodyHit = if (p.pointer_body_hit) |mapped_hit| @@ -2009,7 +2007,7 @@ test "Look hover waits without mutating the pane and input cancels it" { try std.testing.expect(p.look_hover_preview == null); // The following host repaint must not resurrect a hover after keyboard // input cancelled its raw-pointer intent. - p.acknowledgePanelPresentation(&.{}); + p.presented(); try std.testing.expect(p.look_hover_wait == null); } @@ -2037,67 +2035,6 @@ test "cwd changes cancel only the affected pane's Look hover" { try std.testing.expect(p.look_hover_preview == null); } -test "stationary Look hover follows only acknowledged panel samples" { - const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 20, .tty_only = true }); - defer p.deinit(); - const pane = p.panes[0].?; - const rect = p.rects[0]; - const target: animation.Box = .{ - .x = @floatFromInt(rect.x), - .y = @floatFromInt(rect.y), - .w = @floatFromInt(rect.w), - .h = @floatFromInt(rect.h), - }; - var track: animation.Track = .{ - .serial = pane.serial, - .pane = 0, - .phase = .moving, - .effect = .slide, - .from = .{ .x = 20, .y = 5, .w = 40, .h = 10 }, - .to = target, - }; - p.acknowledgePanelPresentation(&.{track}); - p.update(.{ .mouse = .{ .button = .none, .kind = .motion, .col = 30, .row = 8 } }); - const first = p.look_hover_wait orelse return error.MissingInitialHoverWait; - - // Advancing the producer-side track alone cannot move the semantic cell - // under a stationary pointer. - track.frame = track.effect.frames() - 1; - p.presentation.tracks[0] = track; - refreshLookHoverFromRaw(p); - try std.testing.expectEqual(first, p.look_hover_wait.?); - - // Once that exact sample is acknowledged, the same raw cell maps through - // the new panel rectangle and the debounce starts over for the new target. - p.acknowledgePanelPresentation(&.{track}); - const moved = p.look_hover_wait orelse return error.MissingRemappedHoverWait; - try std.testing.expect(first.col != moved.col or first.row != moved.row); - try std.testing.expectEqual(@as(u16, 0), moved.frames); - - // Re-acknowledging the same semantic target is host repaint noise, not a - // new hover, so it preserves the accumulated delay. - p.look_hover_wait.?.frames = 3; - p.acknowledgePanelPresentation(&.{track}); - try std.testing.expectEqual(@as(u16, 3), p.look_hover_wait.?.frames); - - // A zero-sized opening sample covers its future target but exposes no - // clickable content. Successful presentation therefore cancels the hover. - track.phase = .opening; - track.effect = .zoom; - track.frame = 0; - track.from = .{ - .x = target.x + target.w * 0.5, - .y = target.y + target.h * 0.5, - }; - p.acknowledgePanelPresentation(&.{track}); - try std.testing.expect(p.look_hover_wait == null); - try std.testing.expect(p.look_hover_preview == null); - - track.frame = track.effect.frames() - 1; - p.acknowledgePanelPresentation(&.{track}); - try std.testing.expect(p.look_hover_wait != null); -} - test "Look copies its operand before releasing pointer selection storage" { const p = try Pardes.init(std.testing.allocator, .{ .cols = 60, .rows = 12 }); defer p.deinit(); @@ -2153,7 +2090,7 @@ test "a pointer resting where a look-hover found nothing does not wake the core while (p.nextWake() != null and frames < 20) : (frames += 1) { p.update(.tick); // What a shell's present does after every frame. - p.acknowledgePanelPresentation(&.{}); + p.presented(); } try std.testing.expect(frames < 20); try std.testing.expect(p.look_hover_wait == null and p.look_hover_preview == null); |
