Skip to content

JSON Formatter: instant Fold all, Find in fold view, error offset - #26

Merged
fadeltd merged 1 commit into
mainfrom
feat/fold-polish
Oct 30, 2026
Merged

fadeltd merged 1 commit into
mainfrom
feat/fold-polish

Conversation

@fadeltd

@fadeltd fadeltd commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Added

  • JSON Formatter: Find in the foldable output (literal search only)
  • foldRanges in @fadeltd/devtools-core/json

Changed

  • Fold all is near-instant on large output

Fixed

  • The error card shows the offset again

…or card

Fold all no longer builds the whole syntax tree (~1 s on a megabyte). It folds the ranges from a new core foldRanges, a linear bracket-and-string scan with the same bounds as lang-json's folds: ~13 ms for 2 MB in Node, ~0.15 s end to end for 1.4 MB of output in the browser.

The fold view gets CodeMirror's search panel (@codemirror/search 6.7.2, pinned, already in the lockfile via codemirror), opened by a Find button or Ctrl/Cmd+F in the output, because the browser's own find sees only rendered lines. It is literal only: the regexp option is hidden and an update listener turns regex mode back off, since a user pattern must never run on the main thread. Styled with the design tokens; matches use the accent. It lives in the lazy FoldableOutput chunk (~17.5 kB gzip, from ~11); the Diff route and first-load JS are unchanged.

IssueCard takes an optional offset, so the JSON card shows line, column and offset again.
@fadeltd
fadeltd merged commit d3fa8a8 into main Oct 30, 2026
1 check passed
@fadeltd
fadeltd deleted the feat/fold-polish branch October 30, 2026 02:56
@fadeltd fadeltd changed the title JSON: instant Fold all, Find in the fold view, offset on the error card JSON Formatter: instant Fold all, Find in fold view, error offset Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant