diff --git a/CONTEXT.md b/CONTEXT.md index 76c56c0c..94c4f5a4 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -31,3 +31,7 @@ _Avoid_: Pending membership, direct add **Space membership**: An accepted relationship between an active Memos user and a Space, carrying either the `ADMIN` or `USER` Space role. _Avoid_: Invitation, application role + +**Memo collection scope**: +The Space-placement dimension applied to memo and derived-resource collections. It is either `all`, which adds no Space predicate, or one exact Space. An unassigned Memo remains part of `all`; unassigned is a placement, not a collection scope. +_Avoid_: Unassigned scope, no-Space collection diff --git a/web/src/components/AppSidebar/AppSidebar.tsx b/web/src/components/AppSidebar/AppSidebar.tsx index c91e8a45..83d9f3e0 100644 --- a/web/src/components/AppSidebar/AppSidebar.tsx +++ b/web/src/components/AppSidebar/AppSidebar.tsx @@ -65,7 +65,7 @@ import type { MemoView } from "@/types/proto/api/v1/memo_view_service_pb"; import { User_Role, UserNotification_Status } from "@/types/proto/api/v1/user_service_pb"; import { useTranslate } from "@/utils/i18n"; import MemosLogo from "../MemosLogo"; -import { getSidebarRouteKind } from "./routes"; +import { getSidebarRouteKind, routeSupportsCollectionScope } from "./routes"; import SidebarRow, { SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_FOCUS_CLASSES, SIDEBAR_ROW_ICON_CLASSES, sidebarRowStateClasses } from "./SidebarRow"; import SidebarSection, { SIDEBAR_SECTION_ACTION_BUTTON_CLASSES, @@ -263,7 +263,6 @@ const CollectionSidebarContent = ({ context }: { context: MemoStatsContext }) => context, userName: statsUserName, filter: statsFilter, - includeSpaceVisibility: !!selectedSpaceName, enabled: authInitialized && instanceInitialized && (md || mobileOpen), }); @@ -273,7 +272,8 @@ const CollectionSidebarContent = ({ context }: { context: MemoStatsContext }) => // clicks must land somewhere that renders the filtered feed. const onCollectionRoute = isMemoScopeRoute(location.pathname) || !!profileMatch; const filterTarget = onCollectionRoute ? undefined : context === "explore" ? ROUTES.EXPLORE : ROUTES.HOME; - const tagStateScope = `${statsUserName ?? context}${selectedSpaceName ? `:${selectedSpaceName}` : ""}`; + const tagStateScope = + context === "profile" ? (statsUserName ?? context) : `${statsUserName ?? context}${selectedSpaceName ? `:${selectedSpaceName}` : ""}`; return (