Repository navigation
chewing: press Up in the composition to choose another tone - #928
Open
DaveTseng2019 wants to merge 3 commits into
Open
DaveTseng2019 wants to merge 3 commits into
DaveTseng2019 wants to merge 3 commits into
Conversation
Member
|
Hi @DaveTseng2019, thank you for your contribution! Currently, I am focused on resolving several critical stability and IPC issues in the core framework. Because of this, pull requests introducing new features are temporarily on hold and will be reviewed once the stability fixes are complete. Thank you for your patience and understanding! 感謝你的貢獻與 PR! 目前我正專注於修復核心架構與各項穩定性問題(Bug fixes),因此新功能的 PR 會在穩定性問題解決告一段落後再陸續進行審核,感謝你的耐心與體諒! |
A backend that changes the layout (e.g. candPerRow) together with a new list got the list drawn with the old layout; the change only showed on the next update. Applying UI settings first lets one reply do both. - In updateStatus(), handle "customizeUI" before the candidate list, composition and commit string instead of last. Architecture and design by Dave Tseng. Implementation generated with AI assistance from Claude Code (Claude Opus 5.5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a character comes out in the wrong tone, today the user has to delete it and type it again. The next commit opens this menu with Up. - New tone_menu.py. ToneMenu.open() lists the other tones of the character at the cursor that have characters, e.g. "ㄅㄧˊ 鼻"; choose() replaces the character with the chosen tone. - libchewing has no API to change one syllable, so choose() deletes the character and types the new syllable on the default layout, then puts the cursor back. If the new syllable cannot be typed, it types the old one back. - A second, hidden ChewingContext looks up each tone's characters, so the user's dictionary is never touched. - Unit tests for the key mapping and tone order, plus tests against the bundled chewing.dll (skipped outside the 32-bit bundled python). Architecture and design by Dave Tseng. Implementation generated with AI assistance from Claude Code (Claude Opus 5.5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up did nothing in this state, so it is free. Users asked for a quick way to fix a wrong tone without deleting and retyping the character. - Up, with no candidate window and no bopomofo being typed, opens the tone menu for the character at the cursor in the candidate window, one tone per row from the first tone to the neutral tone. - In the menu: a selection key or Enter changes the tone; arrow keys move the cursor; any other key closes the menu and restores the normal candidates per row. - Close the menu when the IME is deactivated or the composition ends. Architecture and design by Dave Tseng. Implementation generated with AI assistance from Claude Code (Claude Opus 5.5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DaveTseng2019
force-pushed
the
feat/chewing-tone-menu
branch
from
October 30, 2026 05:18
ed19631 to
80baaa7
Compare
This branch has not been deployed
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.
When a character comes out in the wrong tone (typed ㄅㄧˋ, meant ㄅㄧˊ), the only fix today is to delete it and type it again. In the composition, with no candidate window and no bopomofo being typed, Up does nothing (libchewing's
handle_Uponly closes a candidate list), so this PR uses Up to open a tone menu.Builds on #1019 (apply
customizeUIbefore the candidate list), split out of this PR as a separate fix; its commit shows here until it is merged.ToneMenu(tone_menu.py).open()lists the other tones of the character at the cursor that have characters, e.g.ㄅㄧˊ 鼻, first tone to neutral.choose()replaces the character: libchewing has no API to change one syllable, so it deletes the character, types the new syllable on the default layout and puts the cursor back; if the new syllable cannot be typed, it types the old one back. A second, hiddenChewingContextdoes the lookups, so the user's dictionary is never touched.Rebased on current master. New file headers follow the AGENTS.md rules.
Testing:
tests/test_chewing_tone_menu.py, 8 tests, all pass with the bundled 32-bit python (5 of them loadchewing.dlland use the Hsu layout to check a non-default layout; two guard bugs found while testing). Also built x86/x64 and tested by hand with 新酷音 (Hsu layout): ㄅㄧˋ ㄅㄧㄝˊ → 必別, Up on 必 lists ㄅㄧ / ㄅㄧˊ / ㄅㄧˇ, choosing ㄅㄧˊ gives 鼻別 with the cursor in place, Esc closes without a change.Open question:
braille_chewingsubclassesChewingTextService, so it gets this menu too. The menu is visual; please say if it should be turned off there.Architecture and design by Dave Tseng. Implementation generated with AI assistance from Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code