diff --git a/apps/x/apps/main/src/meeting-popup.ts b/apps/x/apps/main/src/meeting-popup.ts index 7284578b..0b36fe8a 100644 --- a/apps/x/apps/main/src/meeting-popup.ts +++ b/apps/x/apps/main/src/meeting-popup.ts @@ -14,8 +14,8 @@ import type { DetectedMeeting } from "@x/core/dist/meetings/detector.js"; */ // Lean bar + margins for the overhanging × and the CSS drop shadow. -const POPUP_WIDTH = 448; -const POPUP_HEIGHT = 96; +const POPUP_WIDTH = 400; +const POPUP_HEIGHT = 84; const AUTO_DISMISS_MS = 45_000; // Display names, Granola-style ("Chrome", not "Google Chrome"). diff --git a/apps/x/apps/renderer/src/components/meeting-detected-popup.tsx b/apps/x/apps/renderer/src/components/meeting-detected-popup.tsx index 533f2cb3..75f555de 100644 --- a/apps/x/apps/renderer/src/components/meeting-detected-popup.tsx +++ b/apps/x/apps/renderer/src/components/meeting-detected-popup.tsx @@ -23,10 +23,24 @@ const SAIL_ICON = * floats on the card's top-left corner; the window itself is transparent. * Detection never records — the user has to click "Take notes". */ +// Opened directly in a browser (vite only, no Electron) there is no IPC +// bridge — render sample data so the popup can be styled with plain HMR. +// `?variant=calendar` previews the calendar-linked look. +const isPreview = typeof window.ipc === 'undefined' + export function MeetingDetectedPopup() { const [payload, setPayload] = useState(null) useEffect(() => { + if (isPreview) { + const calendar = new URLSearchParams(window.location.search).get('variant') === 'calendar' + setPayload( + calendar + ? { title: 'Weekly design sync', message: 'Chrome', hasCalendarEvent: true } + : { title: 'Meeting detected', message: 'Chrome', hasCalendarEvent: false }, + ) + return + } const cleanup = window.ipc.on('meetingDetect:payload', (next) => setPayload(next)) // The main process pushes on did-finish-load, but that can race this // listener's registration — fetch explicitly too. @@ -40,15 +54,24 @@ export function MeetingDetectedPopup() { }, []) const act = (action: 'take-notes' | 'dismiss') => { + if (isPreview) { + console.log(`[preview] action: ${action}`) + return + } void window.ipc.invoke('meetingDetect:action', { action }).catch(() => {}) } - return ( -
- {/* Close — floats over the card's top-left corner */} + // In the browser preview, reproduce the real popup window's exact size + // (448×96) on a desktop-ish backdrop; in Electron the window IS that size. + const popup = ( +
+ {/* Close — floats over the card's top-left corner, revealed on hover */} {/* Card */} -
-
+
-
+
{payload?.title ?? 'Meeting detected'}
-
+
{payload?.message ?? ''}
) + + if (!isPreview) return popup + return ( +
+ {popup} +
+ ) }