GeezerVison is showing github.com — fix: address dictation review findings · pingdotgg/t3code@a77b317
File treeExpand file treeCollapse file tree Open diff view settings apps/web/src/components/settings client-runtime/src/voice-input
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/settings/DictationSettings.tsx +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -288,7 +288,12 @@ function InactiveDictationModels(props: { | 288 | 288 | const [removing, setRemoving] = useState<DictationModel["id"] | null>(null); | 289 | 289 | if (!state?.supported) return null; | 290 | 290 | const inactive = state.models.filter( | 291 | | - (model) => model.install._tag === "installed" && model.id !== props.selectedModel, | | 291 | + // The environment keeps its own active model even when another environment's | | 292 | + // selection is shown; removing it would be a no-op on the server. | | 293 | + (model) => | | 294 | + model.install._tag === "installed" && | | 295 | + model.id !== props.selectedModel && | | 296 | + model.id !== state.settings.localModel, | 292 | 297 | ); | 293 | 298 | if (inactive.length === 0) return null; | 294 | 299 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/client-runtime/src/voice-input/controller.test.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -159,6 +159,10 @@ describe("resolveTranscriptCommit", () => { | 159 | 159 | expect(resolveTranscriptCommit(empty, empty, "ok then", "<|en|>")).toMatchObject({ | 160 | 160 | text: "Ok then", | 161 | 161 | }); | | 162 | + const beforeLowercase = at("before release", 0); | | 163 | + expect( | | 164 | + resolveTranscriptCommit(beforeLowercase, beforeLowercase, "Fix the bug.", "en-US"), | | 165 | + ).toMatchObject({ text: "Fix the bug before release" }); | 162 | 166 | const continuing = at("Fix the bug before release.", 11); | 163 | 167 | expect( | 164 | 168 | resolveTranscriptCommit(continuing, continuing, "And check the tests.", "en-US"), | |
Collapse file Copy file name to clipboardExpand all lines: packages/client-runtime/src/voice-input/controller.ts +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -119,7 +119,7 @@ export function resolveTranscriptCommit( | 119 | 119 | // Models transcribe each recording as its own sentence. Fit that sentence to | 120 | 120 | // where it lands: capitalize at the start of the draft, a line, or a | 121 | 121 | // sentence; mid-sentence, drop the leading capital (English only, where | 122 | | - // nouns are not capitalized) and a final period when the sentence goes on. | | 122 | + // nouns are not capitalized). Drop a final period when the sentence goes on. | 123 | 123 | // A first word with other capitals ("iOS") or "I" is kept as spoken. | 124 | 124 | const atSentenceStart = /(^|[.!?]\s*|\n\s*)$/.test( | 125 | 125 | captured.text.slice(0, captured.selection.start), | @@ -133,9 +133,9 @@ export function resolveTranscriptCommit( | 133 | 133 | if (usesEnglishSpacing && plainCapitalized) { | 134 | 134 | insertion = withFirstLetterCase(insertion, locale, false); | 135 | 135 | } | 136 | | - if (/^\s*\p{Ll}/u.test(captured.text.slice(captured.selection.end))) { | 137 | | - insertion = insertion.replace(/[.!?]$/u, ""); | 138 | | - } | | 136 | + } | | 137 | + if (/^\s*\p{Ll}/u.test(captured.text.slice(captured.selection.end))) { | | 138 | + insertion = insertion.replace(/[.!?]$/u, ""); | 139 | 139 | } | 140 | 140 | if (isEmptySelection && usesEnglishSpacing) { | 141 | 141 | const left = captured.text[captured.selection.start - 1]; | |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/src/inlineSkills.test.ts +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -25,6 +25,12 @@ describe("replaceSpokenSkills", () => { | 25 | 25 | "run $postplan-read on it", | 26 | 26 | ); | 27 | 27 | expect(replaceSpokenSkills("dollar review please", skills)).toBe("$review please"); | | 28 | + const overlapping = [ | | 29 | + { name: "bug", displayName: undefined }, | | 30 | + { name: "fix-bug", displayName: undefined }, | | 31 | + ]; | | 32 | + expect(replaceSpokenSkills("use the fix bug skill", overlapping)).toBe("use $fix-bug"); | | 33 | + expect(replaceSpokenSkills("use the bug skill", overlapping)).toBe("use $bug"); | 28 | 34 | }); | 29 | 35 |
| 30 | 36 | it("leaves unanchored words and unknown skills alone", () => { | |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/src/inlineSkills.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -105,7 +105,8 @@ export function replaceSpokenSkills(text: string, skills: readonly InlineSkill[] | 105 | 105 | if (!word || word.start < consumedUntil || word.letters.length === 0) break; | 106 | 106 | spoken = step === 1 ? spoken + word.letters : word.letters + spoken; | 107 | 107 | const match = closestSpokenSkill(spoken, skills); | 108 | | - if (match && (best === null || match.distance < best.distance)) { | | 108 | + // Spans grow word by word, so on a tie the longer name wins ("fix bug" over "bug"). | | 109 | + if (match && (best === null || match.distance <= best.distance)) { | 109 | 110 | best = { | 110 | 111 | ...match, | 111 | 112 | first: step === 1 ? from : index, | |
|