From 79fb19f0df5c454c3ae026662e4c5d68748d7173 Mon Sep 17 00:00:00 2001 From: altair823 Date: Sun, 3 May 2026 08:32:37 +0000 Subject: [PATCH] =?UTF-8?q?review(p9-fb-13):=20=ED=9A=8C=EC=B0=A8=201=20ni?= =?UTF-8?q?t=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `cheatsheet_intercept` doc 에 trade-off 명시: Esc-when-visible 가 cheatsheet 만 닫고 mode flip 안 함 (single-effect-per-keystroke). Insert 모드 사용자는 두 번째 Esc 로 Normal 전환. - `cheatsheet.rs` 모듈 doc 에 maintenance 경고 추가: push_section() 이 hard-coded string 이라 binding 변경 시 cheatsheet 동기화 수동. 자동 link 없음 — future PR 가 키 바꾸면 cheatsheet 도 갱신 필수. 118 TUI 테스트 통과 + clippy clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/kebab-tui/src/cheatsheet.rs | 7 +++++++ crates/kebab-tui/src/run.rs | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/kebab-tui/src/cheatsheet.rs b/crates/kebab-tui/src/cheatsheet.rs index a030489..d7743a5 100644 --- a/crates/kebab-tui/src/cheatsheet.rs +++ b/crates/kebab-tui/src/cheatsheet.rs @@ -15,6 +15,13 @@ //! * The verb hint line redesign sits in the existing `render_footer` //! path; the per-pane string already serves the same role. A //! future PR can split it into mode-aware verb fragments. +//! +//! **Maintenance**: the `push_section(...)` calls below hold every +//! key binding as a literal string — there is NO automated link +//! from `handle_key_*` to the cheatsheet entries. A future PR that +//! changes a binding (e.g. swap `r` → `R` for ingest) MUST update +//! the matching entry here. Drift would be silently invisible +//! (the cheatsheet still renders, but lies about the live key). use ratatui::Frame; use ratatui::layout::Rect; diff --git a/crates/kebab-tui/src/run.rs b/crates/kebab-tui/src/run.rs index ed2846e..9e42954 100644 --- a/crates/kebab-tui/src/run.rs +++ b/crates/kebab-tui/src/run.rs @@ -399,7 +399,10 @@ pub fn mode_intercept(app: &mut crate::app::App, key: crossterm::event::KeyEvent /// - **`Esc` while visible** → close. Returning `true` here means /// the global `mode_intercept` does NOT also see the Esc, so the /// user's "close cheatsheet" action stays a single keystroke -/// instead of also flipping mode. +/// instead of also flipping mode. **Trade-off**: a user in +/// Insert mode with the cheatsheet open needs a SECOND `Esc` to +/// flip to Normal. Single-effect-per-keystroke wins over +/// compound actions. /// - Any other key while visible → fall through (so the key reaches /// the active pane normally — useful if the user wants to keep /// the popup open and still navigate). The popup auto-closes