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
4 changes: 2 additions & 2 deletions apps/desktop/src/components/command-palette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ export function CommandPalette({ open, onOpenChange }: CommandPaletteProps) {
const style = document.createElement("style");
style.textContent = `
[role="dialog"][aria-modal="true"] {
width: 800px !important;
max-width: 90vw !important;
width: 590px !important;
max-width: 80vw !important;
}
`;
document.head.appendChild(style);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { z } from "zod";
import SoundIndicator from "@/components/sound-indicator";
import { useHypr } from "@/contexts";
import { useEnhancePendingState } from "@/hooks/enhance-pending";
import { commands as analyticsCommands } from "@hypr/plugin-analytics";
import { commands as dbCommands } from "@hypr/plugin-db";
import { commands as listenerCommands } from "@hypr/plugin-listener";
import { commands as localSttCommands } from "@hypr/plugin-local-stt";
Expand Down Expand Up @@ -49,7 +50,7 @@ const showConsentNotification = () => {
};

export default function ListenButton({ sessionId, isCompact = false }: { sessionId: string; isCompact?: boolean }) {
const { onboardingSessionId } = useHypr();
const { onboardingSessionId, userId } = useHypr();
const isOnboarding = sessionId === onboardingSessionId;

const ongoingSessionStatus = useOngoingSession((s) => s.status);
Expand Down Expand Up @@ -100,6 +101,14 @@ export default function ListenButton({ sessionId, isCompact = false }: { session
if (isOnboarding) {
listenerCommands.setMicMuted(true);
}

if (!isOnboarding && userId) {
analyticsCommands.event({
event: "recording_start_session",
distinct_id: userId,
properties: { session_id: sessionId },
});
}
}
};

Expand Down Expand Up @@ -234,6 +243,7 @@ function WhenInactiveAndMeetingEndedOnboarding({ disabled, onClick }: { disabled
}

function WhenActive({ sessionId }: { sessionId: string }) {
const { userId } = useHypr();
const ongoingSessionId = useOngoingSession((s) => s.sessionId);
const ongoingSessionStore = useOngoingSession((s) => ({
stop: s.stop,
Expand All @@ -249,6 +259,14 @@ function WhenActive({ sessionId }: { sessionId: string }) {
if (sessionWords.length === 0) {
sonnerToast.dismiss("recording-consent-reminder");
}

if (userId) {
analyticsCommands.event({
event: "recording_stop_session",
distinct_id: userId,
properties: { session_id: sessionId },
});
}
};

return (
Expand Down
33 changes: 25 additions & 8 deletions apps/desktop/src/components/right-panel/views/transcript-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
ChevronDownIcon,
ClipboardIcon,
CopyIcon,
PencilIcon,
TextSearchIcon,
UploadIcon,
} from "lucide-react";
Expand All @@ -18,6 +17,7 @@ import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
import { ParticipantList } from "@/components/editor-area/note-header/chips/participants-chip";
import { useHypr } from "@/contexts";
import { useContainerWidth } from "@/hooks/use-container-width";
import { commands as analyticsCommands } from "@hypr/plugin-analytics";
import { commands as dbCommands, Human, Word2 } from "@hypr/plugin-db";
import { commands as miscCommands } from "@hypr/plugin-misc";
import TranscriptEditor, {
Expand Down Expand Up @@ -94,6 +94,7 @@ function RenderInMeeting({ words }: { words: Word2[] }) {
}

function RenderNotInMeeting({ sessionId, words }: { sessionId: string; words: Word2[] }) {
const { userId } = useHypr();
const queryClient = useQueryClient();

const [editable, setEditable] = useState(false);
Expand Down Expand Up @@ -169,11 +170,18 @@ function RenderNotInMeeting({ sessionId, words }: { sessionId: string; words: Wo
});
}
});
} else {
if (userId) {
analyticsCommands.event({
event: "transcript_toggle_edit",
distinct_id: userId,
});
}
}

return !v;
});
}, [editorWords]);
}, [editorWords, userId]);

