perf(list): stabilize item registry order#515
Closed
JustYannicc wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
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.
What changed
List.Itemregistry order in a ref, matching the existing Grid item pattern, so selection-context renders do not allocate a new order.scripts/test-list-registry-stable-order.mjsas both a reportable churn measurement and a regression guard.Why
ListItemComponentconsumesSelectedItemActionsContextso selected item changes re-render the hidden List item tree.++itemOrderCounterparticipated in the registration layout-effect dependencies, causing every item to unregister/register when selection changed.Compatibility impact
How tested
node scripts/test-list-registry-stable-order.mjs --reporton pre-change code with 1,000 items and 25 selection moves reportedorderMode=render-counter,layoutEffectRestarts=25000,registryMutationsOnSelection=50000,registryVersionUpdatesOnSelection=25.orderMode=stable-ref,layoutEffectRestarts=0,registryMutationsOnSelection=0,registryVersionUpdatesOnSelection=0.node --test scripts/test-list-registry-stable-order.mjspnpm test(passes; live Electron crash recovery test skipped because Electron is not launchable here)pnpm check:i18n(exits 0; reports existing Italian missing keys:settings.ai.whisper.vocabulary,settings.extensions.appSearchScope)pnpm build:mainpnpm build:renderersrc/renderer/src/raycast-api/list-runtime-renderers.tsx: no errorspnpm exec tsc -p tsconfig.renderer.json --noEmitstill fails on existing renderer-wide type debt outside this change.