review(p9-4): 회차 1 지적 반영

blocks / embeddings 섹션의 count 라인이 collapse 검사 *밖* 에서 push
되어 collapsed 상태에서 부분만 사라지던 일관성 깨짐. fix: count 를
section header 에 inline 으로 (`▾ blocks (N)`, `▾ embeddings (N)`),
body 만 collapse 검사 안. 새 helper `push_section_header_with_count`
가 둘 다 통일.

회귀 테스트 보강:
- doc_view_collapse_hides_section_body: collapsed 상태에서 \"blocks (2)\"
  inline count 표시 + \"Heading L1\" body 숨김 검증.
- chunk_view_renders_text_and_block_ids: \"embeddings (2)\" inline
  count 검증.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-02 15:44:14 +00:00
parent b6e0ab352f
commit 8c6d29cc2d
2 changed files with 45 additions and 18 deletions

View File

@@ -264,16 +264,25 @@ fn doc_view_collapse_hides_section_body() {
}
let pre = render_to_string(&app, 100, 30);
assert!(pre.contains("kb-source-fs"), "before collapse");
assert!(pre.contains("Heading L1"), "blocks body before collapse");
handle_key_inspect(
&mut app,
KeyEvent::new(KeyCode::Char('c'), KeyModifiers::NONE),
);
let post = render_to_string(&app, 100, 30);
assert!(post.contains("metadata"), "section header still visible");
assert!(
post.contains("blocks (2)"),
"blocks count visible inline on collapsed header: {post}"
);
assert!(
!post.contains("kb-source-fs"),
"provenance body hidden after collapse: {post}"
);
assert!(
!post.contains("Heading L1"),
"blocks body hidden after collapse (count must collapse with body): {post}"
);
}
#[test]
@@ -290,8 +299,8 @@ fn chunk_view_renders_text_and_block_ids() {
assert!(rendered.contains("Line 1-5"), "source span described");
assert!(rendered.contains("chunk body line one"), "text body rendered");
assert!(
rendered.contains("block_ids = 2"),
"block_id count rendered"
rendered.contains("embeddings (2)"),
"block_id count rendered inline on embeddings header"
);
}