Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • more explicit verbiage on some dialog menus
  • google drive updates
  • 'show advanced fields' to 'show additional fields'
    • also make the show additional fields contingent on the tool chosen atm, rather than at the block-level
  • remove general settings store sync in favor of tanstack -> antipattern syncing local zustand store reactquery cache

Type of Change

  • Bug fix
  • New feature

Testing

Manually

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)

…ive updates, advanved to additional fields, remove general settings store sync in favor of tanstack
@vercel
Copy link

vercel bot commented Jan 18, 2026

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

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 18, 2026 5:38pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 18, 2026

Greptile Summary

Removes antipattern of syncing TanStack Query cache to Zustand store for general settings, making TanStack Query the single source of truth. Updates verbiage throughout the application to be more explicit in dialog confirmations and renames "advanced fields" to "additional fields" with improved conditional visibility.

Key Changes

  • Architecture improvement: Eliminated dual state management by removing useGeneralStore and its sync logic with TanStack Query. Added convenience selector hooks (useAutoConnect, useShowTrainingControls, etc.) that read directly from the query cache.
  • Conditional field visibility: Made "Show additional fields" toggle conditional on the currently selected tool, evaluating subblock conditions to only show the toggle when additional fields are actually available.
  • UX improvements: Added explicit item names to deletion confirmation messages across workspace, chat, template, and A2A agent deletion flows.
  • Google Calendar enhancement: Added canonical pair (basic/advanced modes) for move operation destination calendar selection.
  • Google Drive updates: Removed "Restore from Trash" operation from UI dropdown (tool still exists in registry), added new metadata fields, and pagination support for permissions.

Confidence Score: 4/5

  • This PR is safe to merge with careful testing of the state management refactor
  • The architectural change from Zustand to TanStack Query is well-executed with all references properly updated. The ref pattern in workflow.tsx correctly handles the auto-connect callback scenario. The conditional field visibility enhancement is a meaningful improvement. Minor confidence deduction due to the significant architectural shift requiring thorough testing of edge cases (e.g., initial load states, error rollback scenarios).
  • Verify apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx auto-connect behavior and apps/sim/hooks/queries/general-settings.ts error handling with the new selector hooks

Important Files Changed

Filename Overview
apps/sim/stores/settings/general/store.ts Deleted Zustand store in favor of TanStack Query as single source of truth
apps/sim/hooks/queries/general-settings.ts Removed Zustand sync, added selector hooks, now single source of truth for settings
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Replaced store access with query hooks, used ref pattern for auto-connect in callback
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx Renamed 'advanced' to 'additional' fields, made toggle conditional based on tool selection
apps/sim/blocks/blocks/google_calendar.ts Added canonical pair for move operation destination calendar (basic/advanced modes)

Sequence Diagram

sequenceDiagram
    participant Component as React Components
    participant Hook as Query Hooks
    participant Cache as TanStack Cache
    participant API as Backend API
    participant Store as Zustand Store (Deleted)

    Note over Store: Removed in this PR

    rect rgb(200, 220, 240)
        Note over Component,Cache: New Architecture (After)
        Component->>Hook: useAutoConnect()
        Hook->>Cache: useQuery()
        Cache-->>Hook: settings data
        Hook-->>Component: autoConnect value
        
        Component->>Hook: useUpdateGeneralSetting()
        Hook->>API: PATCH /settings
        API-->>Cache: Update cache
        Cache-->>Component: Re-render with new value
    end

    rect rgb(240, 200, 200)
        Note over Component,Store: Old Architecture (Before)
        Component->>Store: useGeneralStore(state => state.isAutoConnectEnabled)
        Store-->>Component: autoConnect value
        
        Component->>Hook: useUpdateGeneralSetting()
        Hook->>API: PATCH /settings
        API-->>Cache: Update cache
        Cache->>Store: syncSettingsToZustand()
        Store-->>Component: Re-render
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

30 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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.

2 participants