Kaleido/scripts/verify_details_layout.py
Elijah 4780bdcdb2 Remove volume boost, honour server-stopped streams, drop the Library genre filter
Work already pending in the tree before the bug-fix pass, committed on its own:
- Remove Volume boost (it degraded audio) and its setting; keep passthrough.
- Leave playback with the server's reason when Plex stops a session
  (timeline terminationCode/terminationText); never fall back or reconnect after.
- Genre filtering lives in Categories; the Library grid lists the whole section.
- Update UI verification scripts and AGENTS.md accordingly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 22:52:52 -07:00

48 lines
3.1 KiB
Python

"""Check a fresh show page keeps its Back control and description in the safe area."""
import re
from device import screenshot
from verify_ui import launch,key,focused,wait,focus,labels,snapshot
launch();key(22,2);focused('TV Shows');key(20);focused('Discover');key(22);focused('Library');key(23)
wait(lambda r:any(x.startswith('Unwatched') for x in labels(r)),'Show library loaded');focused('Library');key(20)
# The genre/sort filters sit between the section tabs and the grid.
if focus(snapshot()).startswith('Unwatched'):key(20)
# The grid is entered beneath the filter that held focus; walk back to the first column.
for _ in range(6):
if '3 Body Problem' in focus(snapshot()):break
key(21)
focused('3 Body Problem');key(23);focused('Watch next')
root=snapshot();screenshot('show-layout-current')
title=next(n for n in root.iter('node') if '3 Body Problem' in (n.get('text'),n.get('content-desc')))
bounds=list(map(int,re.findall(r'\d+',title.get('bounds'))))
back=next((n for n in root.iter('node') if n.get('content-desc')=='Back'),None)
print('Title bounds:',bounds,'Back visible:',back is not None,flush=True)
assert bounds[1]>=88,'Show title was scrolled above the safe header area on initial focus'
assert back is not None,'Back control must remain visible on initial show entry'
back_bounds=list(map(int,re.findall(r'\d+',back.get('bounds'))))
assert back_bounds[1]>=0 and back_bounds[3]>back_bounds[1],'Back control must stay inside the visible header'
assert 'Seasons' in labels(root),'Seasons must lead the rows beneath show information'
screen=list(map(int,re.findall(r'\d+',root.find('node').get('bounds'))))
captions=[n for n in root.iter('node') if re.fullmatch(r'Season \d+',n.get('text',''))]
assert captions,'Season captions must be visible without scrolling'
for caption in captions:
box=list(map(int,re.findall(r'\d+',caption.get('bounds'))))
assert box[3]<=screen[3]-24,'Season caption must fit inside the bottom safe area'
summary=max((n for n in root.iter('node') if len(n.get('text',''))>120),key=lambda n:len(n.get('text')))
summary_bounds=list(map(int,re.findall(r'\d+',summary.get('bounds'))))
assert summary_bounds[2]-summary_bounds[0]<=screen[2]*560/960+2,'Show synopsis must use the bounded movie-detail text width'
print('PASS safe show header, bounded synopsis, and complete season captions on initial entry')
# Trailer and other actions depend on the fixture; move right until Synopsis.
for _ in range(5):
if 'Synopsis' in focus(snapshot()):break
key(22)
focused('Synopsis');key(23);focused('Close')
dialog=snapshot();screenshot('show-full-synopsis')
assert summary.get('text') in labels(dialog),'Full synopsis must remain available in the dialog'
key(20);key(19);focused('Close');key(23);focused('Synopsis')
key(23);focused('Close');key(4);focused('Synopsis')
print('PASS full synopsis opens, scrolls, and restores focus after Close or Back')
key(20);focused('Season 1');key(20)
wait(lambda r:'Cast' in labels(r) and bool(focus(r)) and 'Season 1' not in focus(r),'Cast focus beneath Seasons')
screenshot('show-scrolled-cast')
print('PASS Seasons-to-Cast navigation; captured scrolled backdrop for visual review')