refactor: split breadcrumb and ancestor-stack vocabulary#45
Merged
Conversation
"Crumb" named two different things rendered side by side in StickyHeader: the cross-document link trail and the current heading's ancestor chain. Reserve breadcrumb/crumb for the trail and name the heading concept the ancestor stack. - BreadcrumbRow -> AncestorRow, breadcrumbRows -> ancestorRows - onBreadcrumbClick / onCrumbClick -> onAncestorClick (the App and StickyHeader ends of one callback had drifted to different names) - "breadcrumb overlay" -> "sticky overlay" in prose, matching the term already used for the region as a whole Move the overlay's row builders out of toc-util into overlay-rows: nothing in the TOC sidebar called them, and fold.ts needs the same row count the renderer produces so shown rows and occluded rows cannot drift apart. Also drop the dead findCurrent export, drop the dead inlineVisibleWidth re-export (its tests move to inline-width.test.ts), and move truncateLabelLeft to label.ts — a string helper the status line owns, with no TOC involvement. Expand the CLAUDE.md glossary to cover the modules added since it was written: Document, Fold, Pending target, Projection, Cover, and friends.
Startup benchmark (
|
| build | mean | ratio | verdict |
|---|---|---|---|
| baseline (main@e39c971) | 724.9ms ± 12.1ms | — | |
| PR | 722.6ms ± 10.2ms | 1.00× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
denolfe
added a commit
that referenced
this pull request
Jul 26, 2026
- refactor: split breadcrumb and ancestor-stack vocabulary (#45) (4fc9a88) - refactor(viewer): consolidate view state into a store hook (#44) (e39c971) - refactor(viewer): extract nav-intent consumer into a pure dispatcher (#43) (8cbde71) - refactor: consolidate heading/overlay geometry into a Fold module (#42) (bc77a33) - refactor(viewer): extract scroll pending/pin machine into a pure reducer (#41) (a2e8062) - feat(viewer): add a keyboard shortcut help drawer (#40) (cfb3815) - feat(viewer): breadcrumb trail for relative-link navigation (#39) (65ffb0e)
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.
"Breadcrumb" named two unrelated things inside the sticky overlay (the region painted over the top of the viewer): the cross-document link trail, and the current heading's ancestor chain. This reserves breadcrumb and crumb for the trail, renames the heading concept to the ancestor stack, and moves the overlay's row builders out of
toc-util. No behavior change.An audit of the CLAUDE.md glossary against the code turned up the collision. The two concepts render one above the other in
StickyHeader, so any sentence about "crumbs" was ambiguous about which one it meant. The glossary entry forCrumbhad also gone stale, describing a shape the type no longer has.Key Changes
BreadcrumbRowis nowAncestorRow, andbreadcrumbRowsis nowancestorRows. Breadcrumb and crumb refer only to the cross-document trail.onBreadcrumbClickandonCrumbClick. Both are nowonAncestorClick.overlay-rowsmoduletoc-util. No TOC sidebar code called them.fold.tsconsumes the same builder the renderer does. Displayed rows and occluded rows cannot drift apart.findCurrenthad no callers outside its own tests.toc-utilre-exportedinlineVisibleWidth, which both real consumers already imported from its home module. Its tests moved there too.truncateLabelLeftmoved tolabel.ts