Skip to content

Commit a820f59

Browse files
authored
replace timeline with words (#820)
1 parent bdd7285 commit a820f59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+57291
-4631
lines changed

Cargo.lock

Lines changed: 19 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ hypr-chunker = { path = "crates/chunker", package = "chunker" }
3333
hypr-data = { path = "crates/data", package = "data" }
3434
hypr-db-admin = { path = "crates/db-admin", package = "db-admin" }
3535
hypr-db-core = { path = "crates/db-core", package = "db-core" }
36+
hypr-db-script = { path = "crates/db-script", package = "db-script" }
3637
hypr-db-user = { path = "crates/db-user", package = "db-user" }
3738
hypr-detect = { path = "crates/detect", package = "detect" }
38-
hypr-diart = { path = "crates/diart", package = "diart" }
3939
hypr-file = { path = "crates/file", package = "file" }
4040
hypr-gbnf = { path = "crates/gbnf", package = "gbnf" }
4141
hypr-gguf = { path = "crates/gguf", package = "gguf" }
@@ -53,7 +53,6 @@ hypr-s3 = { path = "crates/s3", package = "s3" }
5353
hypr-slack = { path = "crates/slack", package = "slack" }
5454
hypr-stt = { path = "crates/stt", package = "stt", features = ["realtime", "recorded"] }
5555
hypr-template = { path = "crates/template", package = "template" }
56-
hypr-timeline = { path = "crates/timeline", package = "timeline" }
5756
hypr-turso = { path = "crates/turso", package = "turso" }
5857
hypr-vad = { path = "crates/vad", package = "vad" }
5958
hypr-whisper = { path = "crates/whisper", package = "whisper" }

apps/app/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"@clerk/types": "^4.59.0",
1515
"@hypr/client": "workspace:^",
1616
"@tailwindcss/typography": "^0.5.16",
17-
"@tanstack/router-plugin": "^1.120.3",
17+
"@tanstack/router-plugin": "^1.120.5",
1818
"@types/react": "^18.3.21",
1919
"@types/react-dom": "^18.3.7",
2020
"@vitejs/plugin-react": "^4.4.1",
2121
"autoprefixer": "^10.4.21",
22-
"msw": "^2.8.2",
22+
"msw": "^2.8.3",
2323
"postcss": "^8.5.3",
2424
"tailwindcss": "^3.4.17",
2525
"typescript": "^5.8.3",
@@ -34,8 +34,8 @@
3434
"@remixicon/react": "^4.6.0",
3535
"@sentry/react": "^8.55.0",
3636
"@tanstack/react-query": "^5.76.1",
37-
"@tanstack/react-router": "^1.120.3",
38-
"@tanstack/zod-adapter": "^1.120.3",
37+
"@tanstack/react-router": "^1.120.5",
38+
"@tanstack/zod-adapter": "^1.120.5",
3939
"clsx": "^2.1.1",
4040
"lucide-react": "^0.487.0",
4141
"react": "^18.3.1",

apps/desktop/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
"@sentry/react": "^8.55.0",
5151
"@tanstack/react-query": "^5.76.1",
5252
"@tanstack/react-query-devtools": "^5.76.1",
53-
"@tanstack/react-router": "^1.120.3",
54-
"@tanstack/react-router-devtools": "^1.120.3",
55-
"@tanstack/zod-adapter": "^1.120.3",
53+
"@tanstack/react-router": "^1.120.5",
54+
"@tanstack/react-router-devtools": "^1.120.5",
55+
"@tanstack/zod-adapter": "^1.120.5",
5656
"@tauri-apps/api": "^2.5.0",
5757
"@tauri-apps/plugin-clipboard-manager": "^2.2.2",
5858
"@tauri-apps/plugin-dialog": "^2.2.1",
@@ -73,10 +73,10 @@
7373
"react": "^18.3.1",
7474
"react-dom": "^18.3.1",
7575
"react-grid-layout": "^1.5.1",
76-
"react-hook-form": "^7.56.3",
76+
"react-hook-form": "^7.56.4",
7777
"react-hotkeys-hook": "^4.6.2",
7878
"react-resizable": "^3.0.5",
79-
"react-scan": "^0.3.3",
79+
"react-scan": "^0.3.4",
8080
"sonner": "^1.7.4",
8181
"tailwind-merge": "^2.6.0",
8282
"tauri-plugin-sentry-api": "^0.4.1",
@@ -85,12 +85,12 @@
8585
"zustand": "^5.0.4"
8686
},
8787
"devDependencies": {
88-
"@eslint/js": "^9.26.0",
88+
"@eslint/js": "^9.27.0",
8989
"@lingui/babel-plugin-lingui-macro": "^5.3.1",
9090
"@lingui/cli": "^5.3.1",
9191
"@lingui/vite-plugin": "^5.3.1",
9292
"@mux/mux-player": "^3.4.0",
93-
"@tanstack/router-plugin": "^1.120.3",
93+
"@tanstack/router-plugin": "^1.120.5",
9494
"@tauri-apps/cli": "^2.5.0",
9595
"@types/node": "^22.15.18",
9696
"@types/react": "^18.3.21",
@@ -104,7 +104,7 @@
104104
"@wdio/spec-reporter": "^8.43.0",
105105
"@wdio/types": "^8.41.0",
106106
"autoprefixer": "^10.4.21",
107-
"eslint": "^9.26.0",
107+
"eslint": "^9.27.0",
108108
"eslint-plugin-lingui": "^0.9.0",
109109
"eslint-plugin-react": "^7.37.5",
110110
"globals": "^15.15.0",

apps/desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ tauri-plugin-apple-calendar = { path = "../../../plugins/apple-calendar" }
2727
[dependencies]
2828
hypr-data = { workspace = true, optional = true }
2929
hypr-db-core = { workspace = true }
30+
hypr-db-script = { workspace = true }
3031
hypr-db-user = { workspace = true }
3132
hypr-turso = { workspace = true }
3233

apps/desktop/src/components/editor-area/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ export function useEnhanceMutation({
180180
mutationKey: ["enhance", sessionId],
181181
mutationFn: async () => {
182182
const fn = sessionId === onboardingSessionId
183-
? dbCommands.getTimelineViewOnboarding
184-
: dbCommands.getTimelineView;
183+
? dbCommands.getWordsOnboarding
184+
: dbCommands.getWords;
185185

186-
const timeline = await fn(sessionId);
186+
const words = await fn(sessionId);
187187

188-
if (!timeline?.items.length) {
188+
if (!words.length) {
189189
toast({
190190
id: "short-timeline",
191191
title: "Recording too short",
@@ -212,7 +212,7 @@ export function useEnhanceMutation({
212212
{
213213
type,
214214
editor: rawContent,
215-
timeline,
215+
words,
216216
participants,
217217
},
218218
);

apps/desktop/src/components/right-panel/hooks/useTranscript.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useMemo, useState } from "react";
22

33
import { commands as dbCommands } from "@hypr/plugin-db";
4-
import { events as listenerEvents, type TimelineView } from "@hypr/plugin-listener";
4+
import { events as listenerEvents, type Word } from "@hypr/plugin-listener";
55
import { useOngoingSession, useSession } from "@hypr/utils/contexts";
66

77
export function useTranscript(sessionId: string | null) {
@@ -19,13 +19,13 @@ export function useTranscript(sessionId: string | null) {
1919
sessionId,
2020
]);
2121

22-
const [timeline, setTimeline] = useState<TimelineView | null>(null);
22+
const [words, setWords] = useState<Word[]>([]);
2323
const [selectedLanguage, setSelectedLanguage] = useState<string>("en");
2424
const [isLoading, setIsLoading] = useState<boolean>(false);
2525

2626
useEffect(() => {
2727
if (!sessionId) {
28-
setTimeline(null);
28+
setWords([]);
2929
return;
3030
}
3131

@@ -34,11 +34,11 @@ export function useTranscript(sessionId: string | null) {
3434
try {
3535
const onboardingSessionId = await dbCommands.onboardingSessionId();
3636
const fn = (sessionId === onboardingSessionId && isEnhanced)
37-
? dbCommands.getTimelineViewOnboarding
38-
: dbCommands.getTimelineView;
37+
? dbCommands.getWordsOnboarding
38+
: dbCommands.getWords;
3939

40-
const timeline = await fn(sessionId);
41-
setTimeline(timeline);
40+
const words = await fn(sessionId);
41+
setWords(words);
4242
} finally {
4343
setIsLoading(false);
4444
}
@@ -55,8 +55,8 @@ export function useTranscript(sessionId: string | null) {
5555
let unlisten: (() => void) | null = null;
5656

5757
listenerEvents.sessionEvent.listen(({ payload }) => {
58-
if (payload.type === "timelineView") {
59-
setTimeline(payload.view);
58+
if (payload.type === "words") {
59+
setWords((words) => [...words, ...payload.words]);
6060
}
6161
}).then((fn) => {
6262
unlisten = fn;
@@ -74,7 +74,7 @@ export function useTranscript(sessionId: string | null) {
7474
};
7575

7676
return {
77-
timeline,
77+
words,
7878
isLive,
7979
selectedLanguage,
8080
handleLanguageChange,

apps/desktop/src/components/right-panel/hooks/useTranscriptWidget.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { useSession } from "@hypr/utils/contexts";
22
import { useTranscript } from "./useTranscript";
33

44
export function useTranscriptWidget(sessionId: string | null) {
5-
const { timeline, isLive, selectedLanguage, handleLanguageChange, isLoading } = useTranscript(sessionId);
5+
const { words, isLive, selectedLanguage, handleLanguageChange, isLoading } = useTranscript(sessionId);
66
const isEnhanced = sessionId ? useSession(sessionId, (s) => !!s.session.enhanced_memo_html) : false;
77

8-
const hasTranscript = timeline?.items && timeline.items.length > 0;
8+
const hasTranscript = words.length > 0;
99
const isSessionActive = sessionId && (hasTranscript || isLive);
1010

1111
const showEmptyMessage = sessionId && !hasTranscript && !isLive && !isLoading;
1212

1313
return {
14-
timeline,
14+
words,
1515
isLive,
1616
selectedLanguage,
1717
handleLanguageChange,

0 commit comments

Comments
 (0)