Commit 7522ecb
committed
fix: populate chunk.doc_items on rechunk so bbox↔chunk linking works
After clicking a chunk card in the Chunk view, the matching bboxes
were not highlighted on the preview. Root cause: the rechunk path
in `ChunkService.rechunk_document` created the new `Chunk` rows
with `doc_items=[]`, on a stale comment that claimed
`ChunkResult` had no `doc_items`.
`ChunkResult` actually carries `doc_items: list[ChunkDocItem]`
(see `domain/value_objects.py`), populated by `LocalChunker` from
`chunk.meta.doc_items`. Dropping that list at rechunk time meant
the frontend's `elementRefsForChunk` helper had no `self_ref`
entries to drive the canvas highlight (#264), so the bbox stayed
in its default style regardless of the selected chunk.
Fix: pass `list(r.doc_items)` through.
Affects every chunk produced via the Strategy popover (#268) and
every chunk produced by the workspace-level "Generate chunks"
button (#266) — both go through `rechunk_document`. The
promote-from-analysis path already populated `doc_items` correctly
(see `_analysis_chunk_to_canonical`).
48 chunk-service / API tests passing.1 parent e78758b commit 7522ecb
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| |||
0 commit comments