GeezerVison is showing github.com — fix(web): make first-run dictation setup discoverable by juliusmarminge · Pull Request #32197 · pingdotgg/t3code
fix(web): make first-run dictation setup discoverable
#32197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement . We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b861b80
fix(web): make first-run voice setup reachable
voltcrash Nov 6, 2026
aa4a427
test(voice): first-run mic and settings reach voice setup
juliusmarminge Nov 6, 2026
7ca4c07
fix(voice): first-run mic and settings reach voice setup
juliusmarminge Nov 6, 2026
7ce3d70
fix(voice): respect Off and reveal the first setup transcript
juliusmarminge Nov 6, 2026
2b38e1b
fix(voice): integrate the first-run dictation takeover
juliusmarminge Nov 6, 2026
55a6af8
fix(voice): keep explicit Off through first-run cloud setup
juliusmarminge Nov 6, 2026
e21adf5
fix(web): read the current model from the resolved audio choice
juliusmarminge Nov 6, 2026
778421d
fix(web): refresh the model card after its setup download
juliusmarminge Nov 6, 2026
94a285b
test(voice): make sure setup never opens the microphone
juliusmarminge Nov 6, 2026
986061b
Merge the cloud dictation logo fix into first-run setup
juliusmarminge Nov 7, 2026
dd03ff2
fix(web): remove the extra setup step from the voice model list
juliusmarminge Nov 7, 2026
6d79ff4
docs(voice): clarify where the first-run shortcut opens settings
juliusmarminge Nov 7, 2026
File filter
Filter by extension
.ts
(2)
.tsx
(3)
All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
fix(voice): respect Off and reveal the first setup transcript
Loading branch information
Uh oh!
There was an error while loading. Please reload this page.
commit 7ce3d70dec9c896d8715b72f19a9ca8eb495c58d
There are no files selected for viewing
Original file line number
Diff line number
Diff line change
Expand Up
@@ -14,12 +14,14 @@ import {
useVoiceTranscriptionDestination,
} from "../../speech/useEnvironmentSpeechInput";
import { chooseAudioDestination, chooseTranscriptCleanup } from "../../speech/voiceConsent";
import { useEnvironmentScope } from "../../state/session";
import { toastManager } from "../ui/toast";
import { SettingsScopeProvider } from "./SettingsScopeContext";
import { SpeechLanguageSelect } from "./SpeechLanguageSelect";
import { VoiceSettingsPanel } from "./VoiceSettingsPanel";
vi.mock(import("../../speech/useEnvironmentSpeechInput"), { spy: true });
vi.mock(import("../../state/session"), { spy: true });
it("preserves the model test transcript when its model is filtered out", async () => {
const target = new PrimaryConnectionTarget({
Expand Down
Expand Up
@@ -209,6 +211,8 @@ it("opens the selected model's setup wizard before it is downloaded or listed",
return fetch(input, init);
});
using mocks = new DisposableStack();
mocks.defer(() => vi.mocked(useEnvironmentScope).mockReset());
vi.mocked(useEnvironmentScope).mockReturnValue(true);
mocks.defer(() => vi.mocked(useVoiceTranscriptionDestination).mockReset());
mocks.defer(() => vi.mocked(useEnvironmentSpeechInput).mockReset());
vi.mocked(useVoiceTranscriptionDestination).mockImplementation(() => ({
Expand All
@@ -218,23 +222,27 @@ it("opens the selected model's setup wizard before it is downloaded or listed",
prepared,
}));
// Mirrors the hook: starting with a missing model opens the wizard instead of recording.
vi.mocked(useEnvironmentSpeechInput).mockImplementation(() => {
vi.mocked(useEnvironmentSpeechInput).mockImplementation((input ) => {
const [open, setOpen] = useState(false);
const [ready, setReady] = useState(false);
return {
available: true,
status,
transcriptionEnvironmentId: target.environmentId,
transcriptionEnvironmentLabel: target.label,
setup: {
open,
step: 0,
step: ready ? 1 : 0,
model,
downloading: false,
error: null,
setOpen,
download: async () => {} ,
download: async () => setReady(true) ,
cancelDownload: async () => {},
startRecording: async () => {},
startRecording: async () => {
input.commitDraft("microphone test", { start: 15, end: 15 });
setOpen(false);
},
},
state: { phase: "idle", error: null, errorAction: null },
preview: null,
Expand All
@@ -257,6 +265,11 @@ it("opens the selected model's setup wizard before it is downloaded or listed",
await expect.element(screen.getByText("Bilingual", { exact: true })).toBeVisible();
await userEvent.click(screen.getByRole("button", { name: /set up voice input/i }));
await expect.element(screen.getByRole("dialog", { name: "Set up voice input" })).toBeVisible();
await userEvent.click(screen.getByRole("button", { name: "Download model" }));
await userEvent.click(screen.getByRole("button", { name: "Start dictating" }));
await expect
.element(screen.getByRole("status", { name: "Test transcript" }))
.toHaveTextContent("microphone test");
});
it("recovers from a failed download progress poll without notifying, but reports a failed initial load", async () => {
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -864,6 +864,10 @@ function SpeechModelBrowser(props: {
key={model.id}
card={card}
hidden={!sortedModels.includes(model)}
revealModel={() => {
setSearch("");
setSelection([]);
}}
environmentId={props.testEnvironmentId}
projectId={props.projectId}
projectName={props.projectName}
Expand All
@@ -884,6 +888,7 @@ function SpeechModelBrowser(props: {
function TranscriptionTest(props: {
readonly card: ModelCardProps;
readonly hidden: boolean;
readonly revealModel: () => void;
readonly environmentId: EnvironmentId;
readonly projectId: ProjectId | null;
readonly projectName: string | null;
Expand Down
Expand Up
@@ -1006,7 +1011,11 @@ function TranscriptionTest(props: {
onOpenChange={speech.setup.setOpen}
onDownload={() => void speech.setup.download()}
onCancelDownload={() => void speech.setup.cancelDownload()}
onStartRecording={() => void speech.setup.startRecording()}
onStartRecording={() => {
if (props.hidden) props.revealModel();
setShowTranscript(true);
void speech.setup.startRecording();
}}
/>
</>
);
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -167,6 +167,7 @@ const THREAD_ENV = "thread-env";
function setup(options: { readonly destination?: string | null } = {}) {
mocks.settings = {};
setDestination(options.destination ?? null);
if (!options.destination) localStorage.removeItem("t3code:voice-audio-grant:v1");
chooseTranscriptCleanup(false);
mocks.primaryEnvironmentId = "primary-env";
mocks.connected = new Set(["primary-env", THREAD_ENV, "env-a", "env-b"]);
Expand Down
Expand Up
@@ -297,6 +298,7 @@ it.each([
expect(mocks.voice.state.phase).toBe("recording");
setDestination(next);
await screen.rerender(<Probe />);
if (next === null) expect(mocks.voice.available).toBe(false);
expect(mocks.voice.state.phase).toBe("idle");
await act(() => mocks.voice.stop());
expect(mocks.transcribeCalls).toEqual([]);
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -38,7 +38,7 @@ import { runtime } from "../lib/runtime";
import { useEnvironment } from "../state/environments";
import { useEnvironmentScope, usePreparedConnection } from "../state/session";
import { createBrowserVoiceInputPlatform } from "./browserVoiceInput";
import { bindAudioGrant, readCleanupGrant, useAudioGrant } from "./voiceConsent";
import { bindAudioGrant, readCleanupGrant, useAudioChoice } from "./voiceConsent";
const INITIAL_STATE: VoiceInputState = { phase: "idle", error: null, errorAction: null };
const WAITING_STATE: VoiceInputState = { phase: "preparing", error: null, errorAction: null };
Expand Down
Expand Up
@@ -110,13 +110,15 @@ type HookInput = {
*/
export function useVoiceTranscriptionDestination() {
const hydrated = useClientSettingsHydrated();
const grant = useAudioGrant();
const choice = useAudioChoice();
const grant = choice === "off" ? null : choice;
const environmentId = hydrated && grant ? grant.destination.environmentId : null;
const environment = useEnvironment(environmentId);
const connection = Option.getOrNull(usePreparedConnection(environmentId));
const canDictate = useEnvironmentScope(environmentId, AuthOrchestrationOperateScope);
const supported = environment?.serverConfig?.environment.capabilities.voiceTranscription === true;
return {
...(hydrated && choice === null ? { offerFirstRunSetup: true } : {}),
environmentId,
grantId: grant?.id ?? null,
label: environment?.label ?? null,
Expand Down
Expand Up
@@ -433,7 +435,7 @@ export function useEnvironmentSpeechInput(input: HookInput) {
const start = useStableCallback(async (options?: { readonly setupOnly?: boolean }) => {
if (latestRef.current.input.disabled) return;
if (!grantId) {
if (latestRef.current.input.offerSetup !== false)
if (destination.offerFirstRunSetup && latestRef.current.input.offerSetup !== false)
await navigate({ to: "/settings/voice", hash: "voice-transcription-destination" });
return;
}
Expand Down
Expand Up
@@ -530,7 +532,7 @@ export function useEnvironmentSpeechInput(input: HookInput) {
const destinationReady =
grantId === null
? input.offerSetup !== false
? Boolean(destination.offerFirstRunSetup) && input.offerSetup !== false
: prepared !== null && status?.prepared === prepared && status.value?.supported !== false;
return {
available:
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -14,18 +14,19 @@ const AudioGrant = Schema.NullOr(
Schema.Struct({ id: Schema.String, destination: VoiceTranscriptionDestination }),
);
const CleanupGrant = Schema.NullOr(Schema.String);
const AudioChoice = Schema.Union([AudioGrant, Schema.Literal("off")]);
const decodeAudioGrant = Schema.decodeSync(Schema.fromJsonString(AudioGrant));
export function useAudioGrant () {
return useLocalStorage(AUDIO_KEY, null, AudioGrant )[0];
export function useAudioChoice () {
return useLocalStorage(AUDIO_KEY, null, AudioChoice )[0];
}
export function chooseAudioDestination(destination: VoiceTranscriptionDestination | null) {
writeLocalStorageValue(
AUDIO_KEY,
destination && { id: randomUUID(), destination },
destination ? { id: randomUUID(), destination } : "off" ,
null,
AudioGrant ,
AudioChoice ,
);
}
Expand Down
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.