Skip to content

feat(ios): delete right after a dictation takes all of it back - #256

Open
dylan-duan-aai wants to merge 1 commit into
AssemblyAI:mainfrom
dylan-duan-aai:feat/ios-delete-last-dictation
Open

dylan-duan-aai wants to merge 1 commit into
AssemblyAI:mainfrom
dylan-duan-aai:feat/ios-delete-last-dictation

Conversation

@dylan-duan-aai

Copy link
Copy Markdown

Why

Dictations land as whole sentences, so clearing a bad one meant holding delete through it a character at a time (the keyboard's delete doesn't repeat yet).

What

  • resultArrived() remembers exactly what it inserted, separator included (lastInsertion).
  • deleteBackward() removes all of it in one tap when the text before the caret still ends with it and nothing is selected.
  • Any keystroke into the host clears it, so only the first delete is the big one. A moved caret, a selection, or a host whose documentContextBeforeInput is shorter than the dictation falls back to a one-character delete.
  • Applies to both the panel and full-keyboard delete keys (both call model.deleteBackward()).

Testing

  • New test deleteTakesBackDictation in ProtocolTests covers: whole dictation removed once then single characters, typing after a dictation, moved caret, and selection.
  • scripts/ios-test.sh: 145 passed, 0 failed; BlurtiOSCore line coverage 97.19% (gate 88%).
  • scripts/ios-typecheck.sh: ok.
  • Not yet tried by hand on a device.

🤖 Generated with Claude Code

Dictations land as whole sentences, so clearing a bad one meant holding
delete through it a character at a time. The keyboard now remembers what
the last result inserted (separator included); the next delete removes
all of it, provided the caret still sits at its end with nothing
highlighted. Any keystroke, a moved caret, a selection, or a host that
shows less context than the dictation falls back to a one-character
delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant