Reset lyrics view scroll position for new song #1607
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.
Related to #1606
Implements automatic resetting of the lyrics view to the top for each new song to enhance user experience.
Action and Reducer Updates:
LYRICS_RESET_SCROLL
inpackages/app/app/actions/lyrics.ts
to manage the resetting of the lyrics scroll position.lyricsResetScroll
that dispatchesLYRICS_RESET_SCROLL
.lyricsSearch
function to dispatchlyricsResetScroll
before starting a new lyrics search, ensuring the lyrics view is reset at the start of each song.LyricsReducer
inpackages/app/app/reducers/lyrics.ts
to handle theLYRICS_RESET_SCROLL
action by resetting the lyrics search result, effectively clearing the view.Lyrics View Component Enhancement:
useEffect
hook inpackages/app/app/components/LyricsView/index.tsx
to listen for changes in the lyrics search result and automatically scroll the lyrics view to the top.These changes collectively ensure that users will start at the top of the lyrics for every new song, addressing the issue raised in the repository.
For more details, open the Copilot Workspace session.