Skip to content

Commit f0fd062

Browse files
fix(desktop): keyboard-started annotation dictation keeps the comment focused
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ed9c5eb commit f0fd062

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎apps/desktop/src/preview/PickPreload.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ function startAnnotation(
744744
}
745745
const recording = state.phase === "recording";
746746
const active = state.phase !== "idle" && state.phase !== "error";
747+
const restoreCommentFocus = active && shadowRoot.activeElement === voiceButton;
747748
voiceButton.hidden = !state.available || active;
748749
voiceButton.disabled = voiceBusy;
749750
const label = voiceSettings ? "Open voice settings" : "Start voice input";
@@ -753,6 +754,7 @@ function startAnnotation(
753754
// An active dictation takes the textarea's place; it stays focused (sr-only) so Enter still attaches.
754755
voiceRow.hidden = state.phase === "idle" || active;
755756
comment.classList.toggle("sr-only", active);
757+
if (restoreCommentFocus) comment.focus({ preventScroll: true });
756758
composerRow.classList.toggle("flex-wrap", active);
757759
// Re-inserting on every level update would blur a focused Finish or Cancel.
758760
if (active && voicePill.parentElement !== composerRow) comment.after(voicePill);

0 commit comments

Comments
 (0)