feat: expand/collapse sections for headings#7
Closed
tomasz-tomczyk wants to merge 1 commit intomainfrom
Closed
Conversation
Add ability to collapse markdown sections to their headings for quick navigation of long documents. Sections are defined by heading levels and can be toggled via chevron icons, a header button, or keyboard shortcut (s). - Build section tree from heading blocks after parsing - Chevron toggle positioned to the left of each heading gutter - Collapsed sections show "N lines collapsed" summary row - Comment count badge on collapsed headings with comments - j/k keyboard nav skips collapsed blocks - TOC clicks auto-expand collapsed parent sections - Collapse state persisted to localStorage per filename - Sections not collapsible in diff view Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
de1cee7 to
74e233a
Compare
2 tasks
tomasz-tomczyk
added a commit
that referenced
this pull request
Apr 29, 2026
…pe test Bundle of low-risk improvements flagged by the independent review: Popover keyboard + a11y - Add `role="listbox"` to the focus-picker list and `role="option"` + `aria-selected` + `tabindex="-1"` to each item, matching the listbox pattern the popover already implies via aria-haspopup. - Add Escape handler that closes the popover and returns focus to the trigger button — same pattern as the commit-picker. Stable test attributes - `data-label` on each picker item (lifts the label out of rendered DOM children, replacing brittle `evaluate(() => innerText)` reads in focus-picker spec). - `data-focus-kind` on each item, replacing the substring-match selector `[data-focus-payload*="working_tree"]` which would false-positive on any payload that happened to contain that string. Brittle test fixes - comment-stale spec: replace `stackOrdered[1]` with a feat-b-relative lookup so fixture growth doesn't silently shift the test. Net new coverage - scope-toggle-files: new test asserts a layer-scoped comment is hidden in full-stack and reappears when the user flips back. This is the lossless-visibility invariant — the only regression test against accidentally serialising scope-filtered comments out to disk. Skipped from the polish list (with reasons): - Branches-section base_sha precompute (#2) — server-side change, owned by go-expert; would be a separate ticket. - Pre-feature comment WT-only test (#6) and /api/focus error-rollback toast test (#7) — both require fixture or daemon-state changes that exceed the 30-min budget for "polish". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skeyboard shortcutj/kkeyboard nav skips collapsed blocks; TOC clicks auto-expand parent sectionslocalStorageper filename; sections not collapsible in diff viewTest plan
skeyboard shortcutj/knavigation skips collapsed blocks🤖 Generated with Claude Code