From 3488111273764c17a42870484fabc36abb0634a1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 13:56:13 -0300 Subject: effects out, the core's motion: the view's glide is the frontends' alone, and the core keeps no motion and no clock but its deadlines; glide.zig is a frontend's picture of a scroll, measured on the frame it is about to draw against the last it drew (a body's first line and the text it shows in its region, Region.doc new; the last frame's cells kept by the glide itself), on the frontend's own clock, the tty drawing it at whole rows and the window at the pixel; each frontend draws its own motions' frames from the last frame (the tty's poll presents it again, the window's loop renders it again, as its blink did) and paces its own waits, so the core's continuous path goes (Pardes.continuous and shell_continuous, the pump's one-millisecond wait, the view's drawn fields, the tape's watch of it); the Motion word and its five flavours go (the glide and the caret move at the default's pace, and no switch for reduced motion is left), and animation.zig with them (Motion and Spring gone, Follow now glide.zig's with its test, CursorGlide gone with the core's caret, Blink the window's with its test, Box and layout.panelBox gone, the frame's length now Pardes.frame_ns); a PDF strip no longer glides, its scroll landing at once (its follow, stripAt's motion and Pdf.moving go); the window's glide tests are fed frame by frame as the window feeds them; the window monkey runs by seed, not by flavour, and the 9P monkey loses Motion; the tty wakes a frame at a time while its glide or trail moves, as the core's continuous path woke it; all 109 snapshot goldens and the 16 GUI goldens unchanged; tests gone: a carried spring keeps its speed; a spring settles without overshoot; each flavour is its own motion; a cursor eases a cell at a time (animation.zig's); a PDF strip glides a notch and a page to their marks; a PDF glide renders the pages it crosses Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/draw.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/draw.zig') diff --git a/src/draw.zig b/src/draw.zig index fe4921ff..75d6378b 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -7,7 +7,6 @@ const std = @import("std"); const vaxis = @import("vaxis"); const pardes = @import("pardes.zig"); const layout = @import("layout.zig"); -const animation = @import("animation.zig"); const config = @import("config.zig"); const panes = @import("panes.zig"); const modal = @import("modal.zig"); @@ -61,7 +60,11 @@ pub fn place(p: *Pardes, s: *Surface) void { if (pane.collapsed) continue; const body_h = r.h -| pane.tag_rows; const line: i32 = if (pane.file) |f| @intCast(@min(f.scroll, std.math.maxInt(i32))) else if (pane.isTerminal()) panes.terminal.gridOffset(pane) else 0; - s.addRegion(.{ .kind = .body, .owner = owner, .serial = pane.serial, .active = active, .line = line, .rect = .{ .x = r.x + config.GUTTER, .y = body_y, .w = r.w - config.GUTTER, .h = body_h } }); + // The text it shows, for a frontend's glide to tell apart: a file's + // path, a generated text's revision with it (rows rewritten as its + // view moved are another text's); none for a terminal or a picture. + const doc: u64 = if (pane.file) |f| std.hash.Wyhash.hash(if (f.output != null) f.revision else 0, f.path) else 0; + s.addRegion(.{ .kind = .body, .owner = owner, .serial = pane.serial, .active = active, .line = line, .doc = doc, .rect = .{ .x = r.x + config.GUTTER, .y = body_y, .w = r.w - config.GUTTER, .h = body_h } }); var rail: Region = .{ .kind = .rail, .owner = owner, .serial = pane.serial, .active = active, .rect = .{ .x = r.x, .y = body_y, .w = config.GUTTER, .h = body_h } }; // An image's rail has no thumb; a native PDF's is measured as its // pages are placed (Pdf.draw); every other pane's is here. -- cgit v1.3