Observed while reviewing #6.
Repro: fold a class, then fold the whole file, then unfold the file.
Result: the class comes back unfolded, but the hunk is folded — showing only the annotation/comment rows, with a jump in the line numbers.
So the two fold scopes (region-level and file-level) are not composing: unfolding the file restores the inner region's state but leaves the hunk in a folded state that nothing in the UI now reflects. Showing comments with no code and a discontinuous gutter is the visible symptom of a hunk that is folded while its contents are not.
Where to look
viewer/assets/folds.ts — fold overrides and how region vs file vs hunk state is layered
_state.overrides / _state.fold in viewer/assets/render.ts — renderHunkReplace bails to a full render() under an active filter, which suggests the surgical paths already have known state-restoration gaps
Related: annotations also lose their column attachment across fold cycles (separate issue).
Observed while reviewing #6.
Repro: fold a class, then fold the whole file, then unfold the file.
Result: the class comes back unfolded, but the hunk is folded — showing only the annotation/comment rows, with a jump in the line numbers.
So the two fold scopes (region-level and file-level) are not composing: unfolding the file restores the inner region's state but leaves the hunk in a folded state that nothing in the UI now reflects. Showing comments with no code and a discontinuous gutter is the visible symptom of a hunk that is folded while its contents are not.
Where to look
viewer/assets/folds.ts— fold overrides and how region vs file vs hunk state is layered_state.overrides/_state.foldinviewer/assets/render.ts—renderHunkReplacebails to a fullrender()under an active filter, which suggests the surgical paths already have known state-restoration gapsRelated: annotations also lose their column attachment across fold cycles (separate issue).