review(p9-fb-09): 회차 1 nit 반영
- `App.pending_editor` / `force_redraw` 를 `pub(crate)` 로 좁힘. 외부 caller (kebab-cli/desktop) 는 enqueue 할 일 없고, 잘못 mutate 하면 \"set 후 다음 tick 에 drain\" invariant 가 깨짐. - 외부 read access 가 필요한 경우를 위해 `App::pending_editor()` 읽기 전용 accessor 추가 — integration test (`tests/search.rs`) 가 사용. - `App.force_redraw` doc comment 의 \"ratchet incremented\" 표현을 실제 type (bool flag) 에 맞게 \"when set, the next draw clears\" 로 교체. - `editor::tests::unspawnable_program_surfaces_program_name_in_error` 를 `command_status_returns_not_found_for_missing_program` 으로 rename + doc 수정 — 실제로 `with_external_program` 호출하지 않고 `Command::status()` 만 검증한다는 점을 솔직하게 명시 (helper end-to-end 는 dogfooding 으로 검증). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -299,15 +299,14 @@ fn g_key_enqueues_pending_editor_request() {
|
||||
s.hits = vec![make_hit(1, "notes/x.md", "snippet", line_citation("notes/x.md", 42))];
|
||||
s.selected_hit = 0;
|
||||
}
|
||||
assert!(app.pending_editor.is_none(), "queue starts empty");
|
||||
assert!(app.pending_editor().is_none(), "queue starts empty");
|
||||
let outcome = handle_key_search(
|
||||
&mut app,
|
||||
KeyEvent::new(KeyCode::Char('g'), KeyModifiers::NONE),
|
||||
);
|
||||
assert_eq!(outcome, KeyOutcome::Continue);
|
||||
let req = app
|
||||
.pending_editor
|
||||
.as_ref()
|
||||
.pending_editor()
|
||||
.expect("g on a hit must enqueue an EditorRequest");
|
||||
match &req.citation {
|
||||
Citation::Line { path, start, .. } => {
|
||||
@@ -330,7 +329,7 @@ fn g_key_with_no_hits_does_not_enqueue() {
|
||||
KeyEvent::new(KeyCode::Char('g'), KeyModifiers::NONE),
|
||||
);
|
||||
assert!(
|
||||
app.pending_editor.is_none(),
|
||||
app.pending_editor().is_none(),
|
||||
"g with no hits must not enqueue"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user