perf(renderer): reduce UI runtime churn#572
Open
JustYannicc wants to merge 9 commits into
Open
Conversation
This was referenced Jul 4, 2026
Contributor
|
Reviewed the full diff and traced each hot-path change against its consumers. This is a tight, behavior-preserving perf pass that also fixes a latent emoji-grid scroll bug. Strengths
Concerns / potential bugs
Suggestions (optional)
🟡 Approve with minor comments 🤖 Automated review by Claude Code (Opus 4.8). |
Collaborator
Author
|
Addressed the remaining actionable review suggestion from the top-level feedback. What changed:
Review-thread state checked:
Verification:
|
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
Listis rendering the emoji-grid layout, and keep emoji-grid keyboard selection visible by scrolling the rendered selected cell.useFormerror updates through guarded form error-map helpers so no-op clears and same-value validation errors keep object identity.useFormno-op error churn, and inline emoji picker match caching.useFormchange to be self-contained onorigin/main, and type the list-detail fragment props that focused LSP diagnostics surfaced in the touched file.Why
These paths sit in renderer/runtime hot loops: large emoji-heavy Raycast lists, form field changes, validation writes, and inline emoji picker navigation. The consolidation removes repeated work while keeping the current Raycast-compatible behavior and avoiding the unrelated integration-stack commits carried under the smaller source branches.
Compatibility impact
Raycast list, form, and inline emoji picker APIs are unchanged. Normal list virtualization still builds and renders the same flat rows. Emoji-grid mode still renders the same grouped items and now scrolls the actual selected rendered cell into view instead of relying on discarded linear-row layout data. Form errors still clear on value changes and publish changed validation errors; no-op cases now return the previous error map. Emoji picker match order, wraparound navigation, zero-match hide, insertion, and cache clearing on hide are preserved.
How tested
node --test scripts/test-list-conditional-virtual-rows.mjs scripts/test-use-form-error-state-noop.mjs scripts/test-inline-emoji-picker-match-cache.mjspassed: 7 tests, 0 failures.node scripts/test-list-conditional-virtual-rows.mjs --reportpassed and emitted the row-work report below.node scripts/test-use-form-error-state-noop.mjs --reportpassed and emitted the identity-churn report below../node_modules/.bin/tsc -p tsconfig.main.json --noEmit --pretty falsepassed../node_modules/.bin/tsc -p tsconfig.renderer.json --noEmit --pretty falsefailed with exit code 2 on existing upstream-main renderer errors outside this change, includingsrc/renderer/src/App.tsx,CameraExtension.tsx,LiquidGlassSurface.tsx,useLauncherCommandModel.ts,useLauncherKeyboardControls.ts,i18n/runtime.ts,QuickLinkManager.tsx,action-runtime-overlay.tsx,context-scope-runtime.ts,detail-runtime.tsx,use-cached-promise.ts,icon-runtime-phosphor.tsx,index.tsx,list-runtime-renderers.tsx,oauth/with-access-token.tsx,settings/AITab.tsx,settings/StoreTab.tsx,SnippetManager.tsx, andutils/quicklink-icons.tsx. The prior focusedlist-runtime.tsxdiagnostic was fixed in this branch.src/main/main.ts,src/renderer/src/raycast-api/hooks/use-form.ts,src/renderer/src/raycast-api/form-runtime-state.ts, orsrc/renderer/src/raycast-api/list-runtime.tsx.git diff --check origin/main..HEADpassed.Performance evidence
useFormno-error field changes: 10/100/1000 changes previously produced 10/100/1000 error-object identity changes; after this change all three cases produce 0. Same-error validation sets keep identity, changed errors publish, and clearing an existing field preserves unrelated errors.smi, 500 sequences of 20 right-arrow steps: legacy model made 20,000 search calls in 2515.564 ms total; cached model made 500 search calls in 61.619 ms total; 40x search-call reduction with matching checksum113000.Stack validation
This branch starts from upstream
origin/mainat9bdd3d2a99cbb30a7688e85784c3464a706ae7b0. It carefully applies only the scoped top changes from #559, #562, and #567, plus the minimal helper/type/test adjustments needed to make those changes self-contained and validated on the clean base. It does not add coordinator notes, prompt files, local playbooks, or generated package-manager metadata.Replaces