diff --git a/artifacts/tx-os/src/pages/executive-meetings.tsx b/artifacts/tx-os/src/pages/executive-meetings.tsx index 586f3543..fbdae0be 100644 --- a/artifacts/tx-os/src/pages/executive-meetings.tsx +++ b/artifacts/tx-os/src/pages/executive-meetings.tsx @@ -918,6 +918,15 @@ function ExecutiveMeetingsPageInner() { if (section !== "schedule" && isFullscreen) setIsFullscreen(false); }, [section, isFullscreen]); + // The schedule section publishes whether its bulk-action toolbar is + // currently visible (≥1 row selected in edit mode) so the page-level + // MeetingsQuickNoteTab can step out of the way while the user works + // with destructive bulk actions. + const [bulkToolbarActive, setBulkToolbarActive] = useState(false); + useEffect(() => { + if (section !== "schedule" && bulkToolbarActive) setBulkToolbarActive(false); + }, [section, bulkToolbarActive]); + // Lifted from ScheduleSection so the unified Settings tab can edit // the same column visibility / highlight state the schedule consumes. const [columns, setColumns] = useState(() => @@ -1026,7 +1035,7 @@ function ExecutiveMeetingsPageInner() { dir={isRtl ? "rtl" : "ltr"} style={{ ["--em-header-h" as string]: "0px", ["--em-heading-h" as string]: "0px" }} > - {section === "schedule" && !isFullscreen && ( + {section === "schedule" && !isFullscreen && !bulkToolbarActive && ( -
+
{section === "schedule" && ( )} {section === "manage" && me && ( @@ -1212,6 +1228,7 @@ function ScheduleSection({ lang = "en", isFullscreen = false, onFullscreenChange, + onBulkToolbarActiveChange, }: { meetings: Meeting[]; date: string; @@ -1229,6 +1246,7 @@ function ScheduleSection({ lang?: "ar" | "en"; isFullscreen?: boolean; onFullscreenChange?: (next: boolean) => void; + onBulkToolbarActiveChange?: (active: boolean) => void; }) { const qc = useQueryClient(); const { toast } = useToast(); @@ -1932,6 +1950,14 @@ function ScheduleSection({ for (const m of displayedMeetings) if (selectedMeetingIds.has(m.id)) n++; return n; }, [displayedMeetings, selectedMeetingIds]); + // Mirror the bulk toolbar's visibility condition (see the + // `effectiveCanMutate && visibleSelectedCount > 0` render below) up + // to the page so the floating quick-note tab can step aside while + // bulk actions are in progress. + const bulkToolbarVisible = effectiveCanMutate && visibleSelectedCount > 0; + useEffect(() => { + onBulkToolbarActiveChange?.(bulkToolbarVisible); + }, [bulkToolbarVisible, onBulkToolbarActiveChange]); const [bulkDeleting, setBulkDeleting] = useState(false); // Sequential bulk-delete progress (mirrors duplicate UX). const [bulkDeleteProgress, setBulkDeleteProgress] = useState< diff --git a/artifacts/tx-os/src/pages/notes.tsx b/artifacts/tx-os/src/pages/notes.tsx index 619d82b4..92f56a20 100644 --- a/artifacts/tx-os/src/pages/notes.tsx +++ b/artifacts/tx-os/src/pages/notes.tsx @@ -284,6 +284,16 @@ export default function NotesPage() { // navigation doesn't keep re-opening it. if (params.get("new") === "1") { setView("active"); + // The top Composer is only mounted when + // `view === "active" && folderSelection.kind !== "shared-folder"`. + // If the user arrived from /notes?new=1 while sitting inside a + // shared folder, leaving the selection alone would mean the + // Composer is never rendered and the open trigger would be lost. + // Reset to the default "all" folder so the composer is guaranteed + // visible regardless of where they were before. + setFolderSelection((cur) => + cur.kind === "shared-folder" ? { kind: "all" } : cur, + ); setComposerOpenTrigger((n) => n + 1); if (typeof window !== "undefined") { params.delete("new");