From 2a977c1a8100c1223e8fa60a2df590926f67d6ac Mon Sep 17 00:00:00 2001 From: BlitzOS Upstream Prep Date: Wed, 2 Sep 2026 00:28:35 +0000 Subject: [PATCH] feat(components): opt-in suppression of the archive page's My/All Tasks scope control A workspace with exactly one member has nothing to switch between: both entries list the same sessions. Add `hideTeamScope` to `ArchiveView` and `WebArchiveScreen`, defaulting to false, which is the scope picker every multi-member workspace has always had. The stored scope atom is still written and still read back; only the ANSWER is pinned while the prop is on, so turning it off restores the member's own last choice rather than a default. The mobile toolbar dropdown takes the same term. No existing call site passes it. Model: claude-opus-5[1m] --- .../src/components/archive/archive-view.tsx | 24 ++++++++++++++++--- .../components/archive/web-archive-screen.tsx | 11 +++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/packages/components/src/components/archive/archive-view.tsx b/packages/components/src/components/archive/archive-view.tsx index 71d5c0c68..5194ba42b 100644 --- a/packages/components/src/components/archive/archive-view.tsx +++ b/packages/components/src/components/archive/archive-view.tsx @@ -1000,7 +1000,20 @@ export function ArchivedSessionGroupSection({ ); } -export function ArchiveView() { +export type ArchiveViewProps = { + /** + * Suppresses the My Tasks / All Tasks scope control and pins the listing to + * the viewer's own archived sessions. + * + * A host whose workspace has exactly one member has nothing to switch + * between, so the control is a dropdown whose two entries list the same + * sessions. Defaults to `false`, which is the scope picker every cloud + * workspace has always had. + */ + hideTeamScope?: boolean; +}; + +export function ArchiveView({ hideTeamScope = false }: ArchiveViewProps = {}) { const { t } = useTranslation(); const router = useRouter(); const isMobile = useIsMobile(); @@ -1010,7 +1023,11 @@ export function ArchiveView() { const { restoreSession, deleteArchivedSession } = useSessionActions(); const openMobileDrawer = useSetAtom(setMobileDrawerOpenAtom); const [deleteConfirmSession, setDeleteConfirmSession] = useState(null); - const [archiveScope, setArchiveScope] = useAtom(archiveScopeAtom); + const [storedArchiveScope, setArchiveScope] = useAtom(archiveScopeAtom); + // The stored scope is still written and still read back; it is only the + // ANSWER that is pinned, so turning the prop off restores the member's own + // last choice rather than a default. + const archiveScope = hideTeamScope ? 'my' : storedArchiveScope; const [searchQuery, setSearchQuery] = useState(''); const [sortMode, setSortMode] = useState('newest'); const [groupMode, setGroupMode] = useState('project'); @@ -1453,7 +1470,7 @@ export function ArchiveView() { className="h-8 border-foreground/[0.10] bg-background pl-8 text-sm shadow-none dark:border-input-border dark:bg-input" /> - {isMobile ? ( + {isMobile && !hideTeamScope ? (