fix: home screen tweaks #393
Merged
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.
Greptile Overview
Greptile Summary
This PR implements several UX improvements for the home screen animations:
Animation Timing & Interactivity
useMountAnimhook inanimation.tsthat handles smooth mounting/unmounting of elements with proper animation interruption supportpointerEvents: 'none',tabIndex: -1) until their animations begin, preventing users from clicking invisible elementsinputReadystate andonBeginanimation callbacks ensure interactive elements only become accessible when visibleDropdown Menu Behavior
submittingRefpattern - when a user selects a menu item, the ref prevents the menu from immediately reopening due to the input value changeVisual Improvements
overflow-hiddento the wrapper div that's being animatedflex-1with right alignment, while token name/symbol shrink as neededAnimation Tweaks
springInstanttiming (stiffness: 1200→1400, damping: 38→40) for slightly snappier interactionswrapperRefpropAll changes work together to create a smoother, more polished animation experience without any visual glitches or premature interactivity.
Confidence Score: 5/5
Important Files Changed
File Analysis
Sequence Diagram
sequenceDiagram participant User participant HomePage as Home Page Component participant ExploreInput participant useMountAnim as useMountAnim Hook participant SpotlightLinks participant DOM User->>HomePage: Page loads activate HomePage HomePage->>HomePage: handlePhaseChange('start') HomePage->>ExploreInput: Render with wrapperRef ExploreInput->>DOM: Mount wrapper (opacity:0, pointerEvents:none) HomePage->>HomePage: animate(exploreWrapperRef) Note over HomePage: onBegin callback fires HomePage->>ExploreInput: Set pointerEvents='auto' HomePage->>HomePage: setInputReady(true) HomePage->>ExploreInput: Update tabIndex to 0 par Spotlight Links Animation HomePage->>SpotlightLinks: Render spotlight pills SpotlightLinks->>DOM: Mount pills (opacity:0, pointerEvents:none) SpotlightLinks->>SpotlightLinks: animate with stagger Note over SpotlightLinks: onBegin callback fires SpotlightLinks->>DOM: Set pointerEvents='auto' on all pills end User->>ExploreInput: Type search query ExploreInput->>ExploreInput: setShowResults(true) ExploreInput->>useMountAnim: open=true useMountAnim->>useMountAnim: setMounted(true) useMountAnim->>DOM: Mount dropdown (opacity:0) useMountAnim->>DOM: animate(enter) User->>ExploreInput: Click suggestion ExploreInput->>ExploreInput: handleSelect() ExploreInput->>ExploreInput: submittingRef.current=true ExploreInput->>ExploreInput: setShowResults(false) ExploreInput->>useMountAnim: open=false useMountAnim->>DOM: animate(exit) useMountAnim->>useMountAnim: setMounted(false) after animation Note over ExploreInput: submittingRef prevents menu from reopening when input value changes deactivate HomePage