From a28b37fb04566c36759edab0da7b1f98dffa6808 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 5 Nov 2026 11:09:06 -0300 Subject: effects out, Pet: src/gui/pet.zig, the Pet word and setting, the window's pet overlay (the triangle overlay holds the cursor's quad alone) and the DumpConfig `# Pet` line go; the root ctl reads LocationsConfig through DumpConfig's writer, so ctl.zig writes no settings line of its own; the Pet behaviour test goes, what it pinned besides the pet (a GUI-only builtin refused at a pane's exec in a terminal's view) now in the GUI-only settings test, with Fonts; the appearance gallery loses its pets Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/appearance_gallery.py | 31 ++----------------------------- test/behaviour/settings.zig | 28 ++-------------------------- 2 files changed, 4 insertions(+), 55 deletions(-) (limited to 'test') diff --git a/test/appearance_gallery.py b/test/appearance_gallery.py index 8672de71..0d3ab1fa 100644 --- a/test/appearance_gallery.py +++ b/test/appearance_gallery.py @@ -1,12 +1,10 @@ #!/usr/bin/env python3 -"""Review native palettes, compact tags, sized fonts and pets in an owned SDL session.""" +"""Review native palettes, compact tags and sized fonts in an owned SDL session.""" import argparse -import hashlib import json import os from pathlib import Path import subprocess -import time from fs import session from ui_review import capture, command, panes, require, wait_for @@ -29,9 +27,6 @@ Native palettes spectrum vivid syntax harvest warm earth clay soft rose and pine - -Pet cat / Pet frog / Pet off -Companions stay in unused workspace-tag space. ''' PREFERENCE_NOTES = b'''Pardes / contrast studies @@ -73,7 +68,7 @@ def run(args): if args.live_window: inherited = {'SDL_VIDEODRIVER': 'x11'} handles = {} - report = {'themes': [], 'pets': [], 'os_windows': []} + report = {'themes': [], 'os_windows': []} with session('/bin/sh', root, name, socket_name=name, tty=True, launch=launch, inherited=inherited, terminal=handles) as (client, _): source = next(serial for serial, tag in panes(client).items() if str(source_path) in tag) @@ -173,27 +168,6 @@ def run(args): report['native_themes_first'] = True client.write(f'/pane/{selector}/exec', b'Del\n') command(client, terminal, 'Collapse') - for pet in (() if args.skip_pets else ('cat', 'frog', 'off')): - command(client, right, 'Pet ' + pet) - settings = config_report() - require('Pet: ' + pet + '\n' in settings, 'pet setting not applied') - # Returning focus to the source closes all transient report state. - client.write(f'/pane/{source}/look', f'{source_path}:1\n'.encode()) - take_frame('pet-' + pet) - if pet != 'off': - frame = client.screen() - original_tag = frame['cells'][:frame['cols']] - time.sleep(1) - take_frame('pet-' + pet + '-later') - frame = client.screen() - require(original_tag == frame['cells'][:frame['cols']], 'pet animation changed tag text or styles') - def band_digest(label): - pixels = subprocess.check_output(['magick', str(root / (label + '.png')), - '-crop', '1500x20+0+0', '-depth', '8', 'RGB:-']) - return hashlib.sha256(pixels).hexdigest() - require(band_digest('pet-' + pet) != band_digest('pet-' + pet + '-later'), - 'pet did not animate in workspace tag') - report['pets'].append(pet) require(client.read(f'/pane/{source}/body') == original == source_path.read_bytes(), 'Agave source changed') report['source_unchanged'] = True client.write(f'/pane/{terminal}/pty/data', b'exit\r') @@ -208,6 +182,5 @@ if __name__ == '__main__': parser.add_argument('--project', required=True, type=Path) parser.add_argument('--live-window', action='store_true', help='capture the owned OS window without offscreen test mode') parser.add_argument('--themes', nargs='+', default=THEMES, help='themes to compare in order') - parser.add_argument('--skip-pets', action='store_true', help='review palettes without repeating pet animation tests') parser.add_argument('--theme-selector', action='store_true', help='capture native-first picker and focused source gutter') run(parser.parse_args()) diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig index 4b0245d2..76b60da4 100644 --- a/test/behaviour/settings.zig +++ b/test/behaviour/settings.zig @@ -43,30 +43,6 @@ test "settings: Shell refuses a path that is no executable, and bare it goes bac try std.testing.expectEqualStrings(default, try setting(&s, "Shell")); } -test "settings: Pet is the window's: a terminal's view refuses it, from a pane and the root; a window takes only its pets" { - var s = try Session.initFile(std.testing.allocator, "x\n"); - defer s.deinit(); - // Which build, from its options, not from the answer: a terminal's view - // taking Pet must fail here, not pass as a window. - if (comptime @import("pardes_config").platform == .gui) { - try s.write("/ctl", "Pet cat\n"); - // A window's: dog is no pet of its, and off is. - try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPet cat\n") != null); - _ = try s.refused("/ctl", "Pet dog\n"); - try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPet cat\n") != null); - try s.write("/ctl", "Pet frog\n"); - try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPet frog\n") != null); - try s.write("/ctl", "Pet off\n"); - try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPet off\n") != null); - return; - } - try std.testing.expectEqual(@as(u16, 22), try s.refused("/ctl", "Pet cat\n")); - try std.testing.expect(std.mem.startsWith(u8, s.said, "Pet is GUI-only, invalid here")); - try std.testing.expectEqual(@as(u16, 22), try s.refused(s.at("/pane/{d}/exec", .{try s.focused()}), "Pet cat\n")); - try std.testing.expectEqualStrings("Pet is GUI-only, invalid here", s.said); - try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "Pet ") == null); -} - fn expectHas(text: []const u8, part: []const u8) !void { if (std.mem.indexOf(u8, text, part) == null) { std.debug.print("not in it: {s}\n", .{part}); @@ -127,6 +103,8 @@ test "settings: a setting this frontend cannot show says GUI-only, never run as try std.testing.expectEqualStrings("Fonts is GUI-only, invalid here \"Fonts\"", s.said); try std.testing.expectEqual(@as(u16, 22), try s.refused("/exec", "Fonts\n")); try std.testing.expectEqualStrings("Fonts is GUI-only, invalid here", s.said); + try std.testing.expectEqual(@as(u16, 22), try s.refused(s.at("/pane/{d}/exec", .{try s.focused()}), "Fonts\n")); + try std.testing.expectEqualStrings("Fonts is GUI-only, invalid here", s.said); } _ = try s.refused("/ctl", "Liftt on\n"); try std.testing.expectEqualStrings("unknown control message \"Liftt\"", s.said); @@ -257,8 +235,6 @@ test "settings: every on/off setting the root ctl reads flips when its word is w const word, const was = .{ line[0..space], line[space + 1 ..] }; const on = std.mem.eql(u8, was, "on"); if (!on and !std.mem.eql(u8, was, "off")) continue; - // Pet's `off` says it has no pet; it takes a name, not a flip. - if (std.mem.eql(u8, word, "Pet")) continue; s.write("/ctl", s.at("{s}\n", .{word})) catch |err| { std.debug.print("a bare {s} (was {s}) was refused\n", .{ word, was }); return err; -- cgit v1.3