Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions apps/desktop/src/components/editor-area/floating-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/components/toolbar/bars/main-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export function MainToolbar() {
<LeftSidebarButton type="toolbar" />
<NewNoteButton />
<DeleteNoteButton />
<ShareButton />
</>
)}
</div>
Expand All @@ -58,6 +57,7 @@ export function MainToolbar() {
{isMain && (
<>
{(organizationMatch || humanMatch) && <NewWindowButton />}
{isNote && <ShareButton />}
<ChatPanelButton />
<TranscriptPanelButton />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ function ActualButton({ disabled }: { disabled: boolean }) {
<TooltipTrigger asChild>
<Button
disabled={disabled}
variant="ghost"
size="icon"
className="hover:bg-neutral-200"
className="hover:bg-neutral-200 bg-transparent text-black"
onClick={createNewNote}
aria-label="New Note"
>
Expand Down
35 changes: 25 additions & 10 deletions apps/desktop/src/components/toolbar/buttons/share-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from "@tauri-apps/api/path";
import { message } from "@tauri-apps/plugin-dialog";
import { fetch as tauriFetch } from "@tauri-apps/plugin-http";
import { openPath, openUrl } from "@tauri-apps/plugin-opener";
import { BookText, Check, ChevronDown, ChevronUp, Copy, FileText, HelpCircle, Mail, Share2Icon } from "lucide-react";
import { BookText, Check, ChevronDown, ChevronUp, Copy, FileText, HelpCircle, Mail, Share } from "lucide-react";
import { useState } from "react";

import { useHypr } from "@/contexts";
Expand Down Expand Up @@ -239,15 +239,16 @@ function ShareButtonInNote() {
disabled={!hasEnhancedNote}
variant="ghost"
size="icon"
className="hover:bg-neutral-200"
className={`hover:bg-neutral-200 ${open ? "bg-neutral-200" : ""}`}
aria-label="Share"
>
<Share2Icon className="size-4" />
<Share className="size-4" />
</Button>
</PopoverTrigger>
<PopoverContent
className="w-80 p-3 focus:outline-none focus:ring-0 focus:ring-offset-0"
align="end"
sideOffset={7}
>
<div className="space-y-3">
<div>
Expand All @@ -268,11 +269,11 @@ function ShareButtonInNote() {
const isSuccess = action.id === "copy" && copySuccess;

return (
<div key={action.id} className="border rounded-lg overflow-hidden">
<div key={action.id} className="border border-gray-200 rounded-lg overflow-hidden bg-white">
<button
onClick={() => 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 bg-white hover:bg-gray-50 transition-colors disabled:opacity-50"
>
<div className="flex items-center space-x-3">
<div className={`text-gray-700 transition-colors ${isSuccess ? "text-green-600" : ""}`}>
Expand All @@ -295,9 +296,11 @@ function ShareButtonInNote() {
const expanded = expandedId === option.id;

return (
<div key={option.id} className="border rounded-lg overflow-hidden">
<div key={option.id} className="border border-gray-200 rounded-lg overflow-hidden bg-white">
<div
className="flex items-center justify-between p-3 cursor-pointer hover:bg-gray-50 transition-colors"
className={`flex items-center justify-between p-3 cursor-pointer transition-colors ${
expanded ? "bg-white" : "bg-white hover:bg-gray-50"
}`}
onClick={() => toggleExpanded(option.id)}
>
<div className="flex items-center space-x-3">
Expand All @@ -309,7 +312,7 @@ function ShareButtonInNote() {
</button>
</div>
{expanded && (
<div className="px-3 pb-3 pt-2 border-t bg-gray-50">
<div className="px-3 pb-3 pt-2 border-t border-gray-100 bg-white">
<div className="flex items-center gap-1 mb-3">
<p className="text-xs text-gray-600">{option.description}</p>
<button
Expand Down Expand Up @@ -362,7 +365,7 @@ function ShareButtonInNote() {
<button
onClick={() => handleExport(option.id)}
disabled={exportMutation.isPending}
className="w-full py-1.5 bg-gray-800 text-white rounded-md hover:bg-gray-900 transition-colors text-xs font-medium disabled:opacity-50"
className="w-full py-1.5 bg-black text-white rounded-md hover:bg-gray-800 transition-all text-xs font-medium disabled:opacity-50"
>
{exportMutation.isPending
? "Pending..."
Expand Down Expand Up @@ -436,7 +439,19 @@ const exportHandlers = {
},

email: async (session: Session): Promise<ExportResult> => {
const url = `mailto:?subject=${encodeURIComponent(session.title)}`;
let bodyContent = "Here is the meeting summary: \n\n";

if (session.enhanced_memo_html) {
bodyContent += html2md(session.enhanced_memo_html);
} else if (session.raw_memo_html) {
bodyContent += html2md(session.raw_memo_html);
} else {
bodyContent += "No content available";
}

bodyContent += "\n\nSent with Hyprnote (www.hyprnote.com)\n\n";

const url = `mailto:?subject=${encodeURIComponent(session.title)}&body=${encodeURIComponent(bodyContent)}`;
return { type: "email", url };
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function TranscriptPanelButton() {
</TooltipTrigger>
<TooltipContent>
<p>
<Trans>Toggle widget panel</Trans> <Shortcut macDisplay="⌘R" windowsDisplay="Ctrl+R" />
<Trans>Toggle transcriptpanel</Trans> <Shortcut macDisplay="⌘R" windowsDisplay="Ctrl+R" />
</p>
</TooltipContent>
</Tooltip>
Expand Down
30 changes: 17 additions & 13 deletions apps/desktop/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down Expand Up @@ -634,7 +634,7 @@ msgstr "Create"
#~ msgid "Create agenda"
#~ msgstr "Create agenda"

#: src/components/toolbar/buttons/new-note-button.tsx:47
#: src/components/toolbar/buttons/new-note-button.tsx:46
msgid "Create new note"
msgstr "Create new note"

Expand Down Expand Up @@ -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)"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand All @@ -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"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -1536,8 +1536,12 @@ msgid "Toggle left sidebar"
msgstr "Toggle left sidebar"

#: src/components/toolbar/buttons/transcript-panel-button.tsx:36
msgid "Toggle widget panel"
msgstr "Toggle widget panel"
msgid "Toggle transcriptpanel"
msgstr "Toggle transcriptpanel"

#: src/components/toolbar/buttons/transcript-panel-button.tsx:36
#~ msgid "Toggle widget panel"
#~ msgstr "Toggle widget panel"

#: src/components/settings/components/ai/stt-view-local.tsx:249
#~ msgid "Transcribing"
Expand Down
28 changes: 16 additions & 12 deletions apps/desktop/src/locales/ko/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down Expand Up @@ -634,7 +634,7 @@ msgstr ""
#~ msgid "Create agenda"
#~ msgstr ""

#: src/components/toolbar/buttons/new-note-button.tsx:47
#: src/components/toolbar/buttons/new-note-button.tsx:46
msgid "Create new note"
msgstr ""

Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand All @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -1536,9 +1536,13 @@ msgid "Toggle left sidebar"
msgstr ""

#: src/components/toolbar/buttons/transcript-panel-button.tsx:36
msgid "Toggle widget panel"
msgid "Toggle transcriptpanel"
msgstr ""

#: src/components/toolbar/buttons/transcript-panel-button.tsx:36
#~ msgid "Toggle widget panel"
#~ msgstr ""

#: src/components/settings/components/ai/stt-view-local.tsx:249
#~ msgid "Transcribing"
#~ msgstr ""
Expand Down
Loading