Skip to content

Commit ba48d08

Browse files
committed
fix(verbiage): more explicit verbiage on some dialog menus, google drive updates, advanved to additional fields, remove general settings store sync in favor of tanstack
1 parent ee75721 commit ba48d08

File tree

29 files changed

+183
-152
lines changed

29 files changed

+183
-152
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/chat/chat.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,11 @@ export function ChatDeploy({
409409
<ModalHeader>Delete Chat</ModalHeader>
410410
<ModalBody>
411411
<p className='text-[12px] text-[var(--text-secondary)]'>
412-
Are you sure you want to delete this chat?{' '}
412+
Are you sure you want to delete{' '}
413+
<span className='font-medium text-[var(--text-primary)]'>
414+
{existingChat?.title || 'this chat'}
415+
</span>
416+
?{' '}
413417
<span className='text-[var(--text-error)]'>
414418
This will remove the chat at "{getEmailDomain()}/chat/{existingChat?.identifier}"
415419
and make it unavailable to all users.

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/template/template.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,11 @@ export function TemplateDeploy({
375375
<ModalHeader>Delete Template</ModalHeader>
376376
<ModalBody>
377377
<p className='text-[12px] text-[var(--text-secondary)]'>
378-
Are you sure you want to delete this template?{' '}
379-
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
378+
Are you sure you want to delete{' '}
379+
<span className='font-medium text-[var(--text-primary)]'>
380+
{existingTemplate?.name || formData.name || 'this template'}
381+
</span>
382+
? <span className='text-[var(--text-error)]'>This action cannot be undone.</span>
380383
</p>
381384
</ModalBody>
382385
<ModalFooter>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,11 @@ export function DeployModal({
846846
<ModalHeader>Delete A2A Agent</ModalHeader>
847847
<ModalBody>
848848
<p className='text-[12px] text-[var(--text-secondary)]'>
849-
Are you sure you want to delete this agent?{' '}
849+
Are you sure you want to delete{' '}
850+
<span className='font-medium text-[var(--text-primary)]'>
851+
{existingA2aAgent?.name || 'this agent'}
852+
</span>
853+
?{' '}
850854
<span className='text-[var(--text-error)]'>
851855
This will permanently remove the agent configuration.
852856
</span>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { useShallow } from 'zustand/react/shallow'
77
import { Button, Tooltip } from '@/components/emcn'
88
import {
99
buildCanonicalIndex,
10+
evaluateSubBlockCondition,
1011
hasAdvancedValues,
11-
hasStandaloneAdvancedFields,
1212
isCanonicalPair,
1313
resolveCanonicalMode,
1414
} from '@/lib/workflows/subblocks/visibility'
@@ -131,10 +131,24 @@ export function Editor() {
131131
)
132132
const displayAdvancedOptions = advancedMode || advancedValuesPresent
133133

134-
const hasAdvancedOnlyFields = useMemo(
135-
() => hasStandaloneAdvancedFields(subBlocksForCanonical, canonicalIndex),
136-
[subBlocksForCanonical, canonicalIndex]
137-
)
134+
const hasAdvancedOnlyFields = useMemo(() => {
135+
for (const subBlock of subBlocksForCanonical) {
136+
// Must be standalone advanced (mode: 'advanced' without canonicalParamId)
137+
if (subBlock.mode !== 'advanced') continue
138+
if (canonicalIndex.canonicalIdBySubBlockId[subBlock.id]) continue
139+
140+
// Check condition - skip if condition not met for current values
141+
if (
142+
subBlock.condition &&
143+
!evaluateSubBlockCondition(subBlock.condition, blockSubBlockValues)
144+
) {
145+
continue
146+
}
147+
148+
return true
149+
}
150+
return false
151+
}, [subBlocksForCanonical, canonicalIndex.canonicalIdBySubBlockId, blockSubBlockValues])
138152

139153
// Get subblock layout using custom hook
140154
const { subBlocks, stateToUse: subBlockState } = useEditorSubblockLayout(
@@ -480,7 +494,9 @@ export function Editor() {
480494
onClick={handleToggleAdvancedMode}
481495
className='flex items-center gap-[6px] whitespace-nowrap font-medium text-[13px] text-[var(--text-secondary)] hover:text-[var(--text-primary)]'
482496
>
483-
{displayAdvancedOptions ? 'Hide advanced fields' : 'Show advanced fields'}
497+
{displayAdvancedOptions
498+
? 'Hide additional fields'
499+
: 'Show additional fields'}
484500
<ChevronDown
485501
className={`h-[14px] w-[14px] transition-transform duration-200 ${displayAdvancedOptions ? 'rotate-180' : ''}`}
486502
/>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/terminal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ import {
5050
} from '@/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/hooks'
5151
import { useContextMenu } from '@/app/workspace/[workspaceId]/w/components/sidebar/hooks'
5252
import { getBlock } from '@/blocks'
53+
import { useShowTrainingControls } from '@/hooks/queries/general-settings'
5354
import { useCodeViewerFeatures } from '@/hooks/use-code-viewer'
5455
import { OUTPUT_PANEL_WIDTH, TERMINAL_HEIGHT } from '@/stores/constants'
5556
import { useCopilotTrainingStore } from '@/stores/copilot-training/store'
56-
import { useGeneralStore } from '@/stores/settings/general'
5757
import type { ConsoleEntry } from '@/stores/terminal'
5858
import { useTerminalConsoleStore, useTerminalStore } from '@/stores/terminal'
5959
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
@@ -830,7 +830,7 @@ export const Terminal = memo(function Terminal() {
830830
const [outputOptionsOpen, setOutputOptionsOpen] = useState(false)
831831

832832
const [isTrainingEnvEnabled, setIsTrainingEnvEnabled] = useState(false)
833-
const showTrainingControls = useGeneralStore((state) => state.showTrainingControls)
833+
const showTrainingControls = useShowTrainingControls()
834834
const { isTraining, toggleModal: toggleTrainingModal, stopTraining } = useCopilotTrainingStore()
835835

836836
const [isPlaygroundEnabled, setIsPlaygroundEnabled] = useState(false)

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/workflow-controls.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ import {
2222
import { useSession } from '@/lib/auth/auth-client'
2323
import { useRegisterGlobalCommands } from '@/app/workspace/[workspaceId]/providers/global-commands-provider'
2424
import { createCommand } from '@/app/workspace/[workspaceId]/utils/commands-utils'
25-
import { useUpdateGeneralSetting } from '@/hooks/queries/general-settings'
25+
import { useShowActionBar, useUpdateGeneralSetting } from '@/hooks/queries/general-settings'
2626
import { useCanvasViewport } from '@/hooks/use-canvas-viewport'
2727
import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow'
2828
import { useCanvasModeStore } from '@/stores/canvas-mode'
29-
import { useGeneralStore } from '@/stores/settings/general'
3029
import { useTerminalStore } from '@/stores/terminal'
3130
import { useUndoRedoStore } from '@/stores/undo-redo'
3231
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
@@ -41,7 +40,7 @@ export const WorkflowControls = memo(function WorkflowControls() {
4140
const { fitViewToBounds } = useCanvasViewport(reactFlowInstance)
4241
const { mode, setMode } = useCanvasModeStore()
4342
const { undo, redo } = useCollaborativeWorkflow()
44-
const showWorkflowControls = useGeneralStore((s) => s.showActionBar)
43+
const showWorkflowControls = useShowActionBar()
4544
const updateSetting = useUpdateGeneralSetting()
4645
const isTerminalResizing = useTerminalStore((state) => state.isResizing)
4746

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import { useSocket } from '@/app/workspace/providers/socket-provider'
6363
import { getBlock } from '@/blocks'
6464
import { isAnnotationOnlyBlock } from '@/executor/constants'
6565
import { useWorkspaceEnvironment } from '@/hooks/queries/environment'
66+
import { useAutoConnect, useSnapToGridSize } from '@/hooks/queries/general-settings'
6667
import { useCanvasViewport } from '@/hooks/use-canvas-viewport'
6768
import { useCollaborativeWorkflow } from '@/hooks/use-collaborative-workflow'
6869
import { usePermissionConfig } from '@/hooks/use-permission-config'
@@ -74,7 +75,6 @@ import { useExecutionStore } from '@/stores/execution'
7475
import { useSearchModalStore } from '@/stores/modals/search/store'
7576
import { useNotificationStore } from '@/stores/notifications'
7677
import { useCopilotStore, usePanelEditorStore } from '@/stores/panel'
77-
import { useGeneralStore } from '@/stores/settings/general'
7878
import { useUndoRedoStore } from '@/stores/undo-redo'
7979
import { useVariablesStore } from '@/stores/variables/store'
8080
import { useWorkflowDiffStore } from '@/stores/workflow-diff/store'
@@ -308,9 +308,15 @@ const WorkflowContent = React.memo(() => {
308308

309309
const showTrainingModal = useCopilotTrainingStore((state) => state.showModal)
310310

311-
const snapToGridSize = useGeneralStore((state) => state.snapToGridSize)
311+
const snapToGridSize = useSnapToGridSize()
312312
const snapToGrid = snapToGridSize > 0
313313

314+
const isAutoConnectEnabled = useAutoConnect()
315+
const autoConnectRef = useRef(isAutoConnectEnabled)
316+
useEffect(() => {
317+
autoConnectRef.current = isAutoConnectEnabled
318+
}, [isAutoConnectEnabled])
319+
314320
// Panel open states for context menu
315321
const isVariablesOpen = useVariablesStore((state) => state.isOpen)
316322
const isChatOpen = useChatStore((state) => state.isChatOpen)
@@ -1217,8 +1223,7 @@ const WorkflowContent = React.memo(() => {
12171223
containerId?: string
12181224
}
12191225
): Edge | undefined => {
1220-
const isAutoConnectEnabled = useGeneralStore.getState().isAutoConnectEnabled
1221-
if (!isAutoConnectEnabled) return undefined
1226+
if (!autoConnectRef.current) return undefined
12221227

12231228
// Don't auto-connect starter or annotation-only blocks
12241229
if (options.blockType === 'starter' || isAnnotationOnlyBlock(options.blockType)) {

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription/subscription.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ import {
3232
UsageLimit,
3333
type UsageLimitRef,
3434
} from '@/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/usage-limit'
35-
import { useUpdateGeneralSetting } from '@/hooks/queries/general-settings'
35+
import {
36+
useBillingUsageNotifications,
37+
useUpdateGeneralSetting,
38+
} from '@/hooks/queries/general-settings'
3639
import { useOrganizationBilling, useOrganizations } from '@/hooks/queries/organization'
3740
import { useSubscriptionData, useUsageLimitData } from '@/hooks/queries/subscription'
3841
import { useUpdateWorkspaceSettings, useWorkspaceSettings } from '@/hooks/queries/workspace'
39-
import { useGeneralStore } from '@/stores/settings/general'
4042

4143
const CONSTANTS = {
4244
UPGRADE_ERROR_TIMEOUT: 3000, // 3 seconds
@@ -627,7 +629,7 @@ export function Subscription() {
627629
}
628630

629631
function BillingUsageNotificationsToggle() {
630-
const enabled = useGeneralStore((s) => s.isBillingUsageNotificationsEnabled)
632+
const enabled = useBillingUsageNotifications()
631633
const updateSetting = useUpdateGeneralSetting()
632634
const isLoading = updateSetting.isPending
633635

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/delete-modal/delete-modal.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ export function DeleteModal({
9797
return 'Are you sure you want to delete this folder? This will permanently remove all associated workflows, logs, and knowledge bases.'
9898
}
9999

100+
if (isSingle && displayNames.length > 0) {
101+
return (
102+
<>
103+
Are you sure you want to delete{' '}
104+
<span className='font-medium text-[var(--text-primary)]'>{displayNames[0]}</span>? This
105+
will permanently remove all associated workflows, folders, logs, and knowledge bases.
106+
</>
107+
)
108+
}
100109
return 'Are you sure you want to delete this workspace? This will permanently remove all associated workflows, folders, logs, and knowledge bases.'
101110
}
102111

apps/sim/blocks/blocks/google_calendar.ts

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,30 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
308308
condition: { field: 'operation', value: 'update' },
309309
},
310310

311-
// Move Event Fields
311+
// Move Event Fields - Destination calendar selector (basic mode)
312312
{
313-
id: 'destinationCalendarId',
313+
id: 'destinationCalendar',
314+
title: 'Destination Calendar',
315+
type: 'file-selector',
316+
canonicalParamId: 'destinationCalendarId',
317+
serviceId: 'google-calendar',
318+
requiredScopes: ['https://www.googleapis.com/auth/calendar'],
319+
placeholder: 'Select destination calendar',
320+
dependsOn: ['credential'],
321+
condition: { field: 'operation', value: 'move' },
322+
required: true,
323+
mode: 'basic',
324+
},
325+
// Move Event Fields - Manual destination calendar ID (advanced mode)
326+
{
327+
id: 'manualDestinationCalendarId',
314328
title: 'Destination Calendar ID',
315329
type: 'short-input',
330+
canonicalParamId: 'destinationCalendarId',
316331
placeholder: 'destination@group.calendar.google.com',
317332
condition: { field: 'operation', value: 'move' },
318333
required: true,
334+
mode: 'advanced',
319335
},
320336

321337
// Instances Fields
@@ -502,17 +518,31 @@ Return ONLY the natural language event text - no explanations.`,
502518
replaceExisting,
503519
calendarId,
504520
manualCalendarId,
521+
destinationCalendar,
522+
manualDestinationCalendarId,
505523
...rest
506524
} = params
507525

508526
// Handle calendar ID (selector or manual)
509527
const effectiveCalendarId = (calendarId || manualCalendarId || '').trim()
510528

529+
// Handle destination calendar ID for move operation (selector or manual)
530+
const effectiveDestinationCalendarId = (
531+
destinationCalendar ||
532+
manualDestinationCalendarId ||
533+
''
534+
).trim()
535+
511536
const processedParams: Record<string, any> = {
512537
...rest,
513538
calendarId: effectiveCalendarId || 'primary',
514539
}
515540

541+
// Add destination calendar ID for move operation
542+
if (operation === 'move' && effectiveDestinationCalendarId) {
543+
processedParams.destinationCalendarId = effectiveDestinationCalendarId
544+
}
545+
516546
// Convert comma-separated attendees string to array, only if it has content
517547
if (attendees && typeof attendees === 'string' && attendees.trim().length > 0) {
518548
const attendeeList = attendees
@@ -579,7 +609,8 @@ Return ONLY the natural language event text - no explanations.`,
579609
eventId: { type: 'string', description: 'Event identifier' },
580610

581611
// Move operation inputs
582-
destinationCalendarId: { type: 'string', description: 'Destination calendar ID' },
612+
destinationCalendar: { type: 'string', description: 'Destination calendar selector' },
613+
manualDestinationCalendarId: { type: 'string', description: 'Manual destination calendar ID' },
583614

584615
// List Calendars operation inputs
585616
minAccessRole: { type: 'string', description: 'Minimum access role filter' },

0 commit comments

Comments
 (0)