Skip to content

Commit a277542

Browse files
committed
update seed
1 parent b745627 commit a277542

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

apps/desktop/src/components/right-panel/views/transcript-view.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,21 @@
11
import { useQuery, useQueryClient } from "@tanstack/react-query";
2-
import { useMatch } from "@tanstack/react-router";
32
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
4-
import { ClipboardCopyIcon, EarIcon, FileAudioIcon, Loader2Icon } from "lucide-react";
3+
import { CheckIcon, ClipboardCopyIcon, EarIcon, FileAudioIcon, PencilIcon } from "lucide-react";
54
import { useEffect, useRef } from "react";
65

6+
import { commands as dbCommands } from "@hypr/plugin-db";
77
import { commands as miscCommands } from "@hypr/plugin-misc";
88
import { commands as windowsCommands, events as windowsEvents } from "@hypr/plugin-windows";
99
import { Button } from "@hypr/ui/components/ui/button";
1010
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@hypr/ui/components/ui/tooltip";
1111
import { useOngoingSession, useSessions } from "@hypr/utils/contexts";
12-
import { CheckIcon, PencilIcon } from "lucide-react";
1312
import { useTranscript } from "../hooks/useTranscript";
1413
import { useTranscriptWidget } from "../hooks/useTranscriptWidget";
1514

1615
export function TranscriptView() {
17-
const noteMatch = useMatch({ from: "/app/note/$id", shouldThrow: false });
1816
const queryClient = useQueryClient();
1917
const transcriptContainerRef = useRef<HTMLDivElement>(null);
2018

21-
if (!noteMatch) {
22-
return (
23-
<div className="flex items-center justify-center h-full">
24-
<div className="text-sm text-neutral-500">
25-
Widgets are only available in note view.
26-
</div>
27-
</div>
28-
);
29-
}
30-
3119
const sessionId = useSessions((s) => s.currentSessionId);
3220
const isInactive = useOngoingSession((s) => s.status === "inactive");
3321
const { showEmptyMessage, isEnhanced, hasTranscript } = useTranscriptWidget(sessionId);
@@ -40,6 +28,11 @@ export function TranscriptView() {
4028
}
4129
};
4230

31+
const isOnboarding = useQuery({
32+
queryKey: ["onboarding"],
33+
queryFn: () => dbCommands.onboardingSessionId().then((v) => v === sessionId),
34+
});
35+
4336
const audioExist = useQuery(
4437
{
4538
refetchInterval: 2500,
@@ -141,7 +134,7 @@ export function TranscriptView() {
141134
</Tooltip>
142135
</TooltipProvider>
143136
)}
144-
{!isLive && (
137+
{!isLive && !isOnboarding.data && (
145138
<Button variant="ghost" size="icon" className="p-0" onClick={handleClickToggleEditing}>
146139
{editing.data
147140
? <CheckIcon size={16} className="text-black" />

crates/db-user/src/init.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,16 @@ pub async fn seed(db: &UserDatabase, user_id: impl Into<String>) -> Result<(), c
380380
"**Action Items**\n- Send proposal by EOD Friday",
381381
)
382382
.unwrap(),
383+
enhanced_memo_html: Some(
384+
hypr_buffer::opinionated_md_to_html(
385+
"**Action Items**\n- Send proposal by EOD Friday",
386+
)
387+
.unwrap(),
388+
),
389+
words: serde_json::from_str::<Vec<hypr_listener_interface::Word>>(
390+
&hypr_data::english_4::WORDS_JSON,
391+
)
392+
.unwrap(),
383393
..new_default_session(&user.id)
384394
},
385395
// Last week, not linked, untitled

packages/tiptap/src/transcript/nodes.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface Speaker {
99
}
1010

1111
export const createSpeakerNode = (speakers: Speaker[]) => {
12-
const defaultSpeaker = speakers[0];
12+
const defaultSpeaker = speakers.length > 0 ? speakers[0] : null;
1313

1414
return Node.create({
1515
name: "speaker",
@@ -18,15 +18,15 @@ export const createSpeakerNode = (speakers: Speaker[]) => {
1818
addAttributes() {
1919
return {
2020
speakerId: {
21-
default: defaultSpeaker.id,
21+
default: defaultSpeaker?.id,
2222
parseHTML: element => {
2323
const speakerId = element.getAttribute("data-speaker-id");
24-
return speakerId && speakers.some(s => s.id === speakerId) ? speakerId : defaultSpeaker.id;
24+
return speakerId && speakers.some(s => s.id === speakerId) ? speakerId : defaultSpeaker?.id;
2525
},
2626
renderHTML: attributes => {
2727
const speakerId = speakers.some(s => s.id === attributes.speakerId)
2828
? attributes.speakerId
29-
: defaultSpeaker.id;
29+
: defaultSpeaker?.id;
3030
return { "data-speaker-id": speakerId };
3131
},
3232
},
@@ -43,7 +43,7 @@ export const createSpeakerNode = (speakers: Speaker[]) => {
4343
const speakerIds = (node.attrs.speakers || []).map((s: Speaker) => s.id);
4444
const speakerId = node.attrs.speakerId && speakerIds.includes(node.attrs.speakerId)
4545
? node.attrs.speakerId
46-
: defaultSpeaker.id;
46+
: defaultSpeaker?.id;
4747

4848
return [
4949
"div",

0 commit comments

Comments
 (0)