chore: replace flashlist with legendlist#281
Conversation
SafeDep Report SummaryPackage Details
This report is generated by SafeDep Github App |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@coderabbitai /pause |
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
概览本PR将整个应用的虚拟列表实现从 FlashList (v1, 变更列表组件全应用迁移:FlashList → LegendList
🎯 4 (Complex) | ⏱️ ~60 分钟相关PR
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (3)
apps/mobile/AGENTS.md (1)
100-113: ⚡ Quick winLegendList 示例建议去除对可变选中态的
extraData依赖(Line 100)当前示例把
selectedId作为extraData传给renderItem,会和迁移约束产生冲突。建议改成 item 组件直接读取状态源(如 store/selector),extraData仅保留真正无法就地读取的静态依赖。As per coding guidelines, “ensure components can read state directly instead of relying on
extraDatafor mutable state”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/mobile/AGENTS.md` around lines 100 - 113, The example passes a mutable selectedId via extraData to LegendList (renderPlaylistItem/extraData/selectedId), which conflicts with migration rules; change renderPlaylistItem to only pass item/playlist to PlaylistItem and remove extraData/useMemo and the extraData prop on LegendList, then make PlaylistItem read selectedId from the canonical state source (store/selector) internally so mutable selection is not forwarded via LegendList.extraData; retain extraData only for truly static dependencies if needed.apps/mobile/src/components/modals/player/LyricsSelectionModal.tsx (1)
362-369: ⚡ Quick win避免通过
extraData传递可变选择状态。当前将
selectedIndices和toggleSelection放入extraData中传给 LegendList,违反了编码规范。根据@legendapp/list/react-native官方文档,不应通过extraData传递会变化的选择状态,因为这会导致列表中所有条目都重新渲染。建议让条目组件直接读取选择状态(例如通过 React Context 或状态库 selector),extraData仅用于传递稳定的、不变的数据。适用行数: 362-369, 524-529
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/mobile/src/components/modals/player/LyricsSelectionModal.tsx` around lines 362 - 369, The extraData object passed to LegendList currently includes mutable selection state (selectedIndices and toggleSelection), causing full-list re-renders; update the implementation so extraData only contains stable values (primaryColor, onSurfaceColor, onSurfaceVariantColor) and remove selectedIndices and toggleSelection from it, then move selection access into the list item component (e.g., the lyric/LegendList item) via a stable selector or React Context/state hook so each item reads selection directly; adjust references to extraData in LegendList usage and ensure item renderer uses the new selection source instead of relying on extraData.apps/mobile/src/features/playlist/local/components/LocalTrackList.tsx (1)
299-334: 🏗️ Heavy lift收敛
extraData,避免承载高频可变状态。当前
extraData包含selection、downloadStatus、isOffline、playableOfflineKeys、insertAfterIndex、colors等高频变化字段,导致每次状态更新时整个列表重新渲染。建议将这些可变状态下沉到TrackListItem组件内部直接读取(例如通过 React Context 或状态库 selector),extraData仅保留稳定的配置项(如回调函数)。这样可避免不必要的全表重渲染,提升列表性能。编码指南要求:"ensure components can read state directly instead of relying on
extraDatafor mutable state"。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/mobile/src/features/playlist/local/components/LocalTrackList.tsx` around lines 299 - 334, The extraData object in LocalTrackList is carrying high-frequency mutable state (selection, downloadStatus, isOffline, playableOfflineKeys, insertAfterIndex, colors) which forces full list re-renders; update extraData to only include stable configuration and callbacks (handleTrackPress, handleMenuPress, onDragStart/onDragUpdate/onDragEnd, isReadOnly, etc.), remove selection, downloadStatus, isOffline, playableOfflineKeys, insertAfterIndex, and theme.colors from the memo dependency; then modify TrackListItem to read those removed mutable pieces directly (via React Context or your state selector library) so TrackListItem subscribes to changes locally per the "ensure components can read state directly instead of relying on extraData for mutable state" guideline.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AGENTS.md`:
- Around line 191-199: The example uses extraData to carry selection state which
conflicts with the guideline; update the sample so the Item component (or a
shared store) reads selection directly instead of relying on extraData: change
renderItem so it derives selected via item or a selector (e.g., Item reads
item.selected or a selection store) and remove the extraData prop from the
LegendList call; keep items, renderItem, Item, LegendList and keyExtractor names
so reviewers can locate and verify the change.
In `@apps/mobile/docs/BEST_PRACTICES.md`:
- Around line 10-11: The guideline text for LegendList is too prescriptive about
passing external state via extraData; update the wording to relax the rule:
state that renderItem should be defined outside the component (renderItem) and
that extraData should be memoized with useMemo when used, but clarify that
components should prefer reading state directly and only pass necessary mutable
values via extraData when required. Locate references to LegendList, renderItem,
extraData, and useMemo in the BEST_PRACTICES.md content and change the sentence
"依赖的外部状态统一通过 `extraData` 传入" to a softer recommendation that prefers direct
state access and reserves `extraData` for necessary cases.
In `@apps/mobile/src/app/downloaded.tsx`:
- Around line 533-538: The list currently passes mutable selection state
(selectMode, selected) inside extraData to LegendList which causes whole-list
re-renders; instead remove any mutable selection fields from extraData and keep
only stable callbacks (e.g., onToggleSelect, onSelectAll) there, then have
DownloadedItem read the live selection state directly (via context, a hook, or a
parent prop that doesn't recreate an object) so selection changes don't recreate
extraData and trigger full list recomputation; update LegendList usage and
DownloadedItem to consume the selection state from the chosen source and only
use extraData for stable callbacks.
In `@apps/mobile/src/app/playlist/remote/multipage/`[bvid].tsx:
- Around line 68-75: The renderCustomItem currently reads mutable UI state
(highlightTrackId) from extraData; instead, refactor to a named function (e.g.,
export or const renderItemName) that closes over the component's local state
(use cid or component-level highlight id) and remove highlightTrackId from the
extraData contract so extraData only carries static callbacks/config; update the
LegendList usage to pass the named renderItem and ensure any place referencing
renderCustomItem (also at the other occurrence) is updated to use the new named
function and component state read instead of extraData.
In `@apps/mobile/src/components/modals/PlayerQueueModal.tsx`:
- Around line 104-108: Move the LegendList renderItem into the PlayerQueueModal
component and stop passing currentTrackId via extraData: define a named
renderItem function inside PlayerQueueModal (e.g., const renderItem =
useCallback(( {item, index} ) => { ... }, [currentTrackId, switchTrackHandler,
removeTrackHandler])) so it captures currentTrackId, switchTrackHandler and
removeTrackHandler from the closure; update the LegendList usage to reference
this named renderItem and remove currentTrackId from the
QueueItemExtraData/extraData payload (or eliminate extraData entirely) and
ensure all references to renderItem and extraData (previously at the LegendList
call) are updated accordingly.
---
Nitpick comments:
In `@apps/mobile/AGENTS.md`:
- Around line 100-113: The example passes a mutable selectedId via extraData to
LegendList (renderPlaylistItem/extraData/selectedId), which conflicts with
migration rules; change renderPlaylistItem to only pass item/playlist to
PlaylistItem and remove extraData/useMemo and the extraData prop on LegendList,
then make PlaylistItem read selectedId from the canonical state source
(store/selector) internally so mutable selection is not forwarded via
LegendList.extraData; retain extraData only for truly static dependencies if
needed.
In `@apps/mobile/src/components/modals/player/LyricsSelectionModal.tsx`:
- Around line 362-369: The extraData object passed to LegendList currently
includes mutable selection state (selectedIndices and toggleSelection), causing
full-list re-renders; update the implementation so extraData only contains
stable values (primaryColor, onSurfaceColor, onSurfaceVariantColor) and remove
selectedIndices and toggleSelection from it, then move selection access into the
list item component (e.g., the lyric/LegendList item) via a stable selector or
React Context/state hook so each item reads selection directly; adjust
references to extraData in LegendList usage and ensure item renderer uses the
new selection source instead of relying on extraData.
In `@apps/mobile/src/features/playlist/local/components/LocalTrackList.tsx`:
- Around line 299-334: The extraData object in LocalTrackList is carrying
high-frequency mutable state (selection, downloadStatus, isOffline,
playableOfflineKeys, insertAfterIndex, colors) which forces full list
re-renders; update extraData to only include stable configuration and callbacks
(handleTrackPress, handleMenuPress, onDragStart/onDragUpdate/onDragEnd,
isReadOnly, etc.), remove selection, downloadStatus, isOffline,
playableOfflineKeys, insertAfterIndex, and theme.colors from the memo
dependency; then modify TrackListItem to read those removed mutable pieces
directly (via React Context or your state selector library) so TrackListItem
subscribes to changes locally per the "ensure components can read state directly
instead of relying on extraData for mutable state" guideline.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: be021e58-5514-46ec-ac35-2da7acbe2a2e
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (33)
AGENTS.mdapps/mobile/AGENTS.mdapps/mobile/docs/BEST_PRACTICES.mdapps/mobile/docs/CONTRIBUTING.mdapps/mobile/docs/Home.mdapps/mobile/package.jsonapps/mobile/src/app/comments/[bvid].tsxapps/mobile/src/app/comments/reply.tsxapps/mobile/src/app/download.tsxapps/mobile/src/app/downloaded.tsxapps/mobile/src/app/history/[date].tsxapps/mobile/src/app/history/overall.tsxapps/mobile/src/app/playlist/external-sync.tsxapps/mobile/src/app/playlist/local/[id].tsxapps/mobile/src/app/playlist/remote/multipage/[bvid].tsxapps/mobile/src/components/modals/PlayerQueueModal.tsxapps/mobile/src/components/modals/app/WelcomeModal.tsxapps/mobile/src/components/modals/lyrics/ManualSearchLyrics.tsxapps/mobile/src/components/modals/player/LyricsSelectionModal.tsxapps/mobile/src/components/modals/playlist/BatchAddTracksToLocalPlaylist.tsxapps/mobile/src/components/modals/playlist/ManualMatchExternalSync.tsxapps/mobile/src/components/modals/playlist/MergePlaylistsModal.tsxapps/mobile/src/components/modals/playlist/UpdateTrackLocalPlaylistsModal.tsxapps/mobile/src/features/downloads/DownloadTaskItem.tsxapps/mobile/src/features/library/collection/CollectionList.tsxapps/mobile/src/features/library/favorite/FavoriteFolderList.tsxapps/mobile/src/features/library/local/LocalPlaylistList.tsxapps/mobile/src/features/library/multipage/MultiPageVideosList.tsxapps/mobile/src/features/playlist/local/components/LocalTrackList.tsxapps/mobile/src/features/playlist/remote/components/RemoteTrackList.tsxapps/mobile/src/features/playlist/remote/toview/components/Item.tsxapps/mobile/src/hooks/ui/useDoubleTapScrollToTop.tsapps/mobile/src/types/list.ts
| const renderItem = ({ item, extraData }) => ( | ||
| <Item item={item} selected={extraData.selected.has(item.id)} /> | ||
| ) | ||
|
|
||
| // Use with memoized extraData | ||
| <FlashList | ||
| <LegendList | ||
| data={items} | ||
| renderItem={renderItem} | ||
| extraData={useMemo(() => ({ selected }), [selected])} | ||
| extraData={extraData} | ||
| keyExtractor={keyExtractor} |
There was a problem hiding this comment.
文档示例与约束方向不一致(Line 191)
这里示例仍把选中态放在 extraData 里,和上方“避免把可直接读取的状态放入 extraData”的规则方向冲突。建议把示例改为 item 组件/Store 直接读取状态,避免误导后续实现。
As per coding guidelines, “ensure components can read state directly instead of relying on extraData for mutable state”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@AGENTS.md` around lines 191 - 199, The example uses extraData to carry
selection state which conflicts with the guideline; update the sample so the
Item component (or a shared store) reads selection directly instead of relying
on extraData: change renderItem so it derives selected via item or a selector
(e.g., Item reads item.selected or a selection store) and remove the extraData
prop from the LegendList call; keep items, renderItem, Item, LegendList and
keyExtractor names so reviewers can locate and verify the change.
| 2. **renderItem 静态化**: `renderItem` 函数必须定义在组件外部,依赖的外部状态统一通过 `extraData` 传入,避免在组件内用闭包创建 render 函数。 | ||
| 3. **extraData memo 化**: 传给 LegendList 的 `extraData` 必须使用 `useMemo`,不要传 inline object。 |
There was a problem hiding this comment.
LegendList 规范表述建议收敛:不要“统一”通过 extraData 传状态(Line 10)
“依赖外部状态统一通过 extraData 传入”这句过强,容易导致把可变状态都塞进 extraData。建议改成:优先让 item 直接读取状态,仅在必要时再使用 extraData。
As per coding guidelines, “ensure components can read state directly instead of relying on extraData for mutable state”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/mobile/docs/BEST_PRACTICES.md` around lines 10 - 11, The guideline text
for LegendList is too prescriptive about passing external state via extraData;
update the wording to relax the rule: state that renderItem should be defined
outside the component (renderItem) and that extraData should be memoized with
useMemo when used, but clarify that components should prefer reading state
directly and only pass necessary mutable values via extraData when required.
Locate references to LegendList, renderItem, extraData, and useMemo in the
BEST_PRACTICES.md content and change the sentence "依赖的外部状态统一通过 `extraData` 传入"
to a softer recommendation that prefers direct state access and reserves
`extraData` for necessary cases.
| <LegendList | ||
| data={filteredTasks} | ||
| renderItem={renderDownloadedItem} | ||
| extraData={extraData} | ||
| keyExtractor={(item) => item.id} | ||
| estimatedItemSize={72} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's locate and examine the downloaded.tsx file
fd -n "downloaded.tsx" -t fRepository: bbplayer-app/BBPlayer
Length of output: 296
🏁 Script executed:
# Get the file size to understand how much content we're dealing with
wc -l apps/mobile/src/app/downloaded.tsxRepository: bbplayer-app/BBPlayer
Length of output: 104
🏁 Script executed:
# Read the specific lines mentioned in the review (533-538) and surrounding context
sed -n '500,560p' apps/mobile/src/app/downloaded.tsx | cat -nRepository: bbplayer-app/BBPlayer
Length of output: 1907
🏁 Script executed:
# Search for the extraData variable definition
rg -n "extraData\s*=" apps/mobile/src/app/downloaded.tsx | head -20Repository: bbplayer-app/BBPlayer
Length of output: 153
🏁 Script executed:
# Search for renderDownloadedItem function
rg -n "renderDownloadedItem|const renderDownloadedItem" apps/mobile/src/app/downloaded.tsx -A 15Repository: bbplayer-app/BBPlayer
Length of output: 963
🏁 Script executed:
# Search for DownloadedItem component
rg -n "DownloadedItem" apps/mobile/src/app/downloaded.tsx | head -20Repository: bbplayer-app/BBPlayer
Length of output: 329
🏁 Script executed:
# Get more context around the beginning of the file to understand state management
head -200 apps/mobile/src/app/downloaded.tsx | tail -150 | cat -nRepository: bbplayer-app/BBPlayer
Length of output: 4486
🏁 Script executed:
# Look at the extraData definition around line 434
sed -n '420,450p' apps/mobile/src/app/downloaded.tsx | cat -nRepository: bbplayer-app/BBPlayer
Length of output: 1132
🏁 Script executed:
# Check if there's any state management (useState, useContext, etc.) at the top of the component
sed -n '200,300p' apps/mobile/src/app/downloaded.tsx | cat -nRepository: bbplayer-app/BBPlayer
Length of output: 3425
🏁 Script executed:
# Look for the main component function definition and its state management
sed -n '300,450p' apps/mobile/src/app/downloaded.tsx | cat -nRepository: bbplayer-app/BBPlayer
Length of output: 4934
🏁 Script executed:
# Look at the end of the extraData useMemo to see the dependency array
sed -n '430,470p' apps/mobile/src/app/downloaded.tsx | cat -nRepository: bbplayer-app/BBPlayer
Length of output: 1254
🏁 Script executed:
# Search for useTrackSelection hook to understand how state is managed
fd "useTrackSelection" -t f apps/mobile/src/Repository: bbplayer-app/BBPlayer
Length of output: 200
🏁 Script executed:
# Check if there's a context provider or wrapper
rg -n "useTrackSelection|TrackSelection" apps/mobile/src/ -lRepository: bbplayer-app/BBPlayer
Length of output: 731
🏁 Script executed:
# Check the useTrackSelection hook to see if state could be accessed directly
cat apps/mobile/src/features/playlist/local/hooks/useTrackSelection.tsRepository: bbplayer-app/BBPlayer
Length of output: 984
🏁 Script executed:
# Check how other components (like in playlist) use LegendList
rg -n "LegendList" apps/mobile/src/app/playlist/ -B 5 -A 10 | head -100Repository: bbplayer-app/BBPlayer
Length of output: 8636
将可变选择态从 extraData 迁出,改由 DownloadedItem 直接读取
当前在 extraData 中包含 selectMode 和 selected 等可变状态,导致这些状态变化时会重新生成 extraData 对象,进而驱动整个列表重新渲染。根据 LegendList 组件约定,应让 DownloadedItem 直接访问这些状态(例如通过上下文),仅在 extraData 中保留稳定的回调函数。这样可避免因选择态变化而产生不必要的列表重算。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/mobile/src/app/downloaded.tsx` around lines 533 - 538, The list
currently passes mutable selection state (selectMode, selected) inside extraData
to LegendList which causes whole-list re-renders; instead remove any mutable
selection fields from extraData and keep only stable callbacks (e.g.,
onToggleSelect, onSelectAll) there, then have DownloadedItem read the live
selection state directly (via context, a hook, or a parent prop that doesn't
recreate an object) so selection changes don't recreate extraData and trigger
full list recomputation; update LegendList usage and DownloadedItem to consume
the selection state from the chosen source and only use extraData for stable
callbacks.
| const renderCustomItem = ({ | ||
| item, | ||
| index, | ||
| extraData, | ||
| }: LegendListRenderItemPropsWithExtraData<BilibiliTrack, ExtraData>) => { | ||
| if (!extraData) throw new Error('Extradata 不存在') | ||
| const shouldFlash = String(item.id) === extraData.highlightTrackId | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
避免通过 extraData 传递高亮这类可变 UI 状态。
这里把 highlightTrackId 作为 extraData 驱动项传入 renderCustomItem,与当前 LegendList 约定不一致。建议让 renderItem 直接读取组件内状态(如闭包读取 cid),extraData 仅保留稳定回调/静态配置。
As per coding guidelines For LegendList components, define renderItem as a named function (not inline anonymous) and ensure components can read state directly instead of relying on extraData for mutable state.
Also applies to: 290-290
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/mobile/src/app/playlist/remote/multipage/`[bvid].tsx around lines 68 -
75, The renderCustomItem currently reads mutable UI state (highlightTrackId)
from extraData; instead, refactor to a named function (e.g., export or const
renderItemName) that closes over the component's local state (use cid or
component-level highlight id) and remove highlightTrackId from the extraData
contract so extraData only carries static callbacks/config; update the
LegendList usage to pass the named renderItem and ensure any place referencing
renderCustomItem (also at the other occurrence) is updated to use the new named
function and component state read instead of extraData.
| type QueueItemExtraData = { | ||
| currentTrackId?: string | ||
| switchTrackHandler: (index: number) => Promise<void> | ||
| removeTrackHandler: (index: number) => Promise<void> | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 验证 PlayerQueueModal 是否通过 extraData 传递可变状态 currentTrackId
rg -n -C2 "type QueueItemExtraData|currentTrackId|extraData=|LegendListRenderItemPropsWithExtraData|renderItem=" apps/mobile/src/components/modals/PlayerQueueModal.tsxRepository: bbplayer-app/BBPlayer
Length of output: 1881
将 renderItem 移到组件内部,通过闭包直接读取 currentTrackId,而非通过 extraData 传递。
当前实现违反编码规范。根据指南要求,LegendList 组件的 renderItem 应定义为具名函数,且组件应直接读取可变状态而不依赖 extraData。现在 currentTrackId(可变状态)经由 extraData 传递(第 179-186 行),违反了此规范。
建议将 renderItem 移入 PlayerQueueModal 组件内,用 useCallback 包裹,直接从闭包捕获 currentTrackId、switchTrackHandler、removeTrackHandler,并移除 currentTrackId 从 extraData 中,或完全删除 extraData 依赖:
示意修改
-type QueueItemExtraData = {
- currentTrackId?: string
- switchTrackHandler: (index: number) => Promise<void>
- removeTrackHandler: (index: number) => Promise<void>
-}
-
-const renderItem = ({
- item,
- index,
- extraData,
-}: LegendListRenderItemPropsWithExtraData<OrpheusTrack, QueueItemExtraData>) => {
- if (!extraData) throw new Error('Extradata 不存在')
- return (
- <TrackItem
- track={item}
- onSwitchTrack={extraData.switchTrackHandler}
- onRemoveTrack={extraData.removeTrackHandler}
- isCurrentTrack={item.id === extraData.currentTrackId}
- index={index}
- />
- )
-}
+const renderQueueItem = useCallback(
+ function renderQueueItem({
+ item,
+ index,
+ }: LegendListRenderItemPropsWithExtraData<OrpheusTrack, undefined>) {
+ return (
+ <TrackItem
+ track={item}
+ onSwitchTrack={switchTrackHandler}
+ onRemoveTrack={removeTrackHandler}
+ isCurrentTrack={item.id === currentTrackId}
+ index={index}
+ />
+ )
+ },
+ [currentTrackId, removeTrackHandler, switchTrackHandler],
+)
...
-<LegendList
+<LegendList
ref={flatListRef}
data={queue}
- renderItem={renderItem}
- extraData={extraData}
+ renderItem={renderQueueItem}
keyExtractor={keyExtractor}
estimatedItemSize={72}另见第 110-128、179-186、256-261 行。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/mobile/src/components/modals/PlayerQueueModal.tsx` around lines 104 -
108, Move the LegendList renderItem into the PlayerQueueModal component and stop
passing currentTrackId via extraData: define a named renderItem function inside
PlayerQueueModal (e.g., const renderItem = useCallback(( {item, index} ) => {
... }, [currentTrackId, switchTrackHandler, removeTrackHandler])) so it captures
currentTrackId, switchTrackHandler and removeTrackHandler from the closure;
update the LegendList usage to reference this named renderItem and remove
currentTrackId from the QueueItemExtraData/extraData payload (or eliminate
extraData entirely) and ensure all references to renderItem and extraData
(previously at the LegendList call) are updated accordingly.
|
✅ Actions performedReviews paused. |
|
LGTM 姐姐你的开发好孤独啊为什么只有bot和agent在回复你 |
????我哭了你不许说话了 |
不是有codex和copilot陪你吗 |
少废话,给我赞助个 codex😋 |




Summary by CodeRabbit
发布说明
依赖升级
改进
文档