Skip to content

Conversation

@mettta
Copy link
Collaborator

@mettta mettta commented Aug 28, 2025

  • Simplified and cleaned guards: removed redundant checks, unified coordinate comparisons in IntersectionObserver, simplified hash extraction.
  • Robustness improvements: added viewport fallback for rootBounds=null, replaced silent guards with console.assert and moved checks to call sites.
  • Efficient re-scan: introduced anchorsCount/anchorsSig to detect TOC mutations and skip unnecessary re-observe, while keeping mapping valid after resetState().
  • Removed legacy code: dropped unused contentFrameTop metric and clarified inline comments.
  • Hash remapping: implemented resolveMovedFragment() to transparently remap outdated hashes when TOC entries are reordered and renumbered.

@mettta mettta requested a review from stanislaw August 28, 2025 06:16
if (!element) { return } // Guard against race conditions
// * Toggle "parented" attribute for section folders.

//// Guard against race conditions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, let's not forget to remove this.

// * Toggle "intersected" attribute for visible anchors.

//// Guard: events may fire before TOC is fully built.
////// Guard against race conditions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, let's not forget to remove this.

@stanislaw stanislaw modified the milestones: 2025-Q3, 2025-Q4 Sep 27, 2025
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.

3 participants