feat: add expandable compact queue and sidebar shortcut

This commit is contained in:
2026-10-22 18:11:13 +02:00
parent 6ed7db8167
commit 98e6dcb3c5
11 changed files with 330 additions and 39 deletions
+10 -5
View File
@@ -101,22 +101,24 @@ def check_queue_drag(root, app, fixtures):
def check_window_layout(root, app, fixtures):
result_path = root / "window-layout.json"
diagnostics = root / "window-layout.log"
compact_queue_only = os.environ.get("TEREBI_CHECK_COMPACT_QUEUE_ONLY") == "1"
extra = ["--compact-queue-only"] if compact_queue_only else []
result = subprocess.run(
["open", "-g", "-n", "-W", "--stderr", str(diagnostics), "-a", str(app),
str(fixtures / "cache.mp4"), "--args", "--no-config", "--check-window-layout", str(result_path)],
str(fixtures / "cache.mp4"), "--args", "--no-config", "--check-window-layout", str(result_path), *extra],
capture_output=True, text=True, timeout=40,
)
log = diagnostics.read_text(errors="replace") if diagnostics.exists() else ""
report = json.loads(result_path.read_text()) if result_path.exists() else {}
expected_animations = 0 if report.get("reduceMotion") else 16
expected_queue_animations = 0 if report.get("reduceMotion") else 9
if (result.returncode != 0 or not report.get("passed") or report.get("steps") != 36
expected_animations = 0 if report.get("reduceMotion") else (4 if compact_queue_only else 19)
expected_queue_animations = 0 if report.get("reduceMotion") else (4 if compact_queue_only else 13)
if (result.returncode != 0 or not report.get("passed") or report.get("steps") != 45
or report.get("animatedTransitions") != expected_animations
or report.get("animatedQueueTransitions") != expected_queue_animations):
raise RuntimeError(f"native window layout failed: {report}; {result.stdout}{result.stderr}{log}")
print(f"PASS native SwiftUI window layout: {report['animatedTransitions']} compact and "
f"{report['animatedQueueTransitions']} queue animations, stable video size, responsive reversals, "
"screen-edge fitting, fullscreen fixed bounds, minimum sizes and exact normal geometry restored")
"downward compact queue with native shortcut and painted content, minimum sizes and exact normal geometry restored")
def check_startup_errors(root, app):
config = root / "invalid-startup.toml"
@@ -781,6 +783,9 @@ with tempfile.TemporaryDirectory(prefix="terebi-startup-") as directory:
descriptor = os.open(pipe, os.O_RDONLY | os.O_NONBLOCK)
launch = None
try:
if os.environ.get("TEREBI_CHECK_COMPACT_QUEUE_ONLY") == "1":
check_window_layout(root, app, fixtures)
sys.exit(0)
if os.environ.get("TEREBI_CHECK_QUEUE_ADD_ONLY") == "1":
check_queue_add(root, app, fixtures)
sys.exit(0)