Skip to content

BL-14367 speed up initial preloading of selected language#75

Merged
hatton merged 1 commit intomainfrom
BL-14367_speed_initial_selection
Mar 3, 2025
Merged

BL-14367 speed up initial preloading of selected language#75
hatton merged 1 commit intomainfrom
BL-14367_speed_initial_selection

Conversation

@nabalone
Copy link
Collaborator

@nabalone nabalone commented Mar 1, 2025

This change is Reviewable

Copy link
Collaborator Author

@nabalone nabalone left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions


components/language-chooser/react/common/language-chooser-react-hook/useLanguageChooser.ts line 111 at r1 (raw file):

    }
    // TODO future work: if the selection language is lower in the search results such that its
    // language card isn't initially visible, we should automatically scroll to it

I've already done this but forgot to delete the comment


components/language-chooser/react/language-chooser-react-mui/src/LanguageChooser.tsx line 417 at r1 (raw file):

                >
                  <LazyLoad
                    offset={initialScrollingNeeded ? 1000000 : 500} // Normally, load a 500px buffer under the visible area so we don't have to get the calculation perfect. But if initial scrolling is needed, load everything so we can scroll the appropriate amount

Looks like this was actually unnecessary - when appropriate we scroll to the parent div, and then LazyLoad detects what is in the viewport and renders that, so no need to load all the cards even for initial scrolling

@hatton hatton merged commit eb77794 into main Mar 3, 2025
1 of 2 checks passed
@hatton hatton deleted the BL-14367_speed_initial_selection branch March 3, 2025 17:00
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.

2 participants