scribe-org / scribe-org/Scribe-iOS
Show closest word suggestion when translation or conjugation is invalid
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 169
- Forks
- 109
- PR merge metrics
- No merged PRs in 30d
Description
Terms
- I have searched open and closed feature requests
- I agree to follow Scribe-iOS' Code of Conduct
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing queryAutocompletions flow and invalid command handling in Translate.swift and Conjugate.swift. Then inspect CommandVariables.swift and KeyboardViewController.swift to see how command-bar state is represented and rendered. Done means invalid Translate and Conjugate inputs can show the closest matching word as a “Did you mean” suggestion without removing existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100