feat: add auto-hide header that responds to scroll direction#12
Merged
feat: add auto-hide header that responds to scroll direction#12
Conversation
Hide the header when scrolling down and reveal it when scrolling up. Uses a custom `useScrollDirection` hook that listens to `wheel` events to avoid false positives from programmatic scrolling (e.g. ProseMirror scrollIntoView). A mousedown lock prevents click-triggered wheel events from toggling the header. CSS `overscroll-none` disables rubber-band bouncing in the scroll container, and `overflow: hidden` on html/body prevents app-level bounce. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
useScrollDirectionhook that tracks scroll direction viawheelevents (notscroll) to avoid false positives from ProseMirror'sscrollIntoViewmax-height: 0animation when scrolling down and reappears when scrolling up, reclaiming editor space (no visual gap)html, body { overflow: hidden }) and editor container level (overscroll-none)Details
useScrollDirectionhook (src/shared/hooks/useScrollDirection.ts)wheelevents instead ofscrollto ignore programmatic scrolling from BlockNote/ProseMirrormousedownfrom toggling the headerscrollTop === 0Layout changes (
src/App.tsx)max-heighttransition (nottransform) so the editor reclaims the spaceoverscroll-noneto prevent bounce at content edgesGlobal styles (
src/index.css)html, body { overflow: hidden }prevents app-level rubber-band bounce on macOSTest plan
wheelevent)🤖 Generated with Claude Code