const handleUpdate = (words: Word2[]) => {
setEditorWords(words);
Expand Down Expand Up @@ -214,14 +222,14 @@ function RenderNotInMeeting({ sessionId, words }: { sessionId: string; words: Wo
const EditToggle = () => {
return (
<Button
className="w-6 h-6"
className="px-2 py-0.5 h-6 bg-neutral-50 hover:bg-neutral-100 border border-neutral-200"
variant="ghost"
size="icon"
size="sm"
onClick={handeToggleEdit}
>
{editable
? <CheckIcon size={12} className="text-neutral-600" />
: <PencilIcon size={12} className="text-neutral-600" />}
<span className="text-2xs text-neutral-600 font-normal">
{editable ? "Save" : "Edit"}
</span>
</Button>
);
};
Expand All @@ -231,7 +239,9 @@ function RenderNotInMeeting({ sessionId, words }: { sessionId: string; words: Wo
<header className="flex items-center justify-between w-full px-4 py-1 my-1 border-b">
<div className="flex items-center">
<h2 className="text-sm font-semibold text-neutral-900">Transcript</h2>
<EditToggle />
<div className="ml-2">
<EditToggle />
</div>
</div>
<div className="not-draggable flex items-center">
<Button
Expand Down Expand Up @@ -517,6 +527,13 @@ const MemoizedSpeakerSelector = memo(({
onClick={() => {
onSpeakerChange(candidate, speakerRange);
setIsOpen(false);

if (userId) {
analyticsCommands.event({
event: "transcript_speaker_change",
distinct_id: userId,
});
}
}}
>
Apply Speaker Change
Expand Down
10 changes: 5 additions & 5 deletions apps/desktop/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ msgstr "(Optional)"
#. placeholder {0}: disabled ? "Wait..." : "Play again"
#. placeholder {0}: disabled ? "Wait..." : "Play video"
#. placeholder {0}: disabled ? "Wait..." : isHovered ? (isCompact ? "Resume" : "Resume") : (isCompact ? "Ended" : "Ended")
#: src/components/editor-area/note-header/listen-button.tsx:187
#: src/components/editor-area/note-header/listen-button.tsx:211
#: src/components/editor-area/note-header/listen-button.tsx:231
#: src/components/editor-area/note-header/listen-button.tsx:196
#: src/components/editor-area/note-header/listen-button.tsx:220
#: src/components/editor-area/note-header/listen-button.tsx:240
#: src/components/settings/views/templates.tsx:253
msgid "{0}"
msgstr "{0}"
Expand Down Expand Up @@ -1082,11 +1082,11 @@ msgstr "Spoken languages"
msgid "Start automatically at login"
msgstr "Start automatically at login"

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

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

Expand Down
10 changes: 5 additions & 5 deletions apps/desktop/src/locales/ko/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ msgstr ""
#. placeholder {0}: disabled ? "Wait..." : "Play again"
#. placeholder {0}: disabled ? "Wait..." : "Play video"
#. placeholder {0}: disabled ? "Wait..." : isHovered ? (isCompact ? "Resume" : "Resume") : (isCompact ? "Ended" : "Ended")
#: src/components/editor-area/note-header/listen-button.tsx:187
#: src/components/editor-area/note-header/listen-button.tsx:211
#: src/components/editor-area/note-header/listen-button.tsx:231
#: src/components/editor-area/note-header/listen-button.tsx:196
#: src/components/editor-area/note-header/listen-button.tsx:220
#: src/components/editor-area/note-header/listen-button.tsx:240
#: src/components/settings/views/templates.tsx:253
msgid "{0}"
msgstr ""
Expand Down Expand Up @@ -1077,11 +1077,11 @@ msgstr ""
msgid "Start automatically at login"
msgstr ""

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

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

Expand Down
Loading