summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 13:18:42 -0300
committerGabriel Schneider <[email protected]>2026-11-06 13:40:37 -0300
commit9991a90aae7f4591e63e5ecb0ab2467a348ed54e (patch)
tree18857cd6939d331e477d6d6651a930939fae9f26 /src
parente0ed81fc02b7fcf9f20f9be1c0080bd1339d80fb (diff)
downloadpardes-9991a90aae7f4591e63e5ecb0ab2467a348ed54e.tar.gz
pardes-9991a90aae7f4591e63e5ecb0ab2467a348ed54e.zip
kinds #22, a kind's frame as its tick left it: a step that ticks a kind paints it once for the live view (Kind.repaint) before its tag is laid out, where the tag took what the frame before the tick placed and the next input's step another (a replica's guess of that input, the last step's tag, missed: 13 of the 30 ms cell's 14 visible rollbacks), so a pane of a kind's tag has its art words from its first step (the fake and pdf addon scripts' windows a row shorter), and an input's step sends each client what it made of a kind's pane after its unit, not at the next pump (a terminal client looked at the frame from before its own key's tick, the text layer missing from its view)
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src')
-rw-r--r--src/Kind.zig21
-rw-r--r--src/replica.zig4
2 files changed, 25 insertions, 0 deletions
diff --git a/src/Kind.zig b/src/Kind.zig
index de5323bb..66e37852 100644
--- a/src/Kind.zig
+++ b/src/Kind.zig
@@ -629,9 +629,30 @@ pub fn step(p: *Pardes) void {
if (slot.ops) |o| cl.ret = @bitCast(o.tick.?(slot.st, now, flags));
slot.next_tick = @bitCast(cl.end(prev).ret);
p.needs_frame = true;
+ repaint(p, slot, id);
};
}
+/// Its prefix and whether it places a picture as its tick left it, for
+/// this step's tag: a frame's paint set them, a step behind the tick (a
+/// PDF to its text layer, or back), and a replica guessing its next input
+/// took the tag this step laid out. The live view's frame of it, painted
+/// and let go; not a frame drawn (`painted` kept).
+fn repaint(p: *Pardes, slot: *Slot, id: usize) void {
+ const pane = p.panes[id] orelse return;
+ if (slot.ops == null or pane.collapsed) return;
+ const r = p.view().rects[id];
+ const cols = r.w -| pardes.config.GUTTER;
+ const rows = (r.h -| pane.tag_rows) -| pane.notices.span();
+ if (cols == 0 or rows == 0) return;
+ const drawn = slot.painted;
+ defer slot.painted = drawn;
+ var arena: std.heap.ArenaAllocator = .init(slot.gpa);
+ defer arena.deinit();
+ var frame: Frame = .{ .cols = cols, .rows = rows };
+ _ = paint(p, slot, id, arena.allocator(), cols, rows, &frame);
+}
+
/// Whether `step` would tick some pane of a kind now (its rule, read only).
fn wouldTick(p: *const Pardes, now: u64) bool {
for (p.panes, 0..) |pslot, id| if (pslot) |pane| if (pane.addon) |slot| {
diff --git a/src/replica.zig b/src/replica.zig
index c5e3fd34..e3deff40 100644
--- a/src/replica.zig
+++ b/src/replica.zig
@@ -1911,6 +1911,10 @@ pub const Peers = struct {
ps.t.stamp = null;
ps.screensOut(core, .fill);
ps.unit(peer.id, in.seq);
+ // What the step made of a kind's pane (its tick: another layout,
+ // the text layer) goes now, not at the next pump's: one may not
+ // come before the client looks.
+ ps.screensOut(core, .flush);
}
const ScreensOut = enum { flush, fill };