Fix emoji suggestions: show last in panel, never auto-select - #13
Open
iamshakibali wants to merge 1 commit into
Open
iamshakibali wants to merge 1 commit into
iamshakibali wants to merge 1 commit into
Conversation
- Reorder candidate panel: word candidates keep riti's ranking, emoji candidates are appended at the end of the list. - Emoji are never auto-selected: if riti's remembered/top selection lands on an emoji, selection moves to the first word candidate. Emoji are only committed by explicit user action (arrow keys, Tab, number key, or click). - Map display <-> engine indices everywhere riti is called (key handling, marked text, commit, remembered selection) so navigation and commits stay consistent with the new order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
While typing, emoji candidates from the riti engine were (a) shown at the front of the candidate panel and (b) auto-selected as the default — so pressing space would commit an emoji instead of the relevant word.
Changes (Lekho/Sources/InputController.swift)
isEmojiCandidate(_:)helper detects emoji-only candidates (pure emoji/symbol content); anything containing Bengali or Latin letters/digits is treated as a word candidate.avoidEmojiDefault()step moves the default selection to the first word candidate whenever riti's remembered/top selection lands on an emoji. Emoji are only committed by explicit user action (arrow keys, Tab, number key, or click).selectedIndexis now a display index and is converted at every riti boundary (riti_get_suggestion_for_keypreviously-selected index, marked/pre-edit text, commits, remembered selection, phonetic-first default). Navigation, digit keys, mouse clicks, and commits all follow the new order consistently.Behavior
Testing
swiftc -typecheckpasses with zero errorsmake build, installed to~/Library/Input Methods, verified live: typingboishshows বিশ et al. selected by default with 🎉 unselected at the bottom; space commits the word; emoji only via explicit selection