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
+19
-29
@@ -255,27 +255,17 @@ class HelpAgentWidget(QWidget):
|
||||
self.min_btn.setToolTip(tr("help_agent.collapse_tooltip"))
|
||||
self.min_btn.clicked.connect(self._collapse)
|
||||
hb.addWidget(self.min_btn)
|
||||
# "Hide to the right edge" lives here now, next to "minimise", instead of
|
||||
# as a permanent 18px chevron on every screen. Same action, offered where
|
||||
# the user is already interacting with the assistant.
|
||||
self.more_btn = QPushButton("⋯", header)
|
||||
self.more_btn.setObjectName("helpMinBtn")
|
||||
self.more_btn.setFixedSize(24, 24)
|
||||
self.more_btn.setCursor(Qt.PointingHandCursor)
|
||||
self.more_btn.setToolTip(tr("help_agent.more_tooltip"))
|
||||
menu = QMenu(self.more_btn)
|
||||
self.act_collapse = menu.addAction(tr("help_agent.collapse_tooltip"))
|
||||
self.act_collapse.triggered.connect(self._collapse)
|
||||
self.act_hide = menu.addAction(tr("help_agent.hide_tooltip"))
|
||||
self.act_hide.triggered.connect(self._hide_to_edge)
|
||||
# The old build put a chevron button beside the dot that hid the
|
||||
# assistant in one click. The drawing has no such button — the dot is
|
||||
# 26px, no text, no chevron — so the same reach comes back as a right-
|
||||
# click on the dot rather than as pixels next to it.
|
||||
self.launcher.setContextMenuPolicy(Qt.CustomContextMenu)
|
||||
self.launcher.customContextMenuRequested.connect(self._dot_menu)
|
||||
self.more_btn.setMenu(menu)
|
||||
hb.addWidget(self.more_btn)
|
||||
# No ⋯ menu. The audit page put "Ẩn trợ lý" in one, but its two entries
|
||||
# were "thu nhỏ" — which the − button beside it already does — and
|
||||
# "ẩn vào cạnh phải". A drop-list to reach one action that duplicates
|
||||
# its neighbour is chrome; removed at the user's request.
|
||||
#
|
||||
# Hiding stays reachable by right-click, on the header while the panel
|
||||
# is open and on the dot while it is shut, so no route is lost.
|
||||
for target in (header, self.launcher):
|
||||
target.setContextMenuPolicy(Qt.CustomContextMenu)
|
||||
target.customContextMenuRequested.connect(
|
||||
lambda pos, w=target: self._hide_menu(w, pos))
|
||||
v.addWidget(header)
|
||||
|
||||
# Conversation log
|
||||
@@ -316,15 +306,18 @@ class HelpAgentWidget(QWidget):
|
||||
self._state = _LAUNCHER_ST
|
||||
self._apply_state()
|
||||
|
||||
def _dot_menu(self, pos) -> None:
|
||||
"""Right-click on the dot: hide to the edge, the one action that means
|
||||
anything while the panel is shut ("collapse to dot" already happened)."""
|
||||
def _hide_menu(self, widget, pos) -> None:
|
||||
"""Right-click, on the dot or the open panel's header: hide to the edge.
|
||||
|
||||
The only action worth offering here — collapsing is what the − button
|
||||
and the dot itself already are.
|
||||
"""
|
||||
from PySide6.QtWidgets import QMenu
|
||||
|
||||
menu = QMenu(self.launcher)
|
||||
menu = QMenu(widget)
|
||||
act = menu.addAction(tr("help_agent.hide_tooltip"))
|
||||
act.triggered.connect(self._hide_to_edge)
|
||||
menu.exec(self.launcher.mapToGlobal(pos))
|
||||
menu.exec(widget.mapToGlobal(pos))
|
||||
|
||||
def _hide_to_edge(self) -> None:
|
||||
self._state = _HIDDEN
|
||||
@@ -483,7 +476,4 @@ class HelpAgentWidget(QWidget):
|
||||
self.launcher.setText(f" {tr('help_agent.badge')}")
|
||||
self._layout_launcher()
|
||||
self.min_btn.setToolTip(tr("help_agent.collapse_tooltip"))
|
||||
self.more_btn.setToolTip(tr("help_agent.more_tooltip"))
|
||||
self.act_collapse.setText(tr("help_agent.collapse_tooltip"))
|
||||
self.act_hide.setText(tr("help_agent.hide_tooltip"))
|
||||
self.edge_tab.setToolTip(tr("help_agent.show_tooltip"))
|
||||
|
||||
Reference in New Issue
Block a user