chore: fix rerenders on files#3805
chore: fix rerenders on files#3805adithyaakrishna wants to merge 2 commits intosimstudioai:stagingfrom
Conversation
PR SummaryLow Risk Overview Improves list performance by adding debounced search input, caching Written by Cursor Bugbot for commit 3750f6e. This will update automatically on new commits. Configure here. |
|
@adithyaakrishna is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Greptile SummaryThis PR applies a focused set of re-render optimisations to the Files page. The changes fall into four categories: (1) Confidence Score: 4/5Safe to merge; the only notable issue is a minor UX regression (200ms delay on the search clear button) that does not affect data integrity or core functionality. All P1-critical paths (file creation, editing, saving, deletion, renaming) are unaffected. The memo and ref-based optimisations are correct. The single real regression is the 200ms delay before the search clear button appears, which is cosmetic and bounded in duration. The missing useMemo deps are theoretically unsafe but practically stable today. apps/sim/app/workspace/[workspaceId]/files/files.tsx — specifically the searchConfig value getter pattern and rows useMemo dependency array Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Input as Search Input (DOM)
participant RSB as ResourceOptionsBar (memo)
participant Files as Files Component
participant Ref as searchValueRef
participant Timer as Debounce Timer
User->>Input: types character
Input->>Files: onChange → handleSearchChange(value)
Files->>Ref: searchValueRef.current = value
Files->>Timer: clearTimeout + setTimeout 200ms
Note over RSB: No re-render — searchConfig ref is stable
Timer-->>Files: 200ms elapsed → setDebouncedSearchTerm(value)
Files->>Files: re-render triggered
Files->>RSB: search={searchConfig} (same reference)
RSB->>Ref: search.value getter → searchValueRef.current
RSB->>Input: value = current ref value (correct)
Note over RSB: Clear button (✕) NOW visible (200ms late)
Reviews (1): Last reviewed commit: "chore: fix rerenders on files" | Re-trigger Greptile |
c5ee461 to
3750f6e
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub. |

Summary
Type of Change
Testing
Checklist