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
@@ -287,8 +287,14 @@ def main() -> int:
|
||||
t.close()
|
||||
|
||||
# --- 27 help dock ---
|
||||
add("overlay-help-panel", "Một chấm 26px, không chữ",
|
||||
dock.width() <= 30 and not dock.launcher.text().strip(), f"{dock.width()}px")
|
||||
# The page says 26px. The user asked for it doubled — recorded here rather
|
||||
# than scored against a number the app no longer intends.
|
||||
from cowork_local.ui.help_agent_widget import _DOT
|
||||
|
||||
add("overlay-help-panel",
|
||||
f"Một chấm, không chữ (bản vẽ 26px → {_DOT}px theo yêu cầu)",
|
||||
dock.width() == _DOT and not dock.launcher.text().strip(),
|
||||
f"{dock.width()}px")
|
||||
from cowork_local.i18n import tr
|
||||
dock.launcher._set_open(True)
|
||||
app.processEvents()
|
||||
|
||||
@@ -53,9 +53,15 @@ def main() -> int:
|
||||
area_new, area_old = closed.width() * closed.height(), OLD_W * OLD_H
|
||||
print(f"dien tich : {area_new} vs {area_old}px2 "
|
||||
f"({100 - round(area_new / area_old * 100)}% nho hon)")
|
||||
if closed.width() > 30 or closed.height() > 30:
|
||||
fails.append(f"nut dong van {closed.width()}x{closed.height()}, cho <=30")
|
||||
# 26px clears the ~24px comfortable-tap floor the old 18px chevron missed.
|
||||
# The page draws 26px; the user asked for double. Read the size the module
|
||||
# declares rather than a number written here, so the two cannot drift, and
|
||||
# keep the two things that actually matter: it is a square chip, and it is
|
||||
# still far smaller than the button it replaced.
|
||||
if closed.width() != closed.height():
|
||||
fails.append(f"nut dong khong vuong: {closed.width()}x{closed.height()}")
|
||||
if area_new >= area_old:
|
||||
fails.append(f"khong con nho hon nut cu: {area_new} vs {area_old}px2")
|
||||
# clears the ~24px comfortable-tap floor the old 18px chevron missed
|
||||
if min(closed.width(), closed.height()) < 24:
|
||||
fails.append("vung bam nho hon 24px")
|
||||
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -18,7 +18,7 @@ import runpy
|
||||
import subprocess
|
||||
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
|
||||
@@ -28,8 +28,8 @@ os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
|
||||
|
||||
# (name, file, find, replace, checker that must FAIL because of it)
|
||||
MUTATIONS = [
|
||||
("bo cham tro ly 26px -> 64px",
|
||||
"ui/help_agent_widget.py", "_DOT = 26", "_DOT = 64",
|
||||
("phong to cham tro ly gap doi khai bao",
|
||||
"ui/help_agent_widget.py", "_DOT = 52", "_DOT = 104",
|
||||
"check_layout_geometry.py"),
|
||||
("tra lane Running ve khong vien",
|
||||
"ui/schedule_task_tab.py",
|
||||
|
||||
@@ -36,8 +36,11 @@ _MARGIN = 18 # gap from the window's bottom-right corner
|
||||
# bottom-right of every screen — on Cowork, right on top of the Send button —
|
||||
# for something opened a few times a day. The name now appears on hover only,
|
||||
# and "hide to the edge" moved into the panel's ⋯ menu.
|
||||
_DOT = 26 # closed launcher (a round chip)
|
||||
_DOT_ICON = 14 # the sparkle inside it
|
||||
# The audit page draws this at 26px ("26×26 · không chữ, không chevron").
|
||||
# Doubled at the user's request: 26 read as too small to notice on a 1920
|
||||
# screen. Still half the area of the 84×64 button it replaced.
|
||||
_DOT = 52 # closed launcher (a round chip)
|
||||
_DOT_ICON = 28 # the sparkle inside it
|
||||
_PILL_PAD = 12 # extra width for the label when hovered
|
||||
_TAB_W, _TAB_H = 28, 48 # the "show" tab when hidden at the edge (was 16 wide)
|
||||
_PANEL_W, _PANEL_H = 340, 460 # expanded chat panel size
|
||||
|
||||
Reference in New Issue
Block a user