refactor(stores): consolidate variables stores into stores/variables/#3930
Conversation
Move variable data store from stores/panel/variables/ to stores/variables/ since the panel variables tab no longer exists. Rename the modal UI store to useVariablesModalStore to eliminate naming collision with the data store. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Splits concerns by introducing a dedicated UI-only modal store ( Consolidates variable-related types into Reviewed by Cursor Bugbot for commit a29cbb1. Configure here. |
Greptile SummaryThis PR is a clean structural refactoring that consolidates two previously separate variable store locations into a single Key changes:
The refactoring is logically sound and the naming is now unambiguous. The PR passes Confidence Score: 5/5Safe to merge — pure store reorganization with no logic changes; tsc and lint pass cleanly. All remaining findings are P2. The single comment flags a pre-existing Record<string, any> that the PR could have tightened while touching the file, but it causes no runtime issue. The naming collision is resolved, the barrel exports are complete, and the deleted stores/panel/variables/ directory is fully replaced. apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/use-change-detection.ts — minor any-type tightening opportunity Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Before["Before (stores/panel/variables/)"]
PV["stores/panel/variables/store.ts\n(useVariablesStore — data)"]
PVT["stores/panel/variables/types.ts"]
PVI["stores/panel/variables/index.ts"]
PVM["stores/variables/modal.ts\n(useVariablesStore — modal ⚠️ name collision)"]
end
subgraph After["After (stores/variables/)"]
VS["stores/variables/store.ts\n(useVariablesStore — data)"]
VM["stores/variables/modal.ts\n(useVariablesModalStore — modal ✅)"]
VT["stores/variables/types.ts\n(merged data + modal types)"]
VI["stores/variables/index.ts\n(barrel export)"]
end
subgraph Consumers
WR["stores/workflows/registry/store.ts"]
CW["hooks/use-collaborative-workflow.ts"]
VC["components/variables/variables.tsx"]
CD["use-change-detection.ts"]
WE["use-workflow-execution.ts"]
API["api/workflows/id/variables/route.ts"]
DUP["lib/workflows/persistence/duplicate.ts"]
VM2["lib/workflows/variables/variable-manager.ts"]
end
Before -->|"refactor"| After
VS --> Consumers
VM --> VC
VT --> VS & VM & WR & API & DUP & VM2
VI --> Consumers
Reviews (2): Last reviewed commit: "fix: remove unused workflowId variable i..." | Re-trigger Greptile |
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/variables/variables.tsx
Show resolved
Hide resolved
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@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 a29cbb1. Configure here.
Summary
stores/panel/variables/tostores/variables/store.ts— the panel variables tab was removed, so the store no longer belongs understores/panel/useVariablesStoretouseVariablesModalStoreto eliminate the naming collision that forced aliased imports (useVariablesStore as usePanelVariablesStore)migrateStringToPlainfunction (defined but never called)stores/variables/types.tsTest plan
bunx tsc --noEmitpasses with zero errorsbun run lintpasses with zero errors