summaryrefslogtreecommitdiff
path: root/test/appearance_gallery.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 12:35:31 -0300
committerGabriel Schneider <[email protected]>2026-11-05 15:18:26 -0300
commite65ada6bfab3e3851281be253b5e8187b652b66b (patch)
tree8eda0b933dd1c1c0e1310963b1be0000d01281e7 /test/appearance_gallery.py
parentba3c654472ee0dd9fb5d39dd24063c07a44c6752 (diff)
downloadpardes-e65ada6bfab3e3851281be253b5e8187b652b66b.tar.gz
pardes-e65ada6bfab3e3851281be253b5e8187b652b66b.zip
the Pet back, the window's alone: src/gui/pet.zig and the window's pet overlay return as they were (the workspace tag's blank end, the tag's colours, now read from the Surface's chrome, its walk and hop on the window's own clock, SDL_GetTicks), and Pet is a plain setting now, a choice of off, cat or frog the window reads (config.Runtime.pet, a byte with no state behind it, dumped and replicated as any setting, in /ctl and DumpConfig as `Pet <name>`, and as `# Pet unsupported` where no window draws it, so an init file shared with a terminal loads there clean); its behaviour test and the appearance gallery's pets return
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/appearance_gallery.py')
-rw-r--r--test/appearance_gallery.py31
1 files changed, 29 insertions, 2 deletions
diff --git a/test/appearance_gallery.py b/test/appearance_gallery.py
index 0d3ab1fa..636c0f69 100644
--- a/test/appearance_gallery.py
+++ b/test/appearance_gallery.py
@@ -1,10 +1,12 @@
#!/usr/bin/env python3
-"""Review native palettes, compact tags and sized fonts in an owned SDL session."""
+"""Review native palettes, compact tags, sized fonts and pets 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
@@ -27,6 +29,9 @@ 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
@@ -68,7 +73,7 @@ def run(args):
if args.live_window:
inherited = {'SDL_VIDEODRIVER': 'x11'}
handles = {}
- report = {'themes': [], 'os_windows': []}
+ report = {'themes': [], 'pets': [], '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)
@@ -168,6 +173,27 @@ 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('\nPet ' + 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')
@@ -182,5 +208,6 @@ 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())