Skip to content

viewer: fold state desyncs after fold class → fold file → unfold file #8

Description

@folded

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.tsrenderHunkReplace 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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions