-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Report
Description
The j/k keyboard navigation only cycles through h2 level headings and does not navigate into subsections (h3, h4, etc.) even when those subsections are expanded.
Current Behavior
- Press
jto navigate to next section → jumps to next h2 - Press
kto navigate to previous section → jumps to previous h2 - Expanded subsections (h3, h4, h5, h6) are skipped
- Navigation only works at the top level (h2)
Expected Behavior
When subsections are expanded:
jshould navigate to the next visible heading (h2, h3, h4, etc.)kshould navigate to the previous visible heading- Navigation should follow the visual document hierarchy
- Collapsed subsections should be skipped (only navigate to their parent)
Example Scenario
## Section 1 (h2) ← j/k navigates here
### Subsection 1.1 (h3) ← Should navigate here when expanded, but currently skipped
### Subsection 1.2 (h3) ← Should navigate here when expanded, but currently skipped
## Section 2 (h2) ← j/k navigates here
### Subsection 2.1 (h3) [collapsed] ← Should be skipped
#### Subsection 2.1.1 (h4) [hidden] ← Should be skipped
### Subsection 2.2 (h3) ← Should navigate here when expanded
## Section 3 (h2) ← j/k navigates here
Steps to Reproduce
- Open a document with h2 sections that contain h3/h4 subsections
- Expand some subsections so they are visible
- Press
jorkto navigate - Observe that only h2 headings are selected, h3+ subsections are skipped
Technical Notes
- Need to query all visible headings, not just h2
- Should check if heading is within a collapsed section
- Navigation order should follow DOM order of visible headings
- May need to filter based on computed styles or parent section state
Related Code
Likely in:
- Keyboard navigation handler
- Section navigation logic
- Heading selector queries (probably using
h2selector instead ofh2, h3, h4, h5, h6)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working