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
Expand Up @@ -299,18 +299,42 @@ function RecordingControls({
sessionId: string;
onStop: () => void;
}) {
const { onboardingSessionId } = useHypr();
const { onboardingSessionId, userId } = useHypr();
const ongoingSessionMuted = useOngoingSession((s) => ({
micMuted: s.micMuted,
speakerMuted: s.speakerMuted,
}));

const toggleMicMuted = useMutation({
mutationFn: () => listenerCommands.setMicMuted(!ongoingSessionMuted.micMuted),
mutationFn: async () => {
const result = await listenerCommands.setMicMuted(!ongoingSessionMuted.micMuted);

// only send analytics when muting (not unmuting)
if (!ongoingSessionMuted.micMuted && userId) {
analyticsCommands.event({
event: "recording_mute_mic",
distinct_id: userId,
});
}

return result;
},
});

const toggleSpeakerMuted = useMutation({
mutationFn: () => listenerCommands.setSpeakerMuted(!ongoingSessionMuted.speakerMuted),
mutationFn: async () => {
const result = await listenerCommands.setSpeakerMuted(!ongoingSessionMuted.speakerMuted);

// only send analytics when muting (not unmuting)
if (!ongoingSessionMuted.speakerMuted && userId) {
analyticsCommands.event({
event: "recording_mute_system",
distinct_id: userId,
});
}

return result;
},
});

return (
Expand Down Expand Up @@ -396,6 +420,7 @@ function MicrophoneSelector({
onToggleMuted: () => void;
disabled?: boolean;
}) {
const { userId } = useHypr();
const [isOpen, setIsOpen] = useState(false);

const allDevicesQuery = useQuery({
Expand All @@ -411,6 +436,13 @@ function MicrophoneSelector({
const handleSelectDevice = (device: string) => {
listenerCommands.setMicrophoneDevice(device).then(() => {
currentDeviceQuery.refetch();

if (userId) {
analyticsCommands.event({
event: "recording_select_mic_trigger",
distinct_id: userId,
});
}
});
};

Expand Down Expand Up @@ -446,6 +478,14 @@ function MicrophoneSelector({
variant="outline"
className="rounded-l-none px-1.5 flex-shrink-0 h-10 transition-all hover:border-neutral-300 hover:bg-neutral-50"
disabled={disabled}
onClick={() => {
if (userId) {
analyticsCommands.event({
event: "recording_select_mic_option",
distinct_id: userId,
});
}
}}
>
<ChevronDownIcon className="w-4 h-4 text-neutral-600" />
</Button>
Expand Down
46 changes: 23 additions & 23 deletions apps/desktop/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ msgstr "Base Folder"
msgid "Base URL"
msgstr "Base URL"

#: src/routes/app.settings.tsx:58
#: src/routes/app.settings.tsx:112
#: src/routes/app.settings.tsx:61
#: src/routes/app.settings.tsx:134
msgid "Billing & License"
msgstr "Billing & License"

Expand All @@ -363,8 +363,8 @@ msgstr "Billing & License"
msgid "Built-in Templates"
msgstr "Built-in Templates"

#: src/routes/app.settings.tsx:48
#: src/routes/app.settings.tsx:102
#: src/routes/app.settings.tsx:51
#: src/routes/app.settings.tsx:124
msgid "Calendar"
msgstr "Calendar"

Expand Down Expand Up @@ -608,8 +608,8 @@ msgstr "Finish Onboarding"
msgid "Full name"
msgstr "Full name"

#: src/routes/app.settings.tsx:42
#: src/routes/app.settings.tsx:96
#: src/routes/app.settings.tsx:45
#: src/routes/app.settings.tsx:118
msgid "General"
msgstr "General"

Expand Down Expand Up @@ -643,8 +643,8 @@ msgid "Grant both permissions to continue"
msgstr "Grant both permissions to continue"

#: src/components/settings/views/help-support.tsx:33
#: src/routes/app.settings.tsx:62
#: src/routes/app.settings.tsx:116
#: src/routes/app.settings.tsx:65
#: src/routes/app.settings.tsx:138
msgid "Help & Support"
msgstr "Help & Support"

Expand All @@ -668,13 +668,13 @@ msgid "Important Q&As"
msgstr "Important Q&As"

#: src/components/settings/views/integrations.tsx:124
#: src/routes/app.settings.tsx:56
#: src/routes/app.settings.tsx:110
#: src/routes/app.settings.tsx:59
#: src/routes/app.settings.tsx:132
msgid "Integrations"
msgstr "Integrations"

#: src/routes/app.settings.tsx:44
#: src/routes/app.settings.tsx:98
#: src/routes/app.settings.tsx:47
#: src/routes/app.settings.tsx:120
msgid "Intelligence"
msgstr "Intelligence"

Expand Down Expand Up @@ -746,8 +746,8 @@ msgstr "Logs"
msgid "Make it public"
msgstr "Make it public"

#: src/routes/app.settings.tsx:60
#: src/routes/app.settings.tsx:114
#: src/routes/app.settings.tsx:63
#: src/routes/app.settings.tsx:136
msgid "MCP"
msgstr "MCP"

Expand Down Expand Up @@ -849,8 +849,8 @@ msgstr "No upcoming events with this contact"
msgid "None (disabled)"
msgstr "None (disabled)"

#: src/routes/app.settings.tsx:50
#: src/routes/app.settings.tsx:104
#: src/routes/app.settings.tsx:53
#: src/routes/app.settings.tsx:126
msgid "Notifications"
msgstr "Notifications"

Expand Down Expand Up @@ -1069,8 +1069,8 @@ msgstr "Show notifications when you join a meeting."
msgid "Some downloads failed, but you can continue"
msgstr "Some downloads failed, but you can continue"

#: src/routes/app.settings.tsx:54
#: src/routes/app.settings.tsx:108
#: src/routes/app.settings.tsx:57
#: src/routes/app.settings.tsx:130
msgid "Sound"
msgstr "Sound"

Expand All @@ -1086,7 +1086,7 @@ msgstr "Start automatically at login"
msgid "Start recording"
msgstr "Start recording"

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

Expand Down Expand Up @@ -1123,8 +1123,8 @@ msgstr "Team management features are currently under development and will be ava
msgid "Teamspace"
msgstr "Teamspace"

#: src/routes/app.settings.tsx:52
#: src/routes/app.settings.tsx:106
#: src/routes/app.settings.tsx:55
#: src/routes/app.settings.tsx:128
msgid "Templates"
msgstr "Templates"

Expand Down Expand Up @@ -1168,8 +1168,8 @@ msgstr "Toggle left sidebar"
msgid "Toggle transcript panel"
msgstr "Toggle transcript panel"

#: src/routes/app.settings.tsx:46
#: src/routes/app.settings.tsx:100
#: src/routes/app.settings.tsx:49
#: src/routes/app.settings.tsx:122
msgid "Transcription"
msgstr "Transcription"

Expand Down
46 changes: 23 additions & 23 deletions apps/desktop/src/locales/ko/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ msgstr ""
msgid "Base URL"
msgstr ""

#: src/routes/app.settings.tsx:58
#: src/routes/app.settings.tsx:112
#: src/routes/app.settings.tsx:61
#: src/routes/app.settings.tsx:134
msgid "Billing & License"
msgstr ""

Expand All @@ -363,8 +363,8 @@ msgstr ""
msgid "Built-in Templates"
msgstr ""

#: src/routes/app.settings.tsx:48
#: src/routes/app.settings.tsx:102
#: src/routes/app.settings.tsx:51
#: src/routes/app.settings.tsx:124
msgid "Calendar"
msgstr ""

Expand Down Expand Up @@ -603,8 +603,8 @@ msgstr ""
msgid "Full name"
msgstr ""

#: src/routes/app.settings.tsx:42
#: src/routes/app.settings.tsx:96
#: src/routes/app.settings.tsx:45
#: src/routes/app.settings.tsx:118
msgid "General"
msgstr ""

Expand Down Expand Up @@ -638,8 +638,8 @@ msgid "Grant both permissions to continue"
msgstr ""

#: src/components/settings/views/help-support.tsx:33
#: src/routes/app.settings.tsx:62
#: src/routes/app.settings.tsx:116
#: src/routes/app.settings.tsx:65
#: src/routes/app.settings.tsx:138
msgid "Help & Support"
msgstr ""

Expand All @@ -663,13 +663,13 @@ msgid "Important Q&As"
msgstr ""

#: src/components/settings/views/integrations.tsx:124
#: src/routes/app.settings.tsx:56
#: src/routes/app.settings.tsx:110
#: src/routes/app.settings.tsx:59
#: src/routes/app.settings.tsx:132
msgid "Integrations"
msgstr ""

#: src/routes/app.settings.tsx:44
#: src/routes/app.settings.tsx:98
#: src/routes/app.settings.tsx:47
#: src/routes/app.settings.tsx:120
msgid "Intelligence"
msgstr ""

Expand Down Expand Up @@ -741,8 +741,8 @@ msgstr ""
msgid "Make it public"
msgstr ""

#: src/routes/app.settings.tsx:60
#: src/routes/app.settings.tsx:114
#: src/routes/app.settings.tsx:63
#: src/routes/app.settings.tsx:136
msgid "MCP"
msgstr ""

Expand Down Expand Up @@ -844,8 +844,8 @@ msgstr ""
msgid "None (disabled)"
msgstr ""

#: src/routes/app.settings.tsx:50
#: src/routes/app.settings.tsx:104
#: src/routes/app.settings.tsx:53
#: src/routes/app.settings.tsx:126
msgid "Notifications"
msgstr ""

Expand Down Expand Up @@ -1064,8 +1064,8 @@ msgstr ""
msgid "Some downloads failed, but you can continue"
msgstr ""

#: src/routes/app.settings.tsx:54
#: src/routes/app.settings.tsx:108
#: src/routes/app.settings.tsx:57
#: src/routes/app.settings.tsx:130
msgid "Sound"
msgstr ""

Expand All @@ -1081,7 +1081,7 @@ msgstr ""
msgid "Start recording"
msgstr ""

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

Expand Down Expand Up @@ -1118,8 +1118,8 @@ msgstr ""
msgid "Teamspace"
msgstr ""

#: src/routes/app.settings.tsx:52
#: src/routes/app.settings.tsx:106
#: src/routes/app.settings.tsx:55
#: src/routes/app.settings.tsx:128
msgid "Templates"
msgstr ""

Expand Down Expand Up @@ -1163,8 +1163,8 @@ msgstr ""
msgid "Toggle transcript panel"
msgstr ""

#: src/routes/app.settings.tsx:46
#: src/routes/app.settings.tsx:100
#: src/routes/app.settings.tsx:49
#: src/routes/app.settings.tsx:122
msgid "Transcription"
msgstr ""

Expand Down
22 changes: 22 additions & 0 deletions apps/desktop/src/routes/app.settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import {
Sound,
TemplatesView,
} from "@/components/settings/views";
import { useHypr } from "@/contexts";
import { commands as analyticsCommands } from "@hypr/plugin-analytics";
import { cn } from "@hypr/ui/lib/utils";
import { useEffect } from "react";

const schema = z.object({
tab: z.enum(TABS.map(t => t.name) as [Tab, ...Tab[]]).default("general"),
Expand Down Expand Up @@ -85,6 +88,25 @@ function Component() {
const { t } = useLingui();
const navigate = useNavigate();
const search = useSearch({ from: PATH });
const { userId } = useHypr();

useEffect(() => {
if (userId) {
const eventMap = {
"general": "show_settings_window_general",
"ai-llm": "show_settings_window_intelligence",
"ai-stt": "show_settings_window_transcription",
};

const event = eventMap[search.tab as keyof typeof eventMap];
if (event) {
analyticsCommands.event({
event,
distinct_id: userId,
});
}
}
}, [search.tab, userId]);

const handleClickTab = (tab: Tab) => {
navigate({ to: PATH, search: { ...search, tab } });
Expand Down
Loading