Skip to content

feat(cinbase): switch to English with Shift+letter, confirm lone candidate with space (#890) - #1013

Open
asdf80730 wants to merge 3 commits into
EasyIME:masterfrom
asdf80730:pr/cinbase-890
Open

asdf80730 wants to merge 3 commits into
EasyIME:masterfrom
asdf80730:pr/cinbase-890

Conversation

@asdf80730

@asdf80730 asdf80730 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #890

速成 and the other cinbase input methods never leave Chinese mode when you
press Shift+letter to switch to English: with the 聯想字 window open the
letter is swallowed outright, and at rest the letter commits but the mode
stays Chinese. Only a bare Shift tap switched languages, and even that only
while the Shift keyup is still the last key pressed — any letter typed
holding Shift destroys that evidence. Space also never confirmed a candidate
window that holds exactly one candidate, though the comment above the code
has always promised it: the window-open branch pins canSetCommitString to
false and space-as-page-key captures the key even with a single page, so the
selection key is the only way out.

  • Add opt-in shiftLetterSwitchToEnglish (default off, named the same as the
    equivalent chewing-side setting so one option reads the same across input
    methods): Shift+letter with nothing composed and no
    candidate window open switches to English and outputs the letter, ahead of
    easy symbols and honoring outputSmallLetterWithShift; a bare Shift tap
    returns to Chinese as before. The 聯想字 window is dismissed the same way
    any other key dismisses it, cursor and page included. cheez is excluded;
    it uses that chord for its own features.

  • Space now commits a single-candidate window through the normal commit
    path, in both the main and the 聯想字 window, regardless of
    directShowCand or switchPageWithSpace. Windows with several candidates
    keep paging — including when the tail page happens to hold exactly one
    item — and the homophone lookup list, the selection keys, and Enter are
    unchanged.

  • 15 cases driving the real 速成 service through filterKeyDown/onKeyDown
    pass: opt-in on/off, switch from idle and from the 聯想字 window, no
    switch while composing, priority over easy symbols, small-letter policy
    with CapsLock pinned off, escape from a paged 聯想字 window, lone-candidate
    space with directShowCand on and off, with space-as-page-key on, and in
    the 聯想字 window — plus guards that multi-candidate space (including a
    one-item tail page) still pages and that Enter keeps its existing
    contract. The cases live in tests/test_cinbase_shift_to_english.py,
    which the repo's local verification harness runs; per
    docs/agents/upstream-pr.md regression tests are not shipped in the PR.

  • bash tests/verify_windows.sh all layers green (Python, Node, Go, Rust,
    C++ helpers, YAML).

Fully generated by omp (Qwen3.8-Flash-Next) without human intervention.

…yIME#890)

速成 and the other cinbase input methods keep Chinese mode when a
Shift+letter commits the letter, and while the 聯想字 window is open the
letter is swallowed entirely, so pressing Shift to type English left the
user in Chinese input; a bare Shift tap was the only way out. Add an
opt-in shiftLetterSwitchToEnglish (the option name the chewing side uses
for the same behavior) that switches to English on Shift+letter when
nothing is being composed and no candidate window is open, ahead of easy
symbols and honoring outputSmallLetterWithShift; the 聯想字 window is
dismissed the same way any other key dismisses it, cursor and page
included. cheez is excluded; it uses that chord for its own features.

Validation:
- tests/test_cinbase_shift_to_english.py, 15 cases driving the real
  chesimplex service through the key seam (kept in the repo's local
  harness per docs/agents/upstream-pr.md; run on this tree): the
  Shift+letter cases all pass.
- bash tests/verify_windows.sh: all layers green.

Fully generated by omp (Qwen3.8-Flash-Next) without human intervention.
A candidate window holding exactly one candidate could not be confirmed
with space: the main-window branch pinned canSetCommitString to false
whenever the window had not been opened by typing, and space-as-page-key
captured the key even when there was a single page, so the selection key
was the only way out - although the comment above the code has always
promised that one candidate commits directly. Space now commits through
the normal commit path in the main window (the homophone lookup list
keeps its own keys) and in the 聯想字 window, regardless of
switchPageWithSpace; windows with several candidates keep paging, the
selection keys are untouched, and Enter is unchanged.

Validation:
- same harness file and run as the previous commit: the space cases
  pass, including a one-item tail page that must page instead of
  committing.
- bash tests/verify_windows.sh: all layers green.

Fully generated by omp (Qwen3.8-Flash-Next) without human intervention.
onKeyDown only sees keys filterKeyDown claimed: under
compositionBufferMode with directShowCand off, an idle Shift+letter that
is not claimed in the Shift block is handed back to the application,
silently bypassing any onKeyDown branch written for it. The
shiftLetterSwitchToEnglish claim joins easy symbols, fullshape symbols
and the wildcard star as the fourth case; spell the invariant out above
the Shift block so the next branch does not have to rediscover it.

Fully generated by omp (Qwen3.8-Flash-Next) without human intervention.

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.

按下 shift 仍沒有離開中文輸入狀態

1 participant