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.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 18, 2026 9:33pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 18, 2026

Greptile Summary

This PR makes several UX improvements and removes an architectural antipattern:

Store Refactor

  • Removed the Zustand general settings store entirely, making TanStack Query the single source of truth
  • Eliminated the antipattern of syncing React Query cache to Zustand store
  • Added convenience selector hooks (useAutoConnect, useShowTrainingControls, etc.) for accessing individual settings
  • Updated workflow.tsx to use ref pattern for capturing isAutoConnectEnabled, preventing stale closure issues in callbacks

Google Drive Updates

  • Removed the "Restore from Trash" (untrash) operation from the Google Drive block
  • Added missing type properties (hasAugmentedPermissions, inheritedPermissionsDisabled, downloadRestrictions)
  • Enhanced output definitions with more descriptive fields for download and list operations

Advanced to Additional Fields

  • Renamed "Show advanced fields" to "Show additional fields" throughout the UI
  • Made the additional fields toggle condition-aware at the tool level rather than block level
  • Enhanced output condition evaluation to properly handle null and undefined values in array conditions
  • Added filtering support to getToolOutputPaths based on subBlock conditions

Nested Tag Dropdown

  • Implemented unlimited depth nested folder navigation using recursive tree-building algorithm
  • Added React context (NestedNavigationContext) to manage nested navigation state
  • Implemented comprehensive keyboard navigation (Arrow keys, Enter) for nested folders
  • Added NestedTagChild type and nestedChildren property for recursive nesting support

Dialog Verbiage

  • Made delete confirmations more explicit by showing the specific name of the item being deleted (agent name, workspace name)

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured refactors that improve architecture (removing antipatterns), enhance UX (better verbiage, nested navigation), and maintain type safety. The Zustand-to-TanStack migration properly uses refs to avoid closure issues, and the nested tag dropdown implementation is clean with proper TypeScript types
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/hooks/queries/general-settings.ts Removed Zustand sync antipattern, added convenience selector hooks for individual settings values
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Migrated from Zustand to TanStack Query hooks, uses ref pattern to capture autoConnect for stable callback
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx Changed 'advanced fields' to 'additional fields', made visibility condition-aware at tool level
apps/sim/lib/workflows/blocks/block-outputs.ts Enhanced condition evaluation to handle null/undefined in arrays, added filtering to getToolOutputPaths
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx Major refactor for unlimited nested tag navigation with tree-building algorithm and React context

Sequence Diagram

sequenceDiagram
    participant Component as React Component
    participant TanStack as TanStack Query
    participant API as Settings API
    participant Zustand as Zustand Store (REMOVED)
    
    Note over Component,Zustand: BEFORE: Antipattern with dual state
    Component->>TanStack: useGeneralSettings()
    TanStack->>API: fetchGeneralSettings()
    API-->>TanStack: settings data
    TanStack->>Zustand: syncSettingsToZustand()
    Note over Zustand: Duplicate state!
    TanStack-->>Component: settings
    Component->>Zustand: useGeneralStore()
    Zustand-->>Component: settings (duplicate)
    
    Note over Component,API: AFTER: Single source of truth
    Component->>TanStack: useAutoConnect()
    TanStack->>API: fetchGeneralSettings()
    API-->>TanStack: settings data
    TanStack-->>Component: autoConnect value
    Note over Component: No Zustand sync!
    
    Note over Component,TanStack: Mutation flow (optimistic updates)
    Component->>TanStack: useUpdateGeneralSetting()
    TanStack->>TanStack: Optimistically update cache
    TanStack->>API: PATCH /settings
    alt Success
        API-->>TanStack: 200 OK
        TanStack->>TanStack: Confirm cache update
    else Error
        API-->>TanStack: Error
        TanStack->>TanStack: Rollback to previous cache
    end
    TanStack-->>Component: Updated settings
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

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 merged commit 3a92364 into staging Jan 18, 2026
10 checks passed
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.

3 participants