From 1dbd45427abbcee3ae08f026b3b7fa7b91b3bf96 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Mon, 30 Mar 2026 18:45:11 +0000 Subject: [PATCH] feat: switch to all spaces on empty state (#816) --- apps/web/app/(app)/page.tsx | 18 +++- apps/web/components/memories-grid.tsx | 2 + apps/web/components/nova/nova-empty-state.tsx | 97 +++++++++++++++---- 3 files changed, 96 insertions(+), 21 deletions(-) diff --git a/apps/web/app/(app)/page.tsx b/apps/web/app/(app)/page.tsx index 4d35cb68..d2b90952 100644 --- a/apps/web/app/(app)/page.tsx +++ b/apps/web/app/(app)/page.tsx @@ -66,8 +66,13 @@ function ViewErrorFallback() { export default function NewPage() { const isMobile = useIsMobile() const { user, session } = useAuth() - const { selectedProject, isNovaSpaces, novaContainerTags, selectedProjects } = - useProject() + const { + selectedProject, + isNovaSpaces, + novaContainerTags, + selectedProjects, + setSelectedProjects, + } = useProject() const selectedProjectTag = selectedProjects[0] const isNovaContext = isNovaSpaces || @@ -81,6 +86,12 @@ export default function NewPage() { : (allProjects.find((p) => p.containerTag === selectedProjectTag) ?.name ?? selectedProjectTag) : undefined + + const handleSwitchToAllSpacesFromEmptyState = useCallback(() => { + analytics.spaceSwitched({ space_id: "nova_spaces" }) + setSelectedProjects([]) + }, [setSelectedProjects]) + const { viewMode, setViewMode } = useViewMode() const queryClient = useQueryClient() @@ -466,6 +477,9 @@ export default function NewPage() { onOpenIntegrations: handleOpenIntegrations, isAllSpaces: isNovaSpaces, spaceName: emptyStateSpaceName, + onSwitchToAllSpaces: isNovaSpaces + ? undefined + : handleSwitchToAllSpacesFromEmptyState, } : undefined } diff --git a/apps/web/components/memories-grid.tsx b/apps/web/components/memories-grid.tsx index cc7e8453..ff459432 100644 --- a/apps/web/components/memories-grid.tsx +++ b/apps/web/components/memories-grid.tsx @@ -100,6 +100,7 @@ interface NovaEmptyStateProps { ) => void isAllSpaces: boolean spaceName?: string + onSwitchToAllSpaces?: () => void } interface MemoriesGridProps { @@ -512,6 +513,7 @@ export function MemoriesGrid({ onOpenIntegrations={emptyStateProps.onOpenIntegrations} isAllSpaces={emptyStateProps.isAllSpaces} spaceName={emptyStateProps.spaceName} + onSwitchToAllSpaces={emptyStateProps.onSwitchToAllSpaces} /> ) : isEmpty ? (
diff --git a/apps/web/components/nova/nova-empty-state.tsx b/apps/web/components/nova/nova-empty-state.tsx index 8156512f..24be5b79 100644 --- a/apps/web/components/nova/nova-empty-state.tsx +++ b/apps/web/components/nova/nova-empty-state.tsx @@ -15,6 +15,7 @@ interface NovaEmptyStateProps { ) => void isAllSpaces: boolean spaceName?: string + onSwitchToAllSpaces?: () => void } const cardClass = cn( @@ -28,19 +29,13 @@ export function NovaEmptyState({ onOpenIntegrations, isAllSpaces, spaceName, + onSwitchToAllSpaces, }: NovaEmptyStateProps) { const handleInstallChrome = () => { window.open(CHROME_EXTENSION_URL, "_blank", "noopener,noreferrer") } - const title = isAllSpaces - ? "Help Nova get to know you" - : "This space is empty" - const subtitle = isAllSpaces - ? "Add your first memory to get started." - : spaceName - ? `Add memories to ${spaceName} to get started.` - : "Add memories to this space to get started." + const showSingleSpaceEmpty = !isAllSpaces && onSwitchToAllSpaces return (
-

- {title} -

-

- {subtitle} -

+ {isAllSpaces ? ( + <> +

+ Help Nova get to know you +

+

+ Add your first memory to get started. +

+ + ) : showSingleSpaceEmpty ? ( + <> +

+ {spaceName ? ( + <> + + "{spaceName}" + {" "} + is empty + + ) : ( + "This space is empty" + )} +

+

+ Your memories may be in another space. +

+ + + ) : ( + <> +

+ This space is empty +

+

+ {spaceName ? ( + <> + Add memories to{" "} + + "{spaceName}" + {" "} + to get started. + + ) : ( + "Add memories to this space to get started." + )} +

+ + )}