perf(proxies): reduce remaining projection and menu churn (#8622)

This commit is contained in:
Tunglies
2026-11-17 02:55:21 +00:00
committed by GitHub
parent 9f7b390cd4
commit 1b212f9a28
6 changed files with 357 additions and 273 deletions
+13 -8
View File
@@ -571,6 +571,17 @@ function NormalProxyGroups(props: { mode: string }) {
[renderList],
)
const onStickyHeadState = useCallback(
async (groupName: string, patch: Partial<HeadState>) => {
if (patch.filterText !== undefined) {
handleGroupLocationByName(groupName)
await stickyListRef.current?.waitForScrollEnd()
}
onHeadState(groupName, patch)
},
[handleGroupLocationByName, onHeadState],
)
const renderGroupItem = useCallback(
(item: IRenderItem, _index: number, stickyed: boolean) => (
<ProxyRender
@@ -578,13 +589,7 @@ function NormalProxyGroups(props: { mode: string }) {
stickyed={stickyed}
onLocation={handleLocation}
onCheckAll={handleCheckAll}
onHeadState={async (groupName, patch) => {
if (stickyed && patch.filterText !== undefined) {
handleGroupLocationByName(groupName)
await stickyListRef.current?.waitForScrollEnd()
}
onHeadState(groupName, patch)
}}
onHeadState={stickyed ? onStickyHeadState : onHeadState}
onChangeProxy={handleChangeProxy}
onGroupToggle={handleGroupToggle}
/>
@@ -595,7 +600,7 @@ function NormalProxyGroups(props: { mode: string }) {
onHeadState,
handleLocation,
handleGroupToggle,
handleGroupLocationByName,
onStickyHeadState,
],
)