Feature/fsg gamma team ui fix #3
@@ -87,6 +87,21 @@ def main() -> int:
|
|||||||
fails.append(f"thieu nut {name} tren thanh cong cu")
|
fails.append(f"thieu nut {name} tren thanh cong cu")
|
||||||
print(f"nut tren thanh cong cu: {c.skills_btn.text()!r}, {c._new_btn.text()!r}")
|
print(f"nut tren thanh cong cu: {c.skills_btn.text()!r}, {c._new_btn.text()!r}")
|
||||||
|
|
||||||
|
# the drawing gives Cowork two columns; History lives in the rail's RECENTS
|
||||||
|
# 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")
|
||||||
|
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():
|
||||||
|
fails.append("'Tat ca project…' khong mo duoc pane Lich su")
|
||||||
|
w._on_history_fold(True)
|
||||||
|
app.processEvents()
|
||||||
|
|
||||||
# one heading on the files panel, with the chevron at its right — the
|
# one heading on the files panel, with the chevron at its right — the
|
||||||
# drawing has "TỆP ĐẦU RA (3) ›" and nothing above it
|
# drawing has "TỆP ĐẦU RA (3) ›" and nothing above it
|
||||||
from PySide6.QtCore import QPoint as _QP
|
from PySide6.QtCore import QPoint as _QP
|
||||||
|
|||||||
+19
-7
@@ -110,6 +110,9 @@ class WorkspaceTab(QWidget):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
self.ctx = ctx
|
self.ctx = ctx
|
||||||
self._current_id = ""
|
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
|
# Shared widgets embedded as per-project sub-tabs (None in unit tests
|
||||||
# that only drive project management).
|
# that only drive project management).
|
||||||
self._cowork = cowork
|
self._cowork = cowork
|
||||||
@@ -311,11 +314,16 @@ class WorkspaceTab(QWidget):
|
|||||||
sb = self._sidebar
|
sb = self._sidebar
|
||||||
sb.open_chat.connect(self._on_sidebar_open)
|
sb.open_chat.connect(self._on_sidebar_open)
|
||||||
sb.new_chat.connect(self._on_sidebar_new)
|
sb.new_chat.connect(self._on_sidebar_new)
|
||||||
sb.collapse_requested.connect(lambda: self._set_sidebar_collapsed(True))
|
sb.collapse_requested.connect(lambda: self._on_history_fold(True))
|
||||||
sb.expand_requested.connect(lambda: self._set_sidebar_collapsed(False))
|
sb.expand_requested.connect(lambda: self._on_history_fold(False))
|
||||||
sb.refresh_requested.connect(self._on_sidebar_refresh)
|
sb.refresh_requested.connect(self._on_sidebar_refresh)
|
||||||
sb.history_changed.connect(self._reload_threads)
|
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:
|
def _set_sidebar_collapsed(self, collapsed: bool) -> None:
|
||||||
"""Collapse/expand History sidebar and redistribute splitter space so
|
"""Collapse/expand History sidebar and redistribute splitter space so
|
||||||
the Cowork chat area fills the freed width (same pattern as
|
the Cowork chat area fills the freed width (same pattern as
|
||||||
@@ -404,11 +412,14 @@ class WorkspaceTab(QWidget):
|
|||||||
narrow = getattr(self, "_is_narrow", False)
|
narrow = getattr(self, "_is_narrow", False)
|
||||||
if self._sidebar is not None:
|
if self._sidebar is not None:
|
||||||
self._sidebar.setVisible(on_cowork)
|
self._sidebar.setVisible(on_cowork)
|
||||||
# Auto-expand History when entering Cowork — unless the window is too
|
# The drawing gives Cowork two columns — the transcript and the
|
||||||
# narrow to hold it, in which case expanding it here would undo the
|
# files panel — and moves history to the rail's RECENTS. Its own
|
||||||
# fold made moments earlier and clip the chat again.
|
# "Vấn đề" note is that three panes squeezed the conversation below
|
||||||
if on_cowork:
|
# 60% of the width. So History arrives folded to its strip: the
|
||||||
self._sidebar.set_collapsed(narrow)
|
# 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
|
# QSplitter ignores hidden panes, but the freed width isn't handed to
|
||||||
# the remaining panes deterministically — set explicit sizes after any
|
# the remaining panes deterministically — set explicit sizes after any
|
||||||
# pane toggle (same lesson as _set_projects_collapsed).
|
# 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
|
filters, pin, rename, multi-select delete and the context menu all still
|
||||||
live in this panel.
|
live in this panel.
|
||||||
"""
|
"""
|
||||||
|
self._history_opened = True
|
||||||
self._set_sidebar_collapsed(False)
|
self._set_sidebar_collapsed(False)
|
||||||
self._show_cowork_tab()
|
self._show_cowork_tab()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user