Cowork opens with two columns; History is the rail's RECENTS now
You are right that the new Cowork should not carry a History pane. The page
lists it under "Thành phần bị dời chỗ": History, pane giữa, chỉ ở tab Cowork →
Sidebar ▸ RECENTS. Its own complaint about this screen is that three panes
squeezed the conversation under 60% of the width, and the wireframe draws two
columns — transcript and files.
But the same page also keeps the pane's chevron ("Pane Lịch sử: chevron trên
đầu History, gập thành dải mỏng — giữ"), and RECENTS ends in "Tất cả project…",
which opens it. So it is folded, not gone: search, filters, pin, rename and
multi-select delete only exist in that panel and deleting it would take them.
Cowork now opens with History folded to its 18px strip. "Tất cả project…" opens
it to 240px, and either choice is remembered — leaving the screen and coming
back no longer re-folds a panel you just opened, or re-opens one you just shut.
check_cowork_screen requires the fold on arrival and the strip to open on
request; restoring the old auto-expand fails it.
23/23 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
63b0af27e9
commit
b849cb6ea0
+19
-7
@@ -110,6 +110,9 @@ class WorkspaceTab(QWidget):
|
||||
super().__init__()
|
||||
self.ctx = ctx
|
||||
self._current_id = ""
|
||||
# True once the user asks for the full History panel; until then Cowork
|
||||
# opens with it folded, as the drawing lays the screen out.
|
||||
self._history_opened = False
|
||||
# Shared widgets embedded as per-project sub-tabs (None in unit tests
|
||||
# that only drive project management).
|
||||
self._cowork = cowork
|
||||
@@ -311,11 +314,16 @@ class WorkspaceTab(QWidget):
|
||||
sb = self._sidebar
|
||||
sb.open_chat.connect(self._on_sidebar_open)
|
||||
sb.new_chat.connect(self._on_sidebar_new)
|
||||
sb.collapse_requested.connect(lambda: self._set_sidebar_collapsed(True))
|
||||
sb.expand_requested.connect(lambda: self._set_sidebar_collapsed(False))
|
||||
sb.collapse_requested.connect(lambda: self._on_history_fold(True))
|
||||
sb.expand_requested.connect(lambda: self._on_history_fold(False))
|
||||
sb.refresh_requested.connect(self._on_sidebar_refresh)
|
||||
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."""
|
||||
self._history_opened = not collapsed
|
||||
self._set_sidebar_collapsed(collapsed)
|
||||
|
||||
def _set_sidebar_collapsed(self, collapsed: bool) -> None:
|
||||
"""Collapse/expand History sidebar and redistribute splitter space so
|
||||
the Cowork chat area fills the freed width (same pattern as
|
||||
@@ -404,11 +412,14 @@ class WorkspaceTab(QWidget):
|
||||
narrow = getattr(self, "_is_narrow", False)
|
||||
if self._sidebar is not None:
|
||||
self._sidebar.setVisible(on_cowork)
|
||||
# Auto-expand History when entering Cowork — unless the window is too
|
||||
# narrow to hold it, in which case expanding it here would undo the
|
||||
# fold made moments earlier and clip the chat again.
|
||||
if on_cowork:
|
||||
self._sidebar.set_collapsed(narrow)
|
||||
# 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)
|
||||
# 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).
|
||||
@@ -702,6 +713,7 @@ class WorkspaceTab(QWidget):
|
||||
filters, pin, rename, multi-select delete and the context menu all still
|
||||
live in this panel.
|
||||
"""
|
||||
self._history_opened = True
|
||||
self._set_sidebar_collapsed(False)
|
||||
self._show_cowork_tab()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user