improvement(ui): remove React anti-patterns, fix CSP violations#4203
improvement(ui): remove React anti-patterns, fix CSP violations#4203waleedlatif1 merged 4 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates header action semantics and styling by adding an Fixes CSP issues by adding Reviewed by Cursor Bugbot for commit dcfc5f6. Configure here. |
Greptile SummaryCleans up React anti-patterns across four components ( Confidence Score: 5/5Safe to merge — all findings are P2 or lower and no correctness or data-integrity issues were found. React pattern changes are each correct (render-time reset, plain functions on non-memoized consumers, memo on the right boundary). CSP additions are properly scoped to dev/hosted environments. The only finding is a minor CSP inconsistency where ws://localhost:4722 is gated on isDev instead of isReactGrabEnabled, which has no production impact. apps/sim/lib/core/security/csp.ts — minor guard inconsistency for ws://localhost:4722 Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[MothershipView memo] -->|plain fn| B[handleCyclePreview]
A -->|render-time reset| C["prevActiveId check → setPreviewMode('preview')"]
A --> D[ResourceTabs]
D -->|memoized| E[ResourceTabItem ×N]
E -->|stable dispatch| F[setHoveredTabId]
E -->|useCallback| G[handleDragStart/Over/End\nhandleTabClick / handleRemove]
H[MessageActions memo] -->|plain fns| I[copyToClipboard\ncopyRequestId\nhandleFeedback*]
I -->|native elements only| J["button onClick"]
K[ResourceHeader] -->|active prop| L{active?}
L -->|true| M[surface-active bg]
L -->|false| N[hover-only bg]
L -->|undefined| O[original subtle style]
Reviews (2): Last reviewed commit: "improvement(ui): add RefreshCw icon, upd..." | Re-trigger Greptile |
…yling for header actions
|
@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 dcfc5f6. Configure here.
Summary
Type of Change
Testing
Tested manually
Checklist