Terms
Description
Summary
When a user enters a word that isn't found during Translate or Conjugate, Scribe currently shows a generic "invalid" error with no further guidance. Users are left with no idea whether they made a typo or the word simply doesn't exist in the database.
Problem
The invalid state (commandState = .invalid) gives zero actionable feedback. A user who types "hause" instead of "Haus" gets the same error as someone who types complete nonsense — no distinction, no hint.
Proposed Solution
Reuse the existing queryAutocompletions infrastructure to find the closest matching word when a command returns invalid, and display it in the command bar as:
"Did you mean: Haus?"
This covers both Translate and Conjugate commands since both already funnel through commandState = .invalid.
Affected Files
| File |
Change |
Translate.swift |
Surface closest match on invalid result |
Conjugate.swift |
Surface closest match on invalid result |
CommandVariables.swift |
State handling for "did you mean" display |
KeyboardViewController.swift |
Render suggestion in command bar |
Notes
LanguageDBManager.shared.queryAutocompletions(word:) already returns close matches — no new DB queries needed
- Purely additive, no existing logic removed
- Strings can be hard-coded for now pending i18n entry
Terms
Description
Summary
When a user enters a word that isn't found during Translate or Conjugate, Scribe currently shows a generic "invalid" error with no further guidance. Users are left with no idea whether they made a typo or the word simply doesn't exist in the database.
Problem
The invalid state (
commandState = .invalid) gives zero actionable feedback. A user who types "hause" instead of "Haus" gets the same error as someone who types complete nonsense — no distinction, no hint.Proposed Solution
Reuse the existing
queryAutocompletionsinfrastructure to find the closest matching word when a command returns invalid, and display it in the command bar as:This covers both Translate and Conjugate commands since both already funnel through
commandState = .invalid.Affected Files
Translate.swiftConjugate.swiftCommandVariables.swiftKeyboardViewController.swiftNotes
LanguageDBManager.shared.queryAutocompletions(word:)already returns close matches — no new DB queries needed