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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Trans } from "@lingui/react/macro";
import { useMutation, useQuery } from "@tanstack/react-query";
import { MicIcon, MicOffIcon, PauseIcon, PlayIcon, StopCircleIcon, Volume2Icon, VolumeOffIcon } from "lucide-react";
import { useState } from "react";
import { useEffect, useState } from "react";

import SoundIndicator from "@/components/sound-indicator";
import { useHypr } from "@/contexts";
Expand All @@ -11,11 +11,30 @@ import { commands as localSttCommands } from "@hypr/plugin-local-stt";
import { Button } from "@hypr/ui/components/ui/button";
import { Popover, PopoverContent, PopoverTrigger } from "@hypr/ui/components/ui/popover";
import { Spinner } from "@hypr/ui/components/ui/spinner";
import { sonnerToast, toast } from "@hypr/ui/components/ui/toast";
import { Tooltip, TooltipContent, TooltipTrigger } from "@hypr/ui/components/ui/tooltip";
import { cn } from "@hypr/ui/lib/utils";
import { useOngoingSession, useSession } from "@hypr/utils/contexts";
import ShinyButton from "./shiny-button";

const showConsentNotification = () => {
toast({
id: "recording-consent-reminder",
title: "🔴 Recording Started",
content: "Don't forget to notify others that you're recording this session for transparency and consent.",
buttons: [
{
label: "I've notified everyone",
onClick: () => {
sonnerToast.dismiss("recording-consent-reminder");
},
primary: true,
},
],
dismissible: false,
});
};

export default function ListenButton({ sessionId }: { sessionId: string }) {
const { onboardingSessionId } = useHypr();
const isOnboarding = sessionId === onboardingSessionId;
Expand All @@ -40,6 +59,12 @@ export default function ListenButton({ sessionId }: { sessionId: string }) {
loading: s.loading,
}));

useEffect(() => {
if (ongoingSessionStatus === "running_active" && sessionId === ongoingSessionId && !isOnboarding) {
showConsentNotification();
}
}, [ongoingSessionStatus, sessionId, ongoingSessionId, isOnboarding]);

const isEnhancePending = useEnhancePendingState(sessionId);
const nonEmptySession = useSession(
sessionId,
Expand Down
14 changes: 7 additions & 7 deletions apps/desktop/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ msgstr "(Beta) Upcoming meeting notifications"
#. placeholder {0}: disabled ? "Wait..." : isHovered ? "Resume" : "Ended"
#: src/components/settings/components/calendar/cloud-calendar-integration-details.tsx:36
#: src/components/settings/components/ai/wer-modal.tsx:116
#: src/components/editor-area/note-header/listen-button.tsx:151
#: src/components/editor-area/note-header/listen-button.tsx:190
#: src/components/editor-area/note-header/listen-button.tsx:176
#: src/components/editor-area/note-header/listen-button.tsx:215
msgid "{0}"
msgstr "{0}"

Expand Down Expand Up @@ -860,7 +860,7 @@ msgstr "Optional for participant suggestions"
msgid "Owner"
msgstr "Owner"

#: src/components/editor-area/note-header/listen-button.tsx:277
#: src/components/editor-area/note-header/listen-button.tsx:302
msgid "Pause"
msgstr "Pause"

Expand All @@ -872,7 +872,7 @@ msgstr "people"
msgid "Performance difference between languages"
msgstr "Performance difference between languages"

#: src/components/editor-area/note-header/listen-button.tsx:170
#: src/components/editor-area/note-header/listen-button.tsx:195
msgid "Play video"
msgstr "Play video"

Expand Down Expand Up @@ -916,7 +916,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:79
#: src/components/editor-area/note-header/listen-button.tsx:104
msgid "Resume"
msgstr "Resume"

Expand Down Expand Up @@ -1006,11 +1006,11 @@ msgstr "Start Annual Plan"
msgid "Start Monthly Plan"
msgstr "Start Monthly Plan"

#: src/components/editor-area/note-header/listen-button.tsx:126
#: src/components/editor-area/note-header/listen-button.tsx:151
msgid "Start recording"
msgstr "Start recording"

#: src/components/editor-area/note-header/listen-button.tsx:285
#: src/components/editor-area/note-header/listen-button.tsx:310
msgid "Stop"
msgstr "Stop"

Expand Down
14 changes: 7 additions & 7 deletions apps/desktop/src/locales/ko/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ msgstr ""
#. placeholder {0}: disabled ? "Wait..." : isHovered ? "Resume" : "Ended"
#: src/components/settings/components/calendar/cloud-calendar-integration-details.tsx:36
#: src/components/settings/components/ai/wer-modal.tsx:116
#: src/components/editor-area/note-header/listen-button.tsx:151
#: src/components/editor-area/note-header/listen-button.tsx:190
#: src/components/editor-area/note-header/listen-button.tsx:176
#: src/components/editor-area/note-header/listen-button.tsx:215
msgid "{0}"
msgstr ""

Expand Down Expand Up @@ -860,7 +860,7 @@ msgstr ""
msgid "Owner"
msgstr ""

#: src/components/editor-area/note-header/listen-button.tsx:277
#: src/components/editor-area/note-header/listen-button.tsx:302
msgid "Pause"
msgstr ""

Expand All @@ -872,7 +872,7 @@ msgstr ""
msgid "Performance difference between languages"
msgstr ""

#: src/components/editor-area/note-header/listen-button.tsx:170
#: src/components/editor-area/note-header/listen-button.tsx:195
msgid "Play video"
msgstr ""

Expand Down Expand Up @@ -916,7 +916,7 @@ msgstr ""
msgid "Required to transcribe your voice during meetings"
msgstr ""

#: src/components/editor-area/note-header/listen-button.tsx:79
#: src/components/editor-area/note-header/listen-button.tsx:104
msgid "Resume"
msgstr ""

Expand Down Expand Up @@ -1006,11 +1006,11 @@ msgstr ""
msgid "Start Monthly Plan"
msgstr ""

#: src/components/editor-area/note-header/listen-button.tsx:126
#: src/components/editor-area/note-header/listen-button.tsx:151
msgid "Start recording"
msgstr ""

#: src/components/editor-area/note-header/listen-button.tsx:285
#: src/components/editor-area/note-header/listen-button.tsx:310
msgid "Stop"
msgstr ""

Expand Down