perf(toc): 역순 탐색 조기 종료 및 불필요한 getBoundingClientRect 호출 제거 - #89
Merged
Conversation
- useActiveHeading에서 헤딩 목록을 역순(Bottom-up)으로 탐색하여 활성선 기준점 이하의 첫 헤딩 발견 시 즉시 조기 종료(Early-break) 적용 - 긴 포스트 스크롤 시 상단 헤딩들의 불필요한 DOM 측정(Reflow) 방지 - 동일 ID 상태 변경 방지 가드 추가 및 조기 종료 동작 검증 단위 테스트 추가
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.
useActiveHeading에서 헤딩 목록을 역순(Bottom-up)으로 탐색하여 활성선 기준점(0.35) 이하의 첫 헤딩 발견 시 즉시 조기 종료(break) 적용getBoundingClientRect()(강제 Reflow) 반복 호출 방지tests/use-active-heading.test.tsx) 추가