diff --git a/apps/desktop/src/components/editor-area/floating-button.tsx b/apps/desktop/src/components/editor-area/floating-button.tsx index 088ca7f817..e3aef9d0cb 100644 --- a/apps/desktop/src/components/editor-area/floating-button.tsx +++ b/apps/desktop/src/components/editor-area/floating-button.tsx @@ -74,6 +74,13 @@ export function FloatingButton({ const cancelEnhance = useOngoingSession((s) => s.cancelEnhance); const isEnhancePending = useEnhancePendingState(session.id); + const ongoingSessionStatus = useOngoingSession((s) => s.status); + const ongoingSessionId = useOngoingSession((s) => s.sessionId); + + const hasTranscript = session.words && session.words.length > 0; + const isSessionInactive = ongoingSessionStatus === "inactive" || session.id !== ongoingSessionId; + const canEnhanceTranscript = hasTranscript && isSessionInactive; + const localLlmBaseUrl = useQuery({ queryKey: ["local-llm"], queryFn: async () => { @@ -181,8 +188,10 @@ export function FloatingButton({ ); } - if (!session.enhanced_memo_html && !isEnhancePending) { - return null; + const shouldShowButton = session.enhanced_memo_html || isEnhancePending || canEnhanceTranscript; + + if (!shouldShowButton) { + return null; // don't show the button } const rawButtonClasses = cn( diff --git a/apps/desktop/src/components/editor-area/note-header/listen-button.tsx b/apps/desktop/src/components/editor-area/note-header/listen-button.tsx index a44252bfbd..ea8d542415 100644 --- a/apps/desktop/src/components/editor-area/note-header/listen-button.tsx +++ b/apps/desktop/src/components/editor-area/note-header/listen-button.tsx @@ -92,11 +92,17 @@ export default function ListenButton({ sessionId }: { sessionId: string }) { loading: s.loading, })); + const sessionWords = useSession(sessionId, (s) => s.session.words); + + // don't show consent notification if the session already has transcript useEffect(() => { - if (ongoingSessionStatus === "running_active" && sessionId === ongoingSessionId && !isOnboarding) { + if ( + ongoingSessionStatus === "running_active" && sessionId === ongoingSessionId && !isOnboarding + && sessionWords.length === 0 + ) { showConsentNotification(); } - }, [ongoingSessionStatus, sessionId, ongoingSessionId, isOnboarding]); + }, [ongoingSessionStatus, sessionId, ongoingSessionId, isOnboarding, sessionWords.length]); const isEnhancePending = useEnhancePendingState(sessionId); const nonEmptySession = useSession( diff --git a/apps/desktop/src/components/toolbar/bars/main-toolbar.tsx b/apps/desktop/src/components/toolbar/bars/main-toolbar.tsx index 2d2d41d6c4..54ae4aa3bc 100644 --- a/apps/desktop/src/components/toolbar/bars/main-toolbar.tsx +++ b/apps/desktop/src/components/toolbar/bars/main-toolbar.tsx @@ -44,7 +44,6 @@ export function MainToolbar() { - )} @@ -58,6 +57,7 @@ export function MainToolbar() { {isMain && ( <> {(organizationMatch || humanMatch) && } + {isNote && } diff --git a/apps/desktop/src/components/toolbar/buttons/new-note-button.tsx b/apps/desktop/src/components/toolbar/buttons/new-note-button.tsx index b3f4db9747..2f38088925 100644 --- a/apps/desktop/src/components/toolbar/buttons/new-note-button.tsx +++ b/apps/desktop/src/components/toolbar/buttons/new-note-button.tsx @@ -33,9 +33,8 @@ function ActualButton({ disabled }: { disabled: boolean }) {
@@ -268,11 +269,11 @@ function ShareButtonInNote() { const isSuccess = action.id === "copy" && copySuccess; return ( -
+
{expanded && ( -
+

{option.description}