From cdba5d6ebecfa1f4cf0d55b6f63c804f3be21e09 Mon Sep 17 00:00:00 2001 From: ComputelessComputer Date: Sat, 21 Mar 2026 15:32:31 -0700 Subject: [PATCH] fix: include the current user in ad-hoc meeting participants - add an ad-hoc session creation path that seeds the current user as a manual participant - route new meeting and notification-driven ad-hoc recording flows through that path - label the current user's participant chip as `(You)` and cover the session creation behavior with tests --- apps/desktop/src/services/event-listeners.tsx | 8 +-- .../metadata/participants/chip.tsx | 12 +++- apps/desktop/src/shared/main/useNewNote.ts | 29 ++------ .../src/store/tinybase/store/sessions.test.ts | 70 +++++++++++++++++++ .../src/store/tinybase/store/sessions.ts | 46 ++++++++++++ 5 files changed, 136 insertions(+), 29 deletions(-) create mode 100644 apps/desktop/src/store/tinybase/store/sessions.test.ts diff --git a/apps/desktop/src/services/event-listeners.tsx b/apps/desktop/src/services/event-listeners.tsx index 069fa18c17..7934cb24ac 100644 --- a/apps/desktop/src/services/event-listeners.tsx +++ b/apps/desktop/src/services/event-listeners.tsx @@ -10,7 +10,7 @@ import { getCurrentWebviewWindowLabel } from "@hypr/plugin-windows"; import * as main from "~/store/tinybase/store/main"; import { - createSession, + createAdHocSession, getOrCreateSessionForEventId, } from "~/store/tinybase/store/sessions"; import { useTabs } from "~/store/zustand/tabs"; @@ -61,7 +61,7 @@ function useNotificationEvents() { pendingAutoStart.current = null; const sessionId = eventId ? getOrCreateSessionForEventId(store, eventId) - : createSession(store); + : createAdHocSession(store); openNew({ type: "sessions", id: sessionId, @@ -95,7 +95,7 @@ function useNotificationEvents() { } const sessionId = eventId ? getOrCreateSessionForEventId(currentStore, eventId) - : createSession(currentStore); + : createAdHocSession(currentStore); openNewRef.current({ type: "sessions", id: sessionId, @@ -117,7 +117,7 @@ function useNotificationEvents() { currentStore, eventIds[selectedIndex], ) - : createSession(currentStore); + : createAdHocSession(currentStore); openNewRef.current({ type: "sessions", diff --git a/apps/desktop/src/session/components/outer-header/metadata/participants/chip.tsx b/apps/desktop/src/session/components/outer-header/metadata/participants/chip.tsx index 7d14f56e4c..5072de3421 100644 --- a/apps/desktop/src/session/components/outer-header/metadata/participants/chip.tsx +++ b/apps/desktop/src/session/components/outer-header/metadata/participants/chip.tsx @@ -10,10 +10,12 @@ import { parseTranscriptHints, updateTranscriptHints } from "~/stt/utils"; export function ParticipantChip({ mappingId }: { mappingId: string }) { const details = useParticipantDetails(mappingId); + const currentUserId = main.UI.useValue("user_id", main.STORE_ID); const assignedHumanId = details?.humanId; const sessionId = details?.sessionId; const source = details?.source; + const isCurrentUser = assignedHumanId === currentUserId; const handleRemove = useRemoveParticipant({ mappingId, @@ -35,7 +37,13 @@ export function ParticipantChip({ mappingId }: { mappingId: string }) { return null; } - const { humanName } = details; + const { humanEmail, humanName } = details; + const baseLabel = + humanName || humanEmail || (isCurrentUser ? "You" : "Unknown"); + const label = + isCurrentUser && baseLabel !== "You" && !baseLabel.endsWith(" (You)") + ? `${baseLabel} (You)` + : baseLabel; return ( - {humanName || "Unknown"} + {label}