Skip to content

feat(analysis): fold non-highlighted lines in the LOG viewer#27

Merged
oahsiao merged 3 commits into
mainfrom
feature/ana-fold-non-highlighted
Jun 23, 2026
Merged

feat(analysis): fold non-highlighted lines in the LOG viewer#27
oahsiao merged 3 commits into
mainfrom
feature/ana-fold-non-highlighted

Conversation

@s108105

@s108105 s108105 commented Jun 23, 2026

Copy link
Copy Markdown

Summary

Adds a fold feature to the LOG Analysis viewer that collapses runs of non-highlighted lines so only highlighted content stays visible. Built as a row model on top of the existing virtualized renderer, so scrolling, bookmarks, navigation, find and the minimap stay correct.

Features

  • Fold toggle in the level bar (default off, persisted). When on, consecutive non-highlighted lines collapse into a full-width fold bar shown above the next line (+ N).
  • Expand / collapse: clicking a collapsed bar expands the run, showing a − 收折 collapse bar both above and below the revealed lines so it can be re-folded from either end.
  • Jump arrows on expanded bars: the top bar has a down arrow (jump to the bottom of the section); the bottom bar has an up arrow (jump to the top).
  • Flash hint: newly-expanded lines pulse once slowly so it's clear which section opened.
  • Alt+F opens the current log directory while the analysis view is active.
  • Level sync: toggling a highlight level off also folds its lines (only enabled levels count as highlighted).

Implementation

  • New anaBuildRows() builds a rows model (line rows + fold-placeholder rows) with lineRow / lineDisplayRow maps so every line-index API (scroll, bookmarks, nav, find, ruler ticks) keeps working through the fold layer.
  • Fold rows have an inline height equal to the measured line height to preserve fixed-height virtualization.

Testing

  • npm test passes (4/4: i18n key parity, data-i18n keys exist, highlight regex valid, no duplicate IDs).
  • Verified the app launches in Electron without renderer errors.

OA Hsiao added 3 commits June 23, 2026 17:57
Add a fold toggle (default off, Alt+F opens the log dir) that collapses runs of non-highlighted lines into a full-width fold bar above the next line. Expanding shows a collapse bar above and below the run, and the revealed lines flash once to point out which section opened. Folding is implemented as a row model on top of the virtualized viewer so scroll, bookmarks, nav, find and the minimap stay correct.
Expanded fold bars now carry a navigation arrow: the top bar jumps to the bottom of the section, the bottom bar jumps to the top. Toggling a highlight level off now also folds its lines, since only enabled levels count as highlighted.
Mirror the expand flash: collapsing a run now briefly pulses the resulting fold bar so it's clear where the hidden lines went.
@oahsiao oahsiao merged commit dd2cc56 into main Jun 23, 2026
5 checks passed
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.

2 participants