Skip to content

chore(stores): remove unused exports and dead code from zustand stores#4014

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/audit-zustand-stores
Apr 7, 2026
Merged

chore(stores): remove unused exports and dead code from zustand stores#4014
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/audit-zustand-stores

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Remove dead Workflow interface from folders store (never imported anywhere)
  • Remove unused useIsTaskSelected selector from folders store
  • Remove unused getDefaultVariablesDimensions from variables modal store
  • Stop re-exporting internal-only symbols through barrel files (terminal utils, AddNotificationParams)

Type of Change

  • Chore / cleanup

Testing

Type check passes, lint passes

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 7, 2026

PR Summary

Low Risk
Low risk cleanup that only removes dead types/selectors and narrows barrel exports; main risk is breaking any external imports that relied on the removed re-exports.

Overview
Cleans up several zustand store modules by removing unused/dead public surface area.

Drops the unused Workflow type and useIsTaskSelected export from the folders store, removes getDefaultVariablesDimensions from the variables modal store, and narrows barrel exports in notifications and terminal to stop re-exporting internal-only types/utilities (keeping only safeConsoleStringify from terminal console utils).

Reviewed by Cursor Bugbot for commit cd2cbce. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 7, 2026 4:33pm

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 7, 2026

Greptile Summary

This PR is a targeted dead-code cleanup across several Zustand stores, removing unused selectors, dead interfaces, and tightening barrel exports to stop leaking internal-only types to the public API surface.

  • Removes useIsTaskSelected from stores/folders/store.ts and its barrel — confirmed zero usages across the codebase
  • Removes the unused Workflow interface from stores/folders/types.ts
  • Removes getDefaultVariablesDimensions from stores/variables/modal.ts and its barrel — confirmed zero usages
  • Stops re-exporting AddNotificationParams through stores/notifications/index.ts — it is internal to the notifications store only and has no external consumers
  • Correctly routes safeConsoleStringify through the console and terminal barrel files, matching existing import patterns in the two consuming components (terminal.tsx and output-panel.tsx)

Confidence Score: 5/5

Safe to merge — pure dead-code removal with no logic changes or behavioral impact

All removed symbols (useIsTaskSelected, Workflow interface, getDefaultVariablesDimensions, AddNotificationParams barrel export) were confirmed unused via codebase-wide search. The safeConsoleStringify barrel reorganization is correct and matches existing import patterns. No logic changes were introduced.

No files require special attention

Important Files Changed

Filename Overview
apps/sim/stores/folders/store.ts Removed unused useIsTaskSelected selector — confirmed zero usages across the entire codebase
apps/sim/stores/folders/types.ts Removed dead Workflow interface — was never imported outside this file
apps/sim/stores/folders/index.ts Barrel updated to drop useIsTaskSelected export, correctly retaining useIsFolderSelected and useIsWorkflowSelected
apps/sim/stores/notifications/index.ts Removed AddNotificationParams from public barrel — type is only used internally within the notifications store
apps/sim/stores/terminal/console/index.ts Added safeConsoleStringify to console barrel so it flows cleanly through the terminal barrel to consumers
apps/sim/stores/terminal/index.ts Re-exports safeConsoleStringify from ./console, matching how both consuming components import it via @/stores/terminal
apps/sim/stores/variables/index.ts Removed getDefaultVariablesDimensions from barrel — confirmed zero usages outside the store itself
apps/sim/stores/variables/modal.ts Removed getDefaultVariablesDimensions function — dead code with no callers

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Before["Before — leaky barrel exports"]
        A1[stores/folders/index.ts] -->|exported| B1[useIsTaskSelected ❌]
        A2[stores/notifications/index.ts] -->|exported| B2[AddNotificationParams ❌]
        A3[stores/variables/index.ts] -->|exported| B3[getDefaultVariablesDimensions ❌]
        A4[stores/terminal/index.ts] -->|missing| B4[safeConsoleStringify ⚠️]
    end
    subgraph After["After — clean public API"]
        C1[stores/folders/index.ts] -->|exports| D1[useFolderStore ✓]
        C1 -->|exports| D2[useIsFolderSelected ✓]
        C1 -->|exports| D3[useIsWorkflowSelected ✓]
        C2[stores/notifications/index.ts] -->|exports| D4[useNotificationStore ✓]
        C2 -->|exports| D5[Notification / NotificationAction ✓]
        C3[stores/terminal/console/index.ts] -->|exports| D6[safeConsoleStringify ✓]
        C4[stores/terminal/index.ts] -->|re-exports| C3
        C5[terminal.tsx / output-panel.tsx] -->|import from| C4
    end
Loading

Reviews (1): Last reviewed commit: "chore(stores): remove unused exports and..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 0b439ec into staging Apr 7, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/audit-zustand-stores branch April 7, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant