From fe44c0bb05d82aba4268a767c215eeef6720b3a2 Mon Sep 17 00:00:00 2001 From: Deokhaeng Lee Date: Mon, 11 Aug 2025 18:38:34 -0700 Subject: [PATCH 1/6] made floating button visibility logic more robust --- Cargo.lock | 2 +- .../src/components/editor-area/floating-button.tsx | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a5b84b59e..101e9e676 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10277,7 +10277,7 @@ dependencies = [ [[package]] name = "owhisper-server" -version = "0.0.2" +version = "0.0.3" dependencies = [ "agc", "aide", diff --git a/apps/desktop/src/components/editor-area/floating-button.tsx b/apps/desktop/src/components/editor-area/floating-button.tsx index 088ca7f81..c2141b094 100644 --- a/apps/desktop/src/components/editor-area/floating-button.tsx +++ b/apps/desktop/src/components/editor-area/floating-button.tsx @@ -73,6 +73,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"], @@ -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( From ec514a72891dcadd42ee978141f6961c4bdc67ef Mon Sep 17 00:00:00 2001 From: Deokhaeng Lee Date: Mon, 11 Aug 2025 18:47:20 -0700 Subject: [PATCH 2/6] disabled consent notifcation when resumed recording --- .../components/editor-area/note-header/listen-button.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 a44252bfb..44e6a250e 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,13 @@ export default function ListenButton({ sessionId }: { sessionId: string }) { loading: s.loading, })); + const sessionWords = useSession(sessionId, (s) => s.session.words); + 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( From 6b015327d071c4ef9b45af0fca1059e7c988d673 Mon Sep 17 00:00:00 2001 From: Deokhaeng Lee Date: Mon, 11 Aug 2025 19:01:15 -0700 Subject: [PATCH 3/6] added comment --- .../src/components/editor-area/note-header/listen-button.tsx | 1 + 1 file changed, 1 insertion(+) 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 44e6a250e..b012ca745 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 @@ -94,6 +94,7 @@ export default function ListenButton({ sessionId }: { sessionId: string }) { 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 && sessionWords.length === 0) { showConsentNotification(); From 481468d869b85632e9e95fa64c6ea6b2037acef0 Mon Sep 17 00:00:00 2001 From: Deokhaeng Lee Date: Mon, 11 Aug 2025 19:07:43 -0700 Subject: [PATCH 4/6] ran tests --- .../editor-area/floating-button.tsx | 8 ++++---- .../editor-area/note-header/listen-button.tsx | 7 +++++-- apps/desktop/src/locales/en/messages.po | 20 +++++++++---------- apps/desktop/src/locales/ko/messages.po | 20 +++++++++---------- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/apps/desktop/src/components/editor-area/floating-button.tsx b/apps/desktop/src/components/editor-area/floating-button.tsx index c2141b094..e3aef9d0c 100644 --- a/apps/desktop/src/components/editor-area/floating-button.tsx +++ b/apps/desktop/src/components/editor-area/floating-button.tsx @@ -73,10 +73,10 @@ 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; @@ -189,9 +189,9 @@ export function FloatingButton({ } const shouldShowButton = session.enhanced_memo_html || isEnhancePending || canEnhanceTranscript; - + if (!shouldShowButton) { - return null; // don't show the button + 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 b012ca745..ea8d54241 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 @@ -94,9 +94,12 @@ export default function ListenButton({ sessionId }: { sessionId: string }) { const sessionWords = useSession(sessionId, (s) => s.session.words); - // don't show consent notification if the session already has transcript + // don't show consent notification if the session already has transcript useEffect(() => { - if (ongoingSessionStatus === "running_active" && sessionId === ongoingSessionId && !isOnboarding && sessionWords.length === 0) { + if ( + ongoingSessionStatus === "running_active" && sessionId === ongoingSessionId && !isOnboarding + && sessionWords.length === 0 + ) { showConsentNotification(); } }, [ongoingSessionStatus, sessionId, ongoingSessionId, isOnboarding, sessionWords.length]); diff --git a/apps/desktop/src/locales/en/messages.po b/apps/desktop/src/locales/en/messages.po index 9aa382d5c..b18246a7e 100644 --- a/apps/desktop/src/locales/en/messages.po +++ b/apps/desktop/src/locales/en/messages.po @@ -268,9 +268,9 @@ msgstr "(Optional)" #. placeholder {0}: disabled ? "Wait..." : isHovered ? "Resume" : "Ended" #. placeholder {0}: disabled ? "Wait..." : "Play video" #: src/components/settings/views/templates.tsx:217 -#: src/components/editor-area/note-header/listen-button.tsx:216 -#: src/components/editor-area/note-header/listen-button.tsx:238 -#: src/components/editor-area/note-header/listen-button.tsx:258 +#: src/components/editor-area/note-header/listen-button.tsx:222 +#: src/components/editor-area/note-header/listen-button.tsx:244 +#: src/components/editor-area/note-header/listen-button.tsx:264 msgid "{0}" msgstr "{0}" @@ -1117,7 +1117,7 @@ msgstr "No recent notes for this organization" #~ msgid "No Template" #~ msgstr "No Template" -#: src/components/editor-area/note-header/listen-button.tsx:513 +#: src/components/editor-area/note-header/listen-button.tsx:519 msgid "No Template (Default)" msgstr "No Template (Default)" @@ -1197,7 +1197,7 @@ msgstr "Others" msgid "Owner" msgstr "Owner" -#: src/components/editor-area/note-header/listen-button.tsx:359 +#: src/components/editor-area/note-header/listen-button.tsx:365 msgid "Pause" msgstr "Pause" @@ -1280,7 +1280,7 @@ msgstr "Required to transcribe other people's voice during meetings" msgid "Required to transcribe your voice during meetings" msgstr "Required to transcribe your voice during meetings" -#: src/components/editor-area/note-header/listen-button.tsx:142 +#: src/components/editor-area/note-header/listen-button.tsx:148 msgid "Resume" msgstr "Resume" @@ -1293,7 +1293,7 @@ msgstr "Role" #~ msgid "Save and close" #~ msgstr "Save and close" -#: src/components/editor-area/note-header/listen-button.tsx:483 +#: src/components/editor-area/note-header/listen-button.tsx:489 msgid "Save current recording" msgstr "Save current recording" @@ -1434,11 +1434,11 @@ msgstr "Spoken languages" #~ msgid "Start Monthly Plan" #~ msgstr "Start Monthly Plan" -#: src/components/editor-area/note-header/listen-button.tsx:191 +#: src/components/editor-area/note-header/listen-button.tsx:197 msgid "Start recording" msgstr "Start recording" -#: src/components/editor-area/note-header/listen-button.tsx:460 +#: src/components/editor-area/note-header/listen-button.tsx:466 msgid "Stop" msgstr "Stop" @@ -1483,7 +1483,7 @@ msgstr "Team management features are currently under development and will be ava msgid "Teamspace" msgstr "Teamspace" -#: src/components/editor-area/note-header/listen-button.tsx:504 +#: src/components/editor-area/note-header/listen-button.tsx:510 msgid "Template" msgstr "Template" diff --git a/apps/desktop/src/locales/ko/messages.po b/apps/desktop/src/locales/ko/messages.po index 32a9588b4..52524a15e 100644 --- a/apps/desktop/src/locales/ko/messages.po +++ b/apps/desktop/src/locales/ko/messages.po @@ -268,9 +268,9 @@ msgstr "" #. placeholder {0}: disabled ? "Wait..." : isHovered ? "Resume" : "Ended" #. placeholder {0}: disabled ? "Wait..." : "Play video" #: src/components/settings/views/templates.tsx:217 -#: src/components/editor-area/note-header/listen-button.tsx:216 -#: src/components/editor-area/note-header/listen-button.tsx:238 -#: src/components/editor-area/note-header/listen-button.tsx:258 +#: src/components/editor-area/note-header/listen-button.tsx:222 +#: src/components/editor-area/note-header/listen-button.tsx:244 +#: src/components/editor-area/note-header/listen-button.tsx:264 msgid "{0}" msgstr "" @@ -1117,7 +1117,7 @@ msgstr "" #~ msgid "No Template" #~ msgstr "" -#: src/components/editor-area/note-header/listen-button.tsx:513 +#: src/components/editor-area/note-header/listen-button.tsx:519 msgid "No Template (Default)" msgstr "" @@ -1197,7 +1197,7 @@ msgstr "" msgid "Owner" msgstr "" -#: src/components/editor-area/note-header/listen-button.tsx:359 +#: src/components/editor-area/note-header/listen-button.tsx:365 msgid "Pause" msgstr "" @@ -1280,7 +1280,7 @@ msgstr "" msgid "Required to transcribe your voice during meetings" msgstr "" -#: src/components/editor-area/note-header/listen-button.tsx:142 +#: src/components/editor-area/note-header/listen-button.tsx:148 msgid "Resume" msgstr "" @@ -1293,7 +1293,7 @@ msgstr "" #~ msgid "Save and close" #~ msgstr "" -#: src/components/editor-area/note-header/listen-button.tsx:483 +#: src/components/editor-area/note-header/listen-button.tsx:489 msgid "Save current recording" msgstr "" @@ -1434,11 +1434,11 @@ msgstr "" #~ msgid "Start Monthly Plan" #~ msgstr "" -#: src/components/editor-area/note-header/listen-button.tsx:191 +#: src/components/editor-area/note-header/listen-button.tsx:197 msgid "Start recording" msgstr "" -#: src/components/editor-area/note-header/listen-button.tsx:460 +#: src/components/editor-area/note-header/listen-button.tsx:466 msgid "Stop" msgstr "" @@ -1483,7 +1483,7 @@ msgstr "" msgid "Teamspace" msgstr "" -#: src/components/editor-area/note-header/listen-button.tsx:504 +#: src/components/editor-area/note-header/listen-button.tsx:510 msgid "Template" msgstr "" From 7164771eefaf8b38fea315b05681bf00ac1e08da Mon Sep 17 00:00:00 2001 From: Deokhaeng Lee Date: Mon, 11 Aug 2025 23:00:43 -0700 Subject: [PATCH 5/6] wip.... --- .../src/components/toolbar/bars/main-toolbar.tsx | 2 +- .../components/toolbar/buttons/new-note-button.tsx | 3 +-- .../components/toolbar/buttons/share-button.tsx | 14 +++++++------- .../toolbar/buttons/transcript-panel-button.tsx | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/desktop/src/components/toolbar/bars/main-toolbar.tsx b/apps/desktop/src/components/toolbar/bars/main-toolbar.tsx index 2d2d41d6c..54ae4aa3b 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 b3f4db974..2f3808892 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 }) { handleExport(action.id)} disabled={exportMutation.isPending} - className="w-full flex items-center justify-between p-3 hover:bg-gray-50 transition-colors disabled:opacity-50" + className="w-full flex items-center justify-between p-3 hover:bg-white" >
@@ -297,7 +297,7 @@ function ShareButtonInNote() { return (
toggleExpanded(option.id)} >
@@ -309,7 +309,7 @@ function ShareButtonInNote() {
{expanded && ( -
+

{option.description}

{expanded && ( -
+

{option.description}