summaryrefslogtreecommitdiff
path: root/test/web-snapshots
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-10 17:32:43 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commit685b8c8e74c9edbdf701594f50ff1b70ac288ec9 (patch)
treef303bd5e1f422030c2c645ea2d6c3a393990fb5e /test/web-snapshots
parentddc2eefb1e7cdd402593efb1297c25fc7ae4b110 (diff)
downloadpardes-685b8c8e74c9edbdf701594f50ff1b70ac288ec9.tar.gz
pardes-685b8c8e74c9edbdf701594f50ff1b70ac288ec9.zip
web snapshots: add switch for saving/loading exports, update web version, web snapshot tooling
Diffstat (limited to 'test/web-snapshots')
-rw-r--r--test/web-snapshots/README.md18
-rw-r--r--test/web-snapshots/source-list.dump.zon26
-rw-r--r--test/web-snapshots/source-list.golden190
-rw-r--r--test/web-snapshots/source-list.snap29
4 files changed, 263 insertions, 0 deletions
diff --git a/test/web-snapshots/README.md b/test/web-snapshots/README.md
new file mode 100644
index 00000000..d2ea84f8
--- /dev/null
+++ b/test/web-snapshots/README.md
@@ -0,0 +1,18 @@
+# Web browser snapshots
+
+`source-list.dump.zon` is a byte-for-byte dump from a running Pardes instance.
+It is not assembled or normalized by a fixture generator.
+
+To recapture it:
+
+1. Build and launch the native TTY in this checkout with `PARDES_DUMP` pointing
+ at a temporary file.
+2. Enter TTY mode, run `clear`, then run `git ls-files '*.zig'`.
+3. Leave the pane in TTY mode and middle-click Pardes's `Dump` builtin.
+4. Copy the resulting dump into `source-list.dump.zon` without editing it.
+
+The visible `.body` must exactly match the command plus every path reported by
+Git (and the final prompt). The base64 PTY stream must contain the command
+itself. `source-list.snap` then drives that dump through Chromium: it checks the
+full listing, taps `build.zig`, snapshots tree-sitter style runs, resizes the
+pane separator, and finally verifies body scrolling.
diff --git a/test/web-snapshots/source-list.dump.zon b/test/web-snapshots/source-list.dump.zon
new file mode 100644
index 00000000..02e1eb43
--- /dev/null
+++ b/test/web-snapshots/source-list.dump.zon
@@ -0,0 +1,26 @@
+.{
+ .magic = "pardes-dump",
+ .version = 1,
+ .screen = .{ .cols = 100, .rows = 30 },
+ .active = 0,
+ .topbar = "Kill Newcol Tutor Debug Colors NextColor Crt Dump",
+ .theme = "dark",
+ .columns = .{.{ .weight = 1, .panes = .{0} }},
+ .panes = .{.{
+ .kind = .terminal,
+ .tag = "TTY /home/goblin/00-projects/0x4200.cafe/02-pardes-code Del",
+ .body = "$ git ls-files '*.zig'\nbuild.zig\nsrc/crt.zig\nsrc/deck.zig\nsrc/dump.zig\nsrc/gui.zig\nsrc/image.zig\nsrc/look.zig\nsrc/main.zig\nsrc/modal.zig\nsrc/pardes.zig\nsrc/petscii.zig\nsrc/syntax.zig\nsrc/tracy.zig\nsrc/tty.zig\ntest/deck/replay.zig\ntest/deck/schema.zig\ntest/e2e_harness.zig\ntest/hxdiff.zig\ntest/snapshot.zig\nuucode_config.zig\n$ \n\n\n\n\n\n",
+ .scroll = 0,
+ .cols = 98,
+ .rows = 28,
+ .vweight = 1,
+ .terminal = .{
+ .cwd = "/home/goblin/00-projects/0x4200.cafe/02-pardes-code",
+ .stream = "$ git ls-files '*.zig'\nbuild.zig\nsrc/crt.zig\nsrc/deck.zig\nsrc/dump.zig\nsrc/gui.zig\nsrc/image.zig\nsrc/look.zig\nsrc/main.zig\nsrc/modal.zig\nsrc/pardes.zig\nsrc/petscii.zig\nsrc/syntax.zig\nsrc/tracy.zig\nsrc/tty.zig\ntest/deck/replay.zig\ntest/deck/schema.zig\ntest/e2e_harness.zig\ntest/hxdiff.zig\ntest/snapshot.zig\nuucode_config.zig\n$ ",
+ .stream_b64 = "G10xMzM7QwcbXTEzMztEBxtdMTMzO0MHG10wO2dvYmxpbkBwYXJkZXM6L2hvbWUvZ29ibGluLzAwLXByb2plY3RzLzB4NDIwMC5jYWZlLzAyLXBhcmRlcy1jb2RlBxtbPzIwMDRoG10xMzM7QTtjbD1saW5lByQgG10xMzM7QgcNG1tLDRtdMTMzO0E7Y2w9bGluZ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dC9lMmVfaGFybmVzcy56aWcNCnRlc3QvaHhkaWZmLnppZw0KdGVzdC9zbmFwc2hvdC56aWcNCnV1Y29kZV9jb25maWcuemlnDQobXTEzMztDBxtdMTMzO0QHG10xMzM7QwcbXTA7Z29ibGluQHBhcmRlczovaG9tZS9nb2JsaW4vMDAtcHJvamVjdHMvMHg0MjAwLmNhZmUvMDItcGFyZGVzLWNvZGUHG1s/MjAwNGgbXTEzMztBO2NsPWxpbmUHJCAbXTEzMztCBw==",
+ .cursor = .{ .col = 2, .row = 21 },
+ },
+ .file = null,
+ .image = null,
+ }},
+} \ No newline at end of file
diff --git a/test/web-snapshots/source-list.golden b/test/web-snapshots/source-list.golden
new file mode 100644
index 00000000..d4321fbb
--- /dev/null
+++ b/test/web-snapshots/source-list.golden
@@ -0,0 +1,190 @@
+== snap launcher grid=120x37 cursor=4,23
+|Kill Newcol Tutor Debug Colors NextColor Crt Dump
+| TTY /home/goblin/00-projects/0x4200.cafe/02-pardes-code Del
+| $ git ls-files '*.zig'
+| build.zig
+| src/crt.zig
+| src/deck.zig
+| src/dump.zig
+| src/gui.zig
+| src/image.zig
+| src/look.zig
+| src/main.zig
+| src/modal.zig
+| src/pardes.zig
+| src/petscii.zig
+| src/syntax.zig
+| src/tracy.zig
+| src/tty.zig
+| test/deck/replay.zig
+| test/deck/schema.zig
+| test/e2e_harness.zig
+| test/hxdiff.zig
+| test/snapshot.zig
+| uucode_config.zig
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== snap source-open grid=120x37 cursor=7,25
+|Kill Newcol Tutor Debug Colors NextColor Crt Dump
+| TTY /home/goblin/00-projects/0x4200.cafe/02-pardes-code Del
+| $ git ls-files '*.zig'
+| build.zig
+| src/crt.zig
+| src/deck.zig
+| src/dump.zig
+| src/gui.zig
+| src/image.zig
+| src/look.zig
+| src/main.zig
+| src/modal.zig
+| src/pardes.zig
+| src/petscii.zig
+| src/syntax.zig
+| src/tracy.zig
+| src/tty.zig
+| test/deck/replay.zig
+| test/deck/schema.zig
+| test/e2e_harness.zig
+| test/hxdiff.zig
+| test/snapshot.zig
+| uucode_config.zig
+|
+| NOR build.zig Save Del
+| 1 const std = @import("std");
+| 2
+| 3 pub const Platform = enum { tty, gui, web };
+| 4 pub const TreeSitterGrammars = enum { disabled, zig, minimal, full };
+| 5 const GhosttyArtifact = enum { ghostty, lib };
+| 6
+| 7 pub fn build(b: *std.Build) void {
+| 8 // Default target is the Steam Deck (deckcap's trick): x86_64 linux-gnu
+| 9 // with the glibc version pinned low, so a binary built on a rolling-
+| 10 // release host runs on SteamOS — a native build references the host's
+| 11 // newer versioned libm/libc symbols and dies with "GLIBC_2.4x not found"
+| 12 // on the deck. Override with -Dtarget= as usual.
+== style source-open
+|0: 0-48 #969696,#2c2a3e, 49-119 d,#2c2a3e,
+|1: 0-1 d,#383c54, 2-60 #969696,#2c2a3e, 61-119 d,#2c2a3e,
+|2: 0-1 d,#525252, 2-119 d,d,
+|3: 0-1 d,#525252, 2-119 d,d,
+|4: 0-1 d,#525252, 2-119 d,d,
+|5: 0-1 d,#525252, 2-119 d,d,
+|6: 0-1 d,#525252, 2-119 d,d,
+|7: 0-1 d,#525252, 2-119 d,d,
+|8: 0-1 d,#525252, 2-119 d,d,
+|9: 0-1 d,#525252, 2-119 d,d,
+|10: 0-1 d,#525252, 2-119 d,d,
+|11: 0-1 d,#525252, 2-119 d,d,
+|12: 0-1 d,#525252, 2-119 d,d,
+|13: 0-1 d,#525252, 2-119 d,d,
+|14: 0-1 d,#525252, 2-119 d,d,
+|15: 0-1 d,#525252, 2-119 d,d,
+|16: 0-1 d,#525252, 2-119 d,d,
+|17: 0-1 d,#525252, 2-119 d,d,
+|18: 0-1 d,#525252, 2-119 d,d,
+|19: 0-1 d,#525252, 2-119 d,d,
+|20: 0-1 d,#525252, 2-119 d,d,
+|21: 0-1 d,#525252, 2-119 d,d,
+|22: 0-1 d,#525252, 2-119 d,d,
+|23: 0-1 d,#525252, 2-119 d,d,
+|24: 0-1 d,#6e4fd0, 2-23 #969696,#2c2a3e, 24-119 d,#2c2a3e,
+|25: 0-1 d,#525252, 2-6 #969696,#2c2a3e, 7-18 d,d, 19-25 #cc70d8,d,b 26-26 d,d, 27-31 #8ab87a,d, 32-119 d,d,
+|26: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-119 d,d,
+|27: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-27 d,d, 28-31 #cc70d8,d,b 32-119 d,d,
+|28: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-37 d,d, 38-41 #cc70d8,d,b 42-119 d,d,
+|29: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-30 d,d, 31-34 #cc70d8,d,b 35-119 d,d,
+|30: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-119 d,d,
+|31: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-10 d,d, 11-12 #cc70d8,d,b 13-119 d,d,
+|32: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-10 d,d, 11-81 #f0f0f0,d,b 82-119 d,d,
+|33: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-10 d,d, 11-79 #f0f0f0,d,b 80-119 d,d,
+|34: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-10 d,d, 11-80 #f0f0f0,d,b 81-119 d,d,
+|35: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-10 d,d, 11-83 #f0f0f0,d,b 84-119 d,d,
+|36: 0-1 d,#2a2a2a, 2-6 #5a5a5a,d, 7-10 d,d, 11-59 #f0f0f0,d,b 60-119 d,d,
+== snap separator-resized grid=120x37 cursor=7,21
+|Kill Newcol Tutor Debug Colors NextColor Crt Dump
+| TTY /home/goblin/00-projects/0x4200.cafe/02-pardes-code Del
+| src/dump.zig
+| src/gui.zig
+| src/image.zig
+| src/look.zig
+| src/main.zig
+| src/modal.zig
+| src/pardes.zig
+| src/petscii.zig
+| src/syntax.zig
+| src/tracy.zig
+| src/tty.zig
+| test/deck/replay.zig
+| test/deck/schema.zig
+| test/e2e_harness.zig
+| test/hxdiff.zig
+| test/snapshot.zig
+| uucode_config.zig
+|╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
+| NOR build.zig Save Del
+| 1 const std = @import("std");
+| 2
+| 3 pub const Platform = enum { tty, gui, web };
+| 4 pub const TreeSitterGrammars = enum { disabled, zig, minimal, full };
+| 5 const GhosttyArtifact = enum { ghostty, lib };
+| 6
+| 7 pub fn build(b: *std.Build) void {
+| 8 // Default target is the Steam Deck (deckcap's trick): x86_64 linux-gnu
+| 9 // with the glibc version pinned low, so a binary built on a rolling-
+| 10 // release host runs on SteamOS — a native build references the host's
+| 11 // newer versioned libm/libc symbols and dies with "GLIBC_2.4x not found"
+| 12 // on the deck. Override with -Dtarget= as usual.
+| 13 const target = b.standardTargetOptions(.{ .default_target = .{
+| 14 .cpu_arch = .x86_64,
+| 15 .os_tag = .linux,
+| 16 .abi = .gnu,
+== snap source-scrolled grid=120x37 cursor=0,0
+|Kill Newcol Tutor Debug Colors NextColor Crt Dump
+| TTY /home/goblin/00-projects/0x4200.cafe/02-pardes-code Del
+| src/dump.zig
+| src/gui.zig
+| src/image.zig
+| src/look.zig
+| src/main.zig
+| src/modal.zig
+| src/pardes.zig
+| src/petscii.zig
+| src/syntax.zig
+| src/tracy.zig
+| src/tty.zig
+| test/deck/replay.zig
+| test/deck/schema.zig
+| test/e2e_harness.zig
+| test/hxdiff.zig
+| test/snapshot.zig
+| uucode_config.zig
+|
+| NOR build.zig Save Del
+| 10 // release host runs on SteamOS — a native build references the host's
+| 11 // newer versioned libm/libc symbols and dies with "GLIBC_2.4x not found"
+| 12 // on the deck. Override with -Dtarget= as usual.
+| 13 const target = b.standardTargetOptions(.{ .default_target = .{
+| 14 .cpu_arch = .x86_64,
+| 15 .os_tag = .linux,
+| 16 .abi = .gnu,
+| 17 .glibc_version = .{ .major = 2, .minor = 38, .patch = 0 },
+| 18 } });
+| 19 const requested_optimize = b.standardOptimizeOption(.{});
+| 20 const platform = b.option(Platform, "platform", "which shell to build (tty, gui, web)") orelse .tty;
+| 21 const static = b.option(bool, "static", "statically link") orelse false;
+| 22 const dump_path = b.option([]const u8, "dump", "dump .zon embedded into the web shell (-Dplatform=web)");
+| 23 const emcc_path = b.option([]const u8, "emcc", "emcc for the web shell's final link") orelse "/usr/lib/emscri
+| 24 const is_emscripten = target.result.os.tag == .emscripten;
+| 25 // wasm: size is the budget
diff --git a/test/web-snapshots/source-list.snap b/test/web-snapshots/source-list.snap
new file mode 100644
index 00000000..b1a0a79a
--- /dev/null
+++ b/test/web-snapshots/source-list.snap
@@ -0,0 +1,29 @@
+# Browser-only .snap commands. The page is built from a dump made by a real
+# Pardes TTY after running `git ls-files '*.zig'`; touch events below are
+# injected through Chrome's real browser input path.
+wait 10000 uucode_config.zig
+stable 100 5000
+snap launcher
+
+# A little sub-slop movement is still a tap. On web one-finger taps are LOOK,
+# so this opens build.zig from the archive generated from Git-tracked sources.
+touch down 1 5 3
+touch move 1 5.2 3.1
+touch up 1 5.2 3.1
+wait 10000 build.zig Save Del
+stable 100 5000
+snap source-open
+snapstyle source-open
+
+# A touch that begins on the horizontal pane separator is a latched left-mouse
+# resize gesture. Crossing the body-scroll threshold must never turn it into a
+# wheel gesture.
+swipe 2 60 23 60 19 8
+stable 100 5000
+snap separator-resized
+
+# Travel well outside the tap slop becomes natural one-finger scrolling and
+# must not also click/LOOK at the release point.
+swipe 3 60 34 60 27 12
+stable 100 5000
+snap source-scrolled