Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

ui(meeting-notes): focused mode collapses sidebar, autoselects new meeting

Louis Beaumonta74a928b0e0a
diff --git a/apps/screenpipe-app-tauri/app/home/page.tsx b/apps/screenpipe-app-tauri/app/home/page.tsx
index 2b6869c1d..e0b6c8ebd 100644
--- a/apps/screenpipe-app-tauri/app/home/page.tsx
+++ b/apps/screenpipe-app-tauri/app/home/page.tsx
@@ -193,6 +193,26 @@ function HomeContent() {
});
}, []);
+ // Ephemeral collapse for focused workflows (e.g. taking notes during
+ // a meeting). Captures the user's prior sidebar state on enter and
+ // restores it on exit — never persisted to localStorage.
+ const sidebarPrevCollapsedRef = useRef<boolean | null>(null);
+ const handleMeetingFocusModeChange = useCallback(
+ (focused: boolean) => {
+ if (focused) {
+ if (sidebarPrevCollapsedRef.current === null) {
+ sidebarPrevCollapsedRef.current = sidebarCollapsed;
+ }
+ setSidebarCollapsed(true);
+ } else if (sidebarPrevCollapsedRef.current !== null) {
+ const prev = sidebarPrevCollapsedRef.current;
+ sidebarPrevCollapsedRef.current = null;
+ setSidebarCollapsed(prev);
+ }
+ },
+ [sidebarCollapsed],
+ );
+
// Cmd+B / Ctrl+B to toggle sidebar
useEffect(() => {
const handler = (e: KeyboardEvent) => {
@@ -473,6 +493,7 @@ function HomeContent() {
meetingState={meetingState}
meetingLoading={meetingLoading}
onToggleMeeting={toggleMeeting}
+ onFocusModeChange={handleMeetingFocusModeChange}
/>
);
case "help":
diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/index.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/index.tsx
index 828c4135e..08664df70 100644
--- a/apps/screenpipe-app-tauri/components/meeting-notes/index.tsx
+++ b/apps/screenpipe-app-tauri/components/meeting-notes/index.tsx
@@ -18,12 +18,20 @@ interface MeetingNotesSectionProps {
meetingState: MeetingStatusResponse & { manualActive: boolean };
meetingLoading: boolean;
onToggleMeeting: () => Promise<void> | void;
+ /**
+ * Called when the section enters or exits focused note mode.
+ * The host (HomeContent) collapses the sidebar on enter and
+ * restores prior state on exit so users get a distraction-free
+ * canvas while editing notes, then their normal layout back.
+ */
+ onFocusModeChange?: (focused: boolean) => void;
}
export function MeetingNotesSection({
meetingState,
meetingLoading,
onToggleMeeting,
+ onFocusModeChange,
}: MeetingNotesSectionProps) {
const [meetings, setMeetings] = useState<MeetingRecord[]>([]);
const [loading, setLoading] = useState(true);
@@ -73,16 +81,37 @@ export function MeetingNotesSection({
return () => document.removeEventListener("visibilitychange", handler);
}, [fetchPage]);
- // Refresh when active meeting transitions (start / stop)
+ // Refresh when active meeting transitions (start / stop). When the
+ // user just clicked "new meeting", `intendingToFocusRef` is set, so
+ // we drop them into the focused note view as soon as the backend
+ // assigns the row id (after the WS event arrives).
const lastActiveIdRef = useRef<number | null>(null);
+ const intendingToFocusRef = useRef(false);
useEffect(() => {
const active = meetingState.activeMeetingId ?? null;
if (active !== lastActiveIdRef.current) {
lastActiveIdRef.current = active;
- void fetchPage(0, false);
+ void fetchPage(0, false).then(() => {
+ if (active !== null && intendingToFocusRef.current) {
+ intendingToFocusRef.current = false;
+ setSelectedId(active);
+ }
+ });
}
}, [meetingState.activeMeetingId, fetchPage]);
+ // Notify host of focus-mode transitions so it can collapse the sidebar.
+ useEffect(() => {
+ onFocusModeChange?.(selectedId !== null);
+ }, [selectedId, onFocusModeChange]);
+
+ // Ensure we exit focus mode if the user navigates away entirely.
+ useEffect(() => {
+ return () => {
+ onFocusModeChange?.(false);
+ };
+ }, [onFocusModeChange]);
+
// If selection vanishes (deleted elsewhere), drop selection
useEffect(() => {
if (selectedId === null) return;
@@ -92,6 +121,7 @@ export function MeetingNotesSection({
const handleStart = useCallback(async () => {
if (meetingState.active) return;
+ intendingToFocusRef.current = true;
await onToggleMeeting();
}, [meetingState.active, onToggleMeeting]);
diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/list-view.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/list-view.tsx
index 071e9e033..3a52a8c27 100644
--- a/apps/screenpipe-app-tauri/components/meeting-notes/list-view.tsx
+++ b/apps/screenpipe-app-tauri/components/meeting-notes/list-view.tsx
@@ -96,31 +96,28 @@ export function ListView({
<div className="h-full overflow-y-auto">
<div className="max-w-3xl mx-auto px-12 py-12">
<header className="flex items-end justify-between mb-10">
- <div>
- <div className="text-[11px] uppercase tracking-[0.18em] text-muted-foreground mb-2">
- meeting notes
- </div>
- <h1 className="text-4xl font-medium tracking-tight">meetings</h1>
- </div>
- <Button
- variant="outline"
- size="sm"
- onClick={() => void onStart()}
- disabled={starting || activeId !== null}
- className="gap-2"
- title={
- activeId !== null
- ? "a meeting is already active"
- : "start a manual meeting"
- }
- >
- {starting ? (
- <Loader2 className="h-3.5 w-3.5 animate-spin" />
- ) : (
- <Plus className="h-3.5 w-3.5" />
- )}
- new meeting
- </Button>
+ <h1 className="text-4xl font-medium tracking-tight">meetings</h1>
+ {meetings.length > 0 && (
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => void onStart()}
+ disabled={starting || activeId !== null}
+ className="gap-2"
+ title={
+ activeId !== null
+ ? "a meeting is already active"
+ : "start a manual meeting"
+ }
+ >
+ {starting ? (
+ <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ ) : (
+ <Plus className="h-3.5 w-3.5" />
+ )}
+ new meeting
+ </Button>
+ )}
</header>
{errorText && (
@@ -311,8 +308,8 @@ function ListEmpty({
<div className="max-w-md">
<h2 className="text-lg font-medium mb-2">no meetings yet</h2>
<p className="text-sm text-muted-foreground mb-5 leading-relaxed">
- join a Zoom, Meet, or Teams call and screenpipe will detect it
- automatically. or start one manually to take notes against any
+ Join a Zoom, Meet, or Teams call and screenpipe will detect it
+ automatically. Or start one manually to take notes against any
conversation.
</p>
<Button