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
8 changes: 8 additions & 0 deletions apps/desktop/src/session/components/note-input/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,12 @@ describe("NoteInput tab selection", () => {

expect(screen.getByTestId("is-transcribing").textContent).toBe("true");
});

it("keeps the transcript spinner while batch transcription is running", () => {
hoisted.sessionMode = "running_batch";

renderNoteInput();

expect(screen.getByTestId("is-transcribing").textContent).toBe("true");
});
});
7 changes: 6 additions & 1 deletion apps/desktop/src/session/components/note-input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { Transcript } from "./transcript";
import { useCaretNearBottom } from "~/session/components/caret-position-context";
import { useCurrentNoteTab } from "~/session/components/shared";
import { useScrollPreservation } from "~/shared/hooks/useScrollPreservation";
import type { SessionMode } from "~/store/zustand/listener/general";
import { type Tab, useTabs } from "~/store/zustand/tabs";
import { type EditorView as TabEditorView } from "~/store/zustand/tabs/schema";
import { useListener } from "~/stt/contexts";
Expand All @@ -37,6 +38,10 @@ export interface NoteInputHandle {
prepareForTabChange: () => void;
}

export function shouldShowTranscriptTabSpinner(sessionMode: SessionMode) {
return sessionMode === "finalizing" || sessionMode === "running_batch";
}

export const NoteInput = forwardRef<
NoteInputHandle,
{
Expand Down Expand Up @@ -90,7 +95,7 @@ export const NoteInput = forwardRef<
sessionMode === "finalizing" ||
sessionMode === "running_batch";
const shouldShowTranscriptSpinner =
sessionMode === "finalizing" || sessionMode === "running_batch";
shouldShowTranscriptTabSpinner(sessionMode);

const { scrollRef, onBeforeTabChange } = useScrollPreservation(
renderedCurrentTab.type === "enhanced"
Expand Down
11 changes: 6 additions & 5 deletions apps/desktop/src/session/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { commands as fsSyncCommands } from "@hypr/plugin-fs-sync";

import { CaretPositionProvider } from "./components/caret-position-context";
import { FloatingActionButton } from "./components/floating";
import { NoteInput, type NoteInputHandle } from "./components/note-input";
import {
NoteInput,
shouldShowTranscriptTabSpinner,
type NoteInputHandle,
} from "./components/note-input";
import {
Header as NoteInputHeader,
useEditorTabs,
Expand Down Expand Up @@ -130,10 +134,7 @@ function TabContentNoteInner({
const sessionId = tab.id;
const { skipReason } = useAutoEnhance(tab);
const sessionMode = useListener((state) => state.getSessionMode(sessionId));
const isTranscribing =
sessionMode === "active" ||
sessionMode === "finalizing" ||
sessionMode === "running_batch";
const isTranscribing = shouldShowTranscriptTabSpinner(sessionMode);
useAutoFocusTitle({ sessionId, noteInputRef });
usePendingUpload(sessionId);

Expand Down
Loading