Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds quick search functionality from song details by enabling taps on song name, author, and album, and integrates a new search type state (typeAtom) into the search flow.
- Introduces a new atom (typeAtom) to keep track of the search type.
- Updates the search page to pick up URL parameters (query and type) and trigger search automatically.
- Enhances song item options to support navigation to the search page via onPress and onLongPress events.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/searchPage/store/atoms.ts | Added typeAtom to support search type. |
| src/pages/searchPage/index.tsx | Updated to extract type from URL parameters and trigger search accordingly. |
| src/pages/searchPage/components/resultPanel/index.tsx | Updated initial tab selection logic based on the new typeAtom state. |
| src/pages/searchPage/components/navBar.tsx | Minor adjustment in input autofocus based on query string. |
| src/core/router/index.ts | Updated router parameters for "search-page" to accept type and query. |
| src/components/panels/types/musicItemOptions.tsx | Extended song item options for quick search navigation with onLongPress handlers. |
Comments suppressed due to low confidence (2)
src/components/panels/types/musicItemOptions.tsx:62
- The function 'hidePanel' is called but is not defined or imported. Ensure that it is declared or imported appropriately before use.
hidePanel();
src/pages/searchPage/components/resultPanel/index.tsx:30
- [nitpick] The variable name 'scene' may be ambiguous since it holds a search type value. Consider renaming it to 'searchType' for clarity.
const [scene] = useAtom(typeAtom);
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.
支持歌曲详情点击歌名、作者、专辑快捷搜索