diff --git a/ui/src/app-route-paths.ts b/ui/src/app-route-paths.ts index ec90a8be9527..928aaa53683a 100644 --- a/ui/src/app-route-paths.ts +++ b/ui/src/app-route-paths.ts @@ -107,6 +107,19 @@ export function pathForRoute(routeId: RouteId, basePath = ""): string { return normalizedBasePath ? `${normalizedBasePath}${path}` : path; } +/** Query key the Activity feed reads to scope its session list to one person. */ +export const ACTIVITY_PERSON_PARAM = "person"; + +/** Activity feed scoped to one person, for every surface that shows an identity. */ +export function activityPersonLocation( + personId: string, + basePath = "", +): { pathname: string; search: string; href: string } { + const pathname = pathForRoute("activity", basePath); + const search = `?${new URLSearchParams({ [ACTIVITY_PERSON_PARAM]: personId }).toString()}`; + return { pathname, search, href: `${pathname}${search}` }; +} + export function pathForWorkboardBoard(boardId: string, basePath = ""): string { if (!isValidWorkboardBoardId(boardId)) { throw new Error("Invalid Workboard board id."); diff --git a/ui/src/components/app-sidebar-render.ts b/ui/src/components/app-sidebar-render.ts index 2c0b06535928..f8edef660686 100644 --- a/ui/src/components/app-sidebar-render.ts +++ b/ui/src/components/app-sidebar-render.ts @@ -5,7 +5,7 @@ import { type NavigationRouteId, type SidebarZoneEntry, } from "../app-navigation.ts"; -import { isRouteId, isSessionRouteId, pathForRoute } from "../app-route-paths.ts"; +import { activityPersonLocation, isRouteId, isSessionRouteId } from "../app-route-paths.ts"; import { resolveControlUiAuthToken } from "../app/control-ui-auth.ts"; import { isNativeWebChromeHost } from "../app/native-web-chrome.ts"; import { readPresenceEntries, resolveCurrentSelfUser } from "../app/user-profile.ts"; @@ -315,14 +315,13 @@ export function renderAppSidebarOnline(host: AppSidebarRenderHost) { ? nothing : html`