improvement(files): react-doctor performance pass on the files module#5330
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview
Selection: Docs ( Reviewed by Cursor Bugbot for commit 3c0b175. Configure here. |
Greptile SummaryThis PR applies targeted, behavior-preserving performance improvements to the files module: a
Confidence Score: 5/5All three changes are behavior-preserving refactors with no new network calls, state mutations, or API contract changes; safe to merge. The Map lookup and single-pass partition are strictly equivalent to the replaced code for all inputs reachable at runtime: No files require special attention — all changes are local to the files module and the owner-cell utility. Important Files Changed
Reviews (3): Last reviewed commit: "fix(files): use spread-sort not toSorted..." | Re-trigger Greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2bf35a9. Configure here.
…rash) SWC does not polyfill Array.prototype.toSorted and the repo sets no core-js/browserslist target, so it throws on Safari <16 / iOS 15. Revert the two client-side toSorted calls to [...arr].sort() and correct the harness guidance in sim-components.md accordingly.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3c0b175. Configure here.
Summary
npx react-doctoron the files module and applied the safe, behavior-preserving performance winsmembers.find(...). Now builds amembersByIdmap once and does O(1) lookups;ownerCellaccepts either the array or a precomputedMap(backward compatible, no change for tables/knowledge callers)[...arr].sort()copies with non-mutatingarr.toSorted()(apps/sim is on the ES2023 lib)selectedFileIds/selectedFolderIdsmemos into a single-pass partition instead of parsing every selected row id twice.claude/rules/sim-components.mdso future agent passes apply themType of Change
Testing
tscclean (0 errors), Biome clean,bun run lintgreenpermissionsuniqueness constraintChecklist