From 2759ed94ba777d9883c029a1427f4dcd238c3470 Mon Sep 17 00:00:00 2001 From: thanhnv Date: Wed, 16 Sep 2026 01:05:52 +0900 Subject: [PATCH] perf: avoid refreshing workspace on cowork tab switch --- presentation/shell/page_registry.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/presentation/shell/page_registry.py b/presentation/shell/page_registry.py index d7f3e2e..174bfca 100644 --- a/presentation/shell/page_registry.py +++ b/presentation/shell/page_registry.py @@ -142,10 +142,11 @@ class PageRegistryMixin: Vệt sáng trên thanh menu cũng cập nhật ở đây, để nó đi theo NỘI DUNG chứ không theo thứ vừa được bấm. """ + was_page = self.pages.currentIndex() self._ensure_page(page) # build lazy page on first visit self.pages.setCurrentIndex(page) - if page == self._ROW_WORKSPACE: - self.workspace.refresh() # re-list projects + threads on entry + if page == self._ROW_WORKSPACE and was_page != page: + self.workspace.refresh() # refresh only when entering Workspace widget = self._page_widgets[page] if sub is not None and hasattr(widget, "select_subtab"): # Enforce the project gate here rather than at each entry point. A