diff --git a/tools/check_cowork_screen.py b/tools/check_cowork_screen.py index 5da12c4..f0bb55e 100644 --- a/tools/check_cowork_screen.py +++ b/tools/check_cowork_screen.py @@ -91,13 +91,13 @@ def main() -> int: # and its pane arrives folded to the strip the drawing keeps w = win.workspace sb = w._sidebar - print(f"vao Cowork: History gap={sb.is_collapsed()} rong={sb.width()}px") - if not sb.is_collapsed(): - fails.append("pane Lich su mo san — man Cowork thanh 3 cot") + print(f"vao Cowork: History hien={sb.isVisible()}") + if sb.isVisible(): + fails.append("pane Lich su van o tren man Cowork — ban ve chi co 2 cot") w.show_history_pane() app.processEvents() - print(f"sau 'Tat ca project…': History gap={sb.is_collapsed()} rong={sb.width()}px") - if sb.is_collapsed(): + print(f"sau 'Tat ca project…': History hien={sb.isVisible()} rong={sb.width()}px") + if not sb.isVisible(): fails.append("'Tat ca project…' khong mo duoc pane Lich su") w._on_history_fold(True) app.processEvents() diff --git a/ui/workspace_tab.py b/ui/workspace_tab.py index 6ea23c3..bf0b208 100644 --- a/ui/workspace_tab.py +++ b/ui/workspace_tab.py @@ -320,9 +320,13 @@ class WorkspaceTab(QWidget): sb.history_changed.connect(self._reload_threads) def _on_history_fold(self, collapsed: bool) -> None: - """Remember what the user chose, so switching screens does not undo it.""" + """Its chevron closes the panel away, back to the drawn layout.""" self._history_opened = not collapsed - self._set_sidebar_collapsed(collapsed) + if collapsed: + self._sidebar.setVisible(False) + self._apply_pane_visibility() + else: + self._set_sidebar_collapsed(False) def _set_sidebar_collapsed(self, collapsed: bool) -> None: """Collapse/expand History sidebar and redistribute splitter space so @@ -411,15 +415,15 @@ class WorkspaceTab(QWidget): self._hint.setVisible(on_project and self.project_list.count() == 0) narrow = getattr(self, "_is_narrow", False) if self._sidebar is not None: - self._sidebar.setVisible(on_cowork) - # The drawing gives Cowork two columns — the transcript and the - # files panel — and moves history to the rail's RECENTS. Its own - # "Vấn đề" note is that three panes squeezed the conversation below - # 60% of the width. So History arrives folded to its strip: the - # chevron the drawing keeps, one click from the full panel, and - # "Tất cả project…" in RECENTS opens it outright. - if on_cowork and not self._history_opened: - self._sidebar.set_collapsed(True) + # Cowork is two columns in the drawing — transcript and files — with + # no history pane and no strip where one used to be. The relocation + # table is explicit: History moves to Sidebar ▸ RECENTS, "giữ, dễ + # tới hơn". So the panel is not on this screen at all until asked + # for: "Tất cả project…" in RECENTS brings it in, since search, + # filters, pin, rename and multi-select delete live only there. + self._sidebar.setVisible(on_cowork and self._history_opened) + if on_cowork and self._history_opened: + self._sidebar.set_collapsed(False) # QSplitter ignores hidden panes, but the freed width isn't handed to # the remaining panes deterministically — set explicit sizes after any # pane toggle (same lesson as _set_projects_collapsed). @@ -714,8 +718,9 @@ class WorkspaceTab(QWidget): live in this panel. """ self._history_opened = True - self._set_sidebar_collapsed(False) self._show_cowork_tab() + self._sidebar.setVisible(True) + self._set_sidebar_collapsed(False) def start_new_chat(self) -> None: """Start a new thread in the current project and show it.