feat(tui): 在席でも没入と同じ Ctrl-O リーダー文法を効かせる#421
Merged
Merged
Conversation
在席(Focus)の Ctrl-O は単独で即・切替へ戻る一方、没入(Attached)では Ctrl-O o というリーダー文法だったため、場所によってキー操作が食い違って いた。prefix 方式のとき在席の Ctrl-O もリーダー化し、没入と同じ次キー (o/n/p/g/e/s/q・→/←、Ctrl-O Ctrl-O、Ctrl-O Ctrl-^)で操作できるよう統一。 Esc は引き続き切替への 1 キー離脱として残す。alt 方式では没入が Ctrl-O を リーダーにしないのに合わせ、在席の Ctrl-O は従来どおり単打で切替へ戻す。 在席はシェルを持たないためタイムアウトは不要(次キーが必ずリーダーを解決)。 モード間で leader が漏れないよう enter_switch / enter_focus_surface / leave_attached で prefix_pending をクリアする。フッターとチートシートも スキーム対応にし、design/05-home.md・00-tutorial.md を更新。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📊 Test Coverage
🎉✨ パーフェクト!全ファイル Lines カバレッジ 100% を達成しました 🏆🐰 |
kkyosuke
added a commit
that referenced
this pull request
Jun 27, 2026
## 目的 没入(Attached)モードで日本語 IME を ON にしたまま「切替」へ抜けられるようにする。 `Ctrl-O o` のリーダー文法は、2 段目の `o` がただの英字のため、IME 変換モードでは IME がローマ字変換(「お」)に横取りしてしまい usagi に届かない。結果として **IME ON のまま `Ctrl-O o` を押しても切替に行けなかった**。 ## 変更内容 - 没入の `classify()` で、二重リーダー `Ctrl-O Ctrl-O` を `Ctrl-O o` と同じ **切替へのズームアウト**(`Reserved::Detach`)に割り当て。`Ctrl-O`(`0x0f`)は制御文字なので IME を素通しし、2 打とも制御文字 → IME 安全な経路になる。 - 在席(Focus)は #421 で既にこの挙動だったため、没入もそれに揃えて統一。 - 没入チートシートの行を「Send a literal Ctrl-O to the shell」→「Zoom out to Switch (IME-safe second key)」に更新。 - 関連ドキュメント(`document/design/05-home.md` / `00-tutorial.md` / `03-commands/02-tui.md`)を実態に合わせて更新。 ### トレードオフ 従来 `Ctrl-O Ctrl-O` が担っていた「リテラル `Ctrl-O` をシェルへ送る」機能(readline の operate-and-get-next 用。ほぼ未使用)は `prefix` 方式では使えなくなる。bare な `Ctrl-O` をシェルへ送りたい場合は `alt` 方式(bare Ctrl-O がそのままシェルへ流れる)を使う旨を、コメントとドキュメントに明記した。 ## テスト・確認方法 - `cargo fmt` / `cargo clippy --all-targets -- -D warnings` / `cargo test` をパス(カバレッジ 100% 維持)。 - `pane_input.rs` の単体テストを更新(`prefix_double_leader_zooms_to_switch_and_unknown_second_key_is_swallowed`):`Ctrl-O Ctrl-O` の両報告形式(`'o'`+CONTROL / 生 `0x0f`)が `Reserved::Detach` になることを検証。 - 在席側の `focus_ctrl_o_double_leader_also_opens_switch` は従来どおりパス。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: test <test@example.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
目的
在席(Focus)の
Ctrl-Oは単独で即・切替へ戻る一方、没入(Attached)ではCtrl-O oというリーダー文法だったため、いる場所によって「切替へ戻る」キーが食い違う(在席=Ctrl-O/没入=Ctrl-O o)混乱があった。在席でも没入と同じ prefix 文法を効かせ、Ctrl-O oのマッスルメモリが両モードで通るよう統一する。変更内容
既定の
prefix方式のとき、在席のCtrl-Oを没入と同じリーダーにし、次キーで操作する:Ctrl-O o(Ctrl-O Ctrl-Oも)/Esc(1キー離脱は維持)Ctrl-O n/p・Ctrl-O →/←(直キーCtrl-N/Pも併用可)Ctrl-O gCtrl-O e/Ctrl-O s/Ctrl-O q(Ctrl-E直キーも)Ctrl-^(Ctrl-O Ctrl-^も)alt方式では没入がCtrl-Oをリーダーにしないのに合わせ、在席のCtrl-Oは従来どおり単打で切替へ戻す(非リグレッション)。enter_switch/enter_focus_surface/leave_attachedでprefix_pendingをクリア。主な差分
src/presentation/tui/home/event/handlers.rs—focus_keyのリーダー化とfocus_prefix_action新設src/presentation/tui/home/state/mod.rs— モード遷移でのprefix_pendingクリアsrc/presentation/tui/home/ui/chrome.rs/content.rs— フッター・チートシートのスキーム対応document/design/05-home.md/document/00-tutorial.md— キー操作の記述を更新テスト・確認方法
cargo fmt/cargo clippy --all-targets -- -D warnings✅cargo test全パス ✅(在席のCtrl-O o/二段リーダー/g/s/e/q/タブ巡回(文字・矢印)/前セッション/未知キーの swallow/alt 方式の直キー維持/フッター・チートシートのスキーム分岐をカバー)🤖 Generated with Claude Code