refactor(viewer): one owner for heading + breadcrumb-offset semantics - #36
Merged
Conversation
Startup benchmark (
|
| build | mean | ratio | verdict |
|---|---|---|---|
| baseline (main@df5667d) | 795.7ms ± 32.3ms | — | |
| PR | 782.0ms ± 12.6ms | 0.98× | ✅ ok |
Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.
denolfe
added a commit
that referenced
this pull request
Jul 24, 2026
- fix(viewer): eliminate flicker on navigation and backward heading jumps (#38) (1766f82) - refactor(state): replace AppState god-object with a command surface (#37) (7854792) - refactor(viewer): one owner for heading + breadcrumb-offset semantics (#36) (85dc9e4) - refactor(viewer): extract useProgressiveMount hook (#35) (df5667d) - refactor(viewer): extract viewport geometry (#34) (f3b8ffd) - refactor: live document in a navigation module (#33) (665db23) - fix: correctness bugs in rendering, navigation, and CLI input handling (#32) (a297f16) - fix: keep sticky breadcrumb correct after navigating a relative link (#31) (26d6fe2) - chore: add test/showcase.md (22e14c1) - chore: update README (bf8b5c1) - test: silence act() warnings (#30) (a5ae2b5) - fix: treat frontmatter as topmost navigation stop (#29) (61f2eb9) - feat: clickable sticky headers (#28) (6f4666d)
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.
Consolidates current-heading and breadcrumb-offset logic. A new pure module
heading-resolution.tsholds the two offset conventions and the fixed-point resolver that were previously spread across the viewer, dispatch, and toc-util. Runtime behavior is unchanged.Key Changes
heading-resolution.tsmodulefoldOffsetandaboveOffsetname the two offset conventions. Fold excludes the heading's own crumb and adds the back badge. Above includes the crumb and drops the badge.resolveHeadingsowns the current/visible fixed-point loop moved out of dispatch. It takes geometry as a plain argument, so it is unit-tested against a geometry fake instead of a live scrollbox.ScrollboxHandledropsgetHeadingNearTopandgetVisibleHeadingIds. It exposesgetGeometry()instead.breadcrumbHeightForHeading,breadcrumbHeightAboveHeading, and thebreadcrumbHeightAfterJumpalias, plus the local fixed-point loop in dispatch.