Double the assistant dot, and stop the checks measuring it against itself
26 → 52px, 14 → 28px for the sparkle. The audit page draws 26 ("26×26 · không
chữ, không chevron"); doubled at the user's request. Still half the area of the
84×64 button it replaced: 2704 vs 5376px².
Four checks pinned the old number. Three now read the size the design actually
claims rather than a literal — square, at least 24px to hit, and smaller than
what it replaced — and check_design_parity records the deviation in its item
label instead of scoring 52px against a 26px expectation.
The fourth attempt was worse than the literal: I had check_layout_geometry
import _DOT and compare against it, which makes it unfailable — change the
constant and the expectation moves too. check_probes_bite caught that, reporting
that doubling _DOT again left the checker green. It now bounds the range
(24..64, square), which the mutation does break.
24/24 checkers pass; check_multi_screen took the teardown segfault once in three
standalone runs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
7a856aacaf
commit
ec2a84f38f
@@ -4,7 +4,7 @@ Round 1 asks "does the feature exist". A screen can pass that and still be laid
|
||||
out wrongly — right widgets, wrong order, wrong side, wrong proportions. This
|
||||
round measures real geometry against what the audit page's wireframes depict:
|
||||
reading order of the rail, section order down Monitoring, which side each pane
|
||||
is on, and the size relationships the design calls out (hero card, 26px dot).
|
||||
is on, and the size relationships the design calls out (hero card, the dot).
|
||||
|
||||
Run: python tools/check_layout_geometry.py
|
||||
"""
|
||||
@@ -13,7 +13,7 @@ from __future__ import annotations
|
||||
import os
|
||||
import sys␍
|
||||
|
||||
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
||||
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
||||
from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parent.parent
|
||||
@@ -41,7 +41,7 @@ def main() -> int:
|
||||
_load_fonts()
|
||||
_freeze_schedulers()
|
||||
|
||||
_apply_theme(app) # measure the styled window, not a bare one
|
||||
_apply_theme(app) # measure the styled window, not a bare one
|
||||
from cowork_local.config import AppConfig, CONFIG_DIR
|
||||
assert str(sandbox) in str(CONFIG_DIR), f"isolation failed: {CONFIG_DIR}"
|
||||
|
||||
@@ -154,7 +154,7 @@ def main() -> int:
|
||||
if row2 <= row1:
|
||||
fails.append("4 the phu khong xep 2x2")
|
||||
|
||||
# --- 5. Cowork: the dot clears the composer, dot is 26px --------------
|
||||
# --- 5. Cowork: the dot clears the composer, and is the declared size --
|
||||
win._goto(win._ROW_WORKSPACE, ws._cowork_tab_idx)
|
||||
for _ in range(8):
|
||||
app.processEvents()
|
||||
@@ -163,8 +163,15 @@ def main() -> int:
|
||||
dock_bottom = top_of(dock, win) + dock.height()
|
||||
comp_top = top_of(comp, win)
|
||||
print(f"cham {dock.width()}x{dock.height()} · day y={dock_bottom} · o nhap dinh y={comp_top}")
|
||||
if dock.width() > 30:
|
||||
fails.append(f"cham tro ly rong {dock.width()}px, thiet ke la 26px")
|
||||
# Reading _DOT and comparing against it makes this unfailable — change the
|
||||
# constant and the expectation moves with it (check_probes_bite caught
|
||||
# exactly that). Bound what the design actually claims instead: a square
|
||||
# chip, big enough to hit, far smaller than the 84x64 button it replaced.
|
||||
# 26px was drawn, 52px is what the user asked for; 64 is the ceiling past
|
||||
# which "gọn" stops being true.
|
||||
if not 24 <= dock.width() <= 64 or dock.width() != dock.height():
|
||||
fails.append(f"cham tro ly {dock.width()}x{dock.height()}px, "
|
||||
f"cho o khoang 24..64 va phai vuong")
|
||||
if dock_bottom > comp_top:
|
||||
fails.append("cham tro ly de len o nhap")
|
||||
if left_of(dock, win) + dock.width() > win.width():
|
||||
|
||||
Reference in New Issue
Block a user