feat(kebab-tui): p9-fb-10 follow-up — InputBuffer + cursor + Korean FTS5 pin #88
Reference in New Issue
Block a user
Delete Branch "feat/p9-fb-10-inputbuffer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
p9-fb-10 (TUI CJK input + wide-char rendering audit) follow-up — closes the
deferred portion of the spec. Together with PR #87 (helpers + library row
formatter), the p9-fb-10 task is fully shipped. spec status
in_progress→
completed.Scope (12 commits, 6 tasks)
kebab-tui::input::InputBuffer { content, cursor_col }with
push_char/push_str/pop_char/clear/take/as_str/cursor_col/is_empty. Cursor invariantcursor_col == display_width(content)enforced by construction. v1 append-only (mid-string editing out of scope).
f.set_cursor_position(...)placement.take()helper for submit flow +PROMPTconst.LABEL_TAGS/LABEL_LANGconsts (single source for layout + cursor math) +
library_filter_for_testingaccessor.
crates/kebab-app/tests/search_korean.rsingestsa Hangul
.mdand asserts the lexical query "러스트" returns the right doc.lexical_querytest helper promoted tocommon/mod.rs(de-duped fromsearch_lexical.rs).place_cursor_xhelper (final review fix-up) — extracted shared cursormath (sum in
usizeto avoidu16overflow + clamp) used by all 3 panes.Filter overlay render-level cursor test added.
Behavioral changes
show_cursorwhencursor_positionis
Some,hide_cursorwhenNone. Search / Ask / Filter now callset_cursor_position→ caret visible in those panes. Library / Inspect omitthe call → cursor stays hidden as before.
by 2 cols per char (was: 1 char = 1 cell ≠ display width).
String::pop()was already char-aware so backspace boundary safety was never a bug; this
PR fixes only rendering width.
Tests added
take/clear/pop-on-empty / cursor invariant including post-pop).
place_cursor_xunit tests (clamp + within-bounds).and
cursor_colat type + after backspace.set_cursor_positionruns.Test plan
cargo test -p kebab-tui— 58 unit + 13 library + others, all green.cargo test -p kebab-app— 8 lexical (incl. new Korean), 2 vector ignored(AVX-gated, expected).
cargo clippy --workspace --all-targets -- -D warnings— clean.Spec contract
tasks/p9/p9-fb-10-tui-cjk-input.md—status: in_progress→completed,3 DoD boxes ticked, follow-up Notes line added.
tasks/HOTFIXES.md— 5-checkbox follow-up list flipped to[x],"Follow-up shipped" line added (PR # to be filled in chore PR).
README.md—kebab tuirow gains the cursor-column note.HANDOFF.md— 2026-05-03 entry for the follow-up.Workflow
Implemented via
superpowers:subagent-driven-development— fresh subagent pertask with two-stage review (spec compliance + code quality) per task. Each
task's review nits were addressed in the same task's
review(...)fix-upcommit before proceeding to the next task. Final whole-branch review caught
the
u16overflow inconsistency (3 panes had divergent arithmetic) → fixedby extracting
place_cursor_xhelper.회차 1 — APPROVE.
본 PR 의 12 commits 는 plan-driven subagent flow 로 구현되었고 task 단위로 spec compliance + code quality 두 단계 review 가 이미 돌았다. 각 task 의 review nits 는 같은 task 의
review(...)커밋으로 즉시 반영. final whole-branch review 가 잡은 마지막 actionable (3 pane 의 cursor 산술 inconsistency + filter overlay render-level cursor test 누락) 은 final commitb96d8f9가place_cursor_x헬퍼 추출 + 신규 render test 로 해결.검토한 항목:
cursor_col == display_width(content)가 push/pop/clear/take 모든 경로에서 유지 (8 unit test 가 pin).block.inner(area)+place_cursor_x헬퍼 + clamp 로 통일 — fourth pane 추가 시 즉시 재사용 가능.cursor_positionSome/None 에 따른 show/hide_cursor 동작이 doc + 코멘트 + final review 에서 명시적으로 confirm — Search/Ask/Filter 가 INSERT 모드에서 caret 보임, Library/Inspect 는 hidden.lexical_onlyenv (embedding="none") 로 외부 의존 없이 통과.lexical_querytest helper 가common/mod.rs로 promotion (search_lexical.rs 와 중복 제거).[x]. spec frozen contract 의 Goal/Behavior 섹션은 unchanged — 오직 status + DoD + Notes 만 갱신.본 PR scope 안에서 추가로 잡을 actionable issue 없음. 머지 OK.