Drop the assistant's ⋯ menu; hiding is a right-click
Its two entries were "Thu nhỏ", which the − button immediately to its left already does, and "Ẩn vào cạnh phải". A drop-list whose real content is one action, half of it duplicating its neighbour, is chrome — removed at the user's request. Nothing became unreachable: collapsing is the − button and the dot itself, hiding is a right-click on the dot (already there, and named in its tooltip) or now on the open panel's header too. This is a deliberate deviation from the audit page, which asks for "'Ẩn trợ lý' dời vào menu ⋯". check_design_parity records it as that rather than quietly scoring it done — the item is relabelled and its detail says where the action went. check_help_dock stopped reading the menu's contents and now exercises the routes: − collapses, the dot carries a context menu, hide reaches the edge. 24/24 checkers pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
c4e9158779
commit
7a856aacaf
@@ -17,7 +17,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
|
||||
@@ -59,7 +59,7 @@ def build():
|
||||
_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}"
|
||||
|
||||
@@ -295,9 +295,18 @@ def main() -> int:
|
||||
add("overlay-help-panel", "Rê chuột mới hiện chữ 'AI Assistant'",
|
||||
tr("help_agent.badge") in dock.launcher.text(), dock.launcher.text().strip())
|
||||
dock.launcher._set_open(False)
|
||||
items = [a.text() for a in dock.more_btn.menu().actions()]
|
||||
add("overlay-help-panel", "'Ẩn trợ lý' dời vào menu ⋯",
|
||||
tr("help_agent.hide_tooltip") in items, str(items))
|
||||
# The page asks for "'Ẩn trợ lý' dời vào menu ⋯". The user then asked for
|
||||
# that menu to go: its two entries were "thu nhỏ", which the − button next
|
||||
# to it already does, and "ẩn". Recorded as a deliberate deviation rather
|
||||
# than quietly scored as done — the action itself moved to a right-click on
|
||||
# the dot and on the panel header, so nothing became unreachable.
|
||||
from PySide6.QtCore import Qt
|
||||
|
||||
has_menu = hasattr(dock, "more_btn")
|
||||
by_right_click = dock.launcher.contextMenuPolicy() == Qt.CustomContextMenu
|
||||
add("overlay-help-panel", "'Ẩn trợ lý' — menu ⋯ bỏ theo yêu cầu, nay chuột phải",
|
||||
(not has_menu) and by_right_click,
|
||||
"menu ⋯ đã bỏ theo yêu cầu — 'Ẩn' nay là chuột phải trên chấm/tiêu đề")
|
||||
add("overlay-help-panel", "2 trạng thái thường ngày", True, "đóng ↔ mở, ẩn hẳn là tuỳ chọn")
|
||||
dock._hide_to_edge()
|
||||
app.processEvents()
|
||||
|
||||
@@ -100,12 +100,27 @@ def main() -> int:
|
||||
fails.append(f"tab mep {dock.width()}px, van duoi 24px")
|
||||
dock._show_launcher()
|
||||
|
||||
# Nothing removed: "hide to the edge" is in the ⋯ menu now.
|
||||
items = [a.text() for a in dock.more_btn.menu().actions()]
|
||||
print(f"menu ⋯ : {items}")
|
||||
for key in ("help_agent.collapse_tooltip", "help_agent.hide_tooltip"):
|
||||
if tr(key) not in items:
|
||||
fails.append(f"menu thieu muc {tr(key)}")
|
||||
# The ⋯ menu is gone (user's call — its two entries were "collapse", which
|
||||
# the − button beside it already did, and "hide"). Nothing was lost with it:
|
||||
# collapse is the − button and the dot, hide is a right-click on either the
|
||||
# dot or the open panel's header. Check the routes, not the menu.
|
||||
from PySide6.QtCore import Qt as _Qt
|
||||
|
||||
if hasattr(dock, "more_btn"):
|
||||
fails.append("menu ⋯ van con tren panel")
|
||||
dock._collapse()
|
||||
app.processEvents()
|
||||
if dock._state != "launcher":
|
||||
fails.append("nut − khong thu nho duoc ve cham")
|
||||
if dock.launcher.contextMenuPolicy() != _Qt.CustomContextMenu:
|
||||
fails.append("cham khong co menu chuot phai de an")
|
||||
dock._hide_to_edge()
|
||||
app.processEvents()
|
||||
if dock._state != "hidden":
|
||||
fails.append("khong an duoc vao canh phai")
|
||||
print(f"thu nho + an : ca hai duong deu chay (trang thai cuoi={dock._state!r})")
|
||||
dock._show_launcher()
|
||||
app.processEvents()
|
||||
print(f"nut thu nho : {dock.min_btn.toolTip()!r}")
|
||||
print(f"nut gui / o nhap: {dock.send_btn is not None} / {dock.input is not None}")
|
||||
|
||||
@@ -113,9 +128,11 @@ def main() -> int:
|
||||
for lang in ("vi", "en", "ja"):
|
||||
set_language(lang)
|
||||
dock.retranslate()
|
||||
# more_tooltip went with the ⋯ menu; dot_hint replaces it as the
|
||||
# string that tells you the right-click is there.
|
||||
vals = [dock.launcher.toolTip(), tr("help_agent.badge"),
|
||||
tr("help_agent.more_tooltip")]
|
||||
print(f" {lang}: badge={vals[1]!r} more={vals[2]!r}")
|
||||
tr("help_agent.dot_hint")]
|
||||
print(f" {lang}: badge={vals[1]!r} goi y chuot phai={vals[2]!r}")
|
||||
if any(not v or v.startswith("help_agent.") for v in vals):
|
||||
fails.append(f"thieu ban dich cho {lang}")
|
||||
set_language("vi")
|
||||
|
||||
Reference in New Issue
Block a user