Skip to content

Commit 030c61b

Browse files
committed
fix remaining blocks who had files visibility set to hidden
1 parent 6ee73fa commit 030c61b

File tree

10 files changed

+116
-13
lines changed

10 files changed

+116
-13
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/tools/credential-selector.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Button, Combobox } from '@/components/emcn/components'
44
import {
55
getCanonicalScopesForProvider,
66
getProviderIdFromServiceId,
7+
getServiceConfigByProviderId,
78
OAUTH_PROVIDERS,
89
type OAuthProvider,
910
type OAuthService,
@@ -26,6 +27,11 @@ const getProviderIcon = (providerName: OAuthProvider) => {
2627
}
2728

2829
const getProviderName = (providerName: OAuthProvider) => {
30+
const serviceConfig = getServiceConfigByProviderId(providerName)
31+
if (serviceConfig) {
32+
return serviceConfig.name
33+
}
34+
2935
const { baseProvider } = parseProvider(providerName)
3036
const baseProviderConfig = OAUTH_PROVIDERS[baseProvider]
3137

@@ -54,7 +60,7 @@ export function ToolCredentialSelector({
5460
onChange,
5561
provider,
5662
requiredScopes = [],
57-
label = 'Select account',
63+
label,
5864
serviceId,
5965
disabled = false,
6066
}: ToolCredentialSelectorProps) {
@@ -64,6 +70,7 @@ export function ToolCredentialSelector({
6470
const { activeWorkflowId } = useWorkflowRegistry()
6571

6672
const selectedId = value || ''
73+
const effectiveLabel = label || `Select ${getProviderName(provider)} account`
6774

6875
const effectiveProviderId = useMemo(() => getProviderIdFromServiceId(serviceId), [serviceId])
6976

@@ -203,7 +210,7 @@ export function ToolCredentialSelector({
203210
selectedValue={selectedId}
204211
onChange={handleComboboxChange}
205212
onOpenChange={handleOpenChange}
206-
placeholder={label}
213+
placeholder={effectiveLabel}
207214
disabled={disabled}
208215
editable={true}
209216
filterOptions={!isForeign}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,6 @@ export const ToolInput = memo(function ToolInput({
17611761
?.requiredScopes ||
17621762
getCanonicalScopesForProvider(oauthConfig.provider)
17631763
}
1764-
label={`Select ${oauthConfig.provider} account`}
17651764
serviceId={oauthConfig.provider}
17661765
disabled={disabled}
17671766
/>

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

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ interface BlockData {
227227
* Renders the ReactFlow canvas with blocks, edges, and all interactive features.
228228
*/
229229
const WorkflowContent = React.memo(() => {
230+
const workflowRootRef = useRef<HTMLDivElement | null>(null)
231+
const viewportMoveLogCountRef = useRef(0)
230232
const [isCanvasReady, setIsCanvasReady] = useState(false)
231233
const [potentialParentId, setPotentialParentId] = useState<string | null>(null)
232234
const [selectedEdges, setSelectedEdges] = useState<SelectedEdgesMap>(new Map())
@@ -255,6 +257,52 @@ const WorkflowContent = React.memo(() => {
255257

256258
const addNotification = useNotificationStore((state) => state.addNotification)
257259

260+
const logWorkflowLayoutSnapshot = useCallback(
261+
(
262+
hypothesisId: 'H8' | 'H9' | 'H10' | 'H11',
263+
message: string,
264+
extraData: Record<string, unknown>
265+
) => {
266+
const workflowRoot = workflowRootRef.current
267+
const flowContainer = document.querySelector('.workflow-container') as HTMLElement | null
268+
const openDialogs = document.querySelectorAll('[role="dialog"][data-state="open"]').length
269+
const bodyStyle = document.body.style
270+
271+
// #region agent log
272+
fetch('http://127.0.0.1:7243/ingest/77a2b2bc-808d-4bfd-a366-739b0b04635d', {
273+
method: 'POST',
274+
headers: { 'Content-Type': 'application/json' },
275+
body: JSON.stringify({
276+
runId: 'initial',
277+
hypothesisId,
278+
location: 'workflow.tsx:WorkflowContent',
279+
message,
280+
data: {
281+
openDialogs,
282+
windowInnerHeight: window.innerHeight,
283+
windowInnerWidth: window.innerWidth,
284+
pageScrollY: window.scrollY,
285+
visualViewportHeight: window.visualViewport?.height ?? null,
286+
visualViewportOffsetTop: window.visualViewport?.offsetTop ?? null,
287+
bodyOverflow: bodyStyle.overflow || null,
288+
bodyPaddingRight: bodyStyle.paddingRight || null,
289+
bodyPosition: bodyStyle.position || null,
290+
bodyTop: bodyStyle.top || null,
291+
workflowRootTop: workflowRoot?.getBoundingClientRect().top ?? null,
292+
workflowRootHeight: workflowRoot?.getBoundingClientRect().height ?? null,
293+
flowContainerTop: flowContainer?.getBoundingClientRect().top ?? null,
294+
flowContainerHeight: flowContainer?.getBoundingClientRect().height ?? null,
295+
reactFlowViewport: reactFlowInstance.getViewport(),
296+
...extraData,
297+
},
298+
timestamp: Date.now(),
299+
}),
300+
}).catch(() => {})
301+
// #endregion
302+
},
303+
[reactFlowInstance]
304+
)
305+
258306
const {
259307
workflows,
260308
activeWorkflowId,
@@ -1068,6 +1116,43 @@ const WorkflowContent = React.memo(() => {
10681116
isPointInLoopNode,
10691117
])
10701118

1119+
useEffect(() => {
1120+
const observer = new MutationObserver(() => {
1121+
const openDialogs = document.querySelectorAll('[role="dialog"][data-state="open"]').length
1122+
logWorkflowLayoutSnapshot('H8', 'Dialog/open-state mutation observed in workflow page', {
1123+
openDialogs,
1124+
})
1125+
1126+
requestAnimationFrame(() => {
1127+
logWorkflowLayoutSnapshot('H11', 'Next-frame workflow layout after dialog mutation', {
1128+
openDialogs,
1129+
})
1130+
})
1131+
})
1132+
1133+
observer.observe(document.body, {
1134+
subtree: true,
1135+
attributes: true,
1136+
childList: true,
1137+
attributeFilter: ['data-state', 'style'],
1138+
})
1139+
1140+
return () => observer.disconnect()
1141+
}, [logWorkflowLayoutSnapshot])
1142+
1143+
useEffect(() => {
1144+
const viewport = window.visualViewport
1145+
if (!viewport) return
1146+
1147+
const onViewportResize = () => {
1148+
if (document.querySelectorAll('[role="dialog"][data-state="open"]').length === 0) return
1149+
logWorkflowLayoutSnapshot('H10', 'visualViewport resize while modal open', {})
1150+
}
1151+
1152+
viewport.addEventListener('resize', onViewportResize)
1153+
return () => viewport.removeEventListener('resize', onViewportResize)
1154+
}, [logWorkflowLayoutSnapshot])
1155+
10711156
const handleContextDuplicate = useCallback(() => {
10721157
copyBlocks(contextMenuBlocks.map((b) => b.id))
10731158
executePasteOperation('duplicate', DEFAULT_PASTE_OFFSET)
@@ -3485,7 +3570,7 @@ const WorkflowContent = React.memo(() => {
34853570
])
34863571

34873572
return (
3488-
<div className='flex h-full w-full flex-col overflow-hidden'>
3573+
<div ref={workflowRootRef} className='flex h-full w-full flex-col overflow-hidden'>
34893574
<div className='relative h-full w-full flex-1'>
34903575
{/* Loading spinner - always mounted, animation paused when hidden to avoid overhead */}
34913576
<div
@@ -3569,6 +3654,18 @@ const WorkflowContent = React.memo(() => {
35693654
elevateNodesOnSelect={true}
35703655
autoPanOnConnect={effectivePermissions.canEdit}
35713656
autoPanOnNodeDrag={effectivePermissions.canEdit}
3657+
onMoveEnd={(_, viewport) => {
3658+
if (viewportMoveLogCountRef.current >= 8) return
3659+
viewportMoveLogCountRef.current += 1
3660+
const openDialogs = document.querySelectorAll(
3661+
'[role="dialog"][data-state="open"]'
3662+
).length
3663+
logWorkflowLayoutSnapshot('H9', 'Main workflow ReactFlow viewport moved', {
3664+
viewport,
3665+
moveLogCount: viewportMoveLogCountRef.current,
3666+
openDialogs,
3667+
})
3668+
}}
35723669
/>
35733670

35743671
<Cursors />

apps/sim/tools/jira/add_attachment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const jiraAddAttachmentTool: ToolConfig<JiraAddAttachmentParams, JiraAddA
3636
files: {
3737
type: 'file[]',
3838
required: true,
39-
visibility: 'hidden',
39+
visibility: 'user-only',
4040
description: 'Files to attach to the Jira issue',
4141
},
4242
cloudId: {

apps/sim/tools/linear/create_attachment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const linearCreateAttachmentTool: ToolConfig<
3535
file: {
3636
type: 'file',
3737
required: false,
38-
visibility: 'hidden',
38+
visibility: 'user-only',
3939
description: 'File to attach',
4040
},
4141
title: {

apps/sim/tools/pulse/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const pulseParserTool: ToolConfig<PulseParserInput, PulseParserOutput> =
1818
file: {
1919
type: 'file',
2020
required: false,
21-
visibility: 'hidden',
21+
visibility: 'user-only',
2222
description: 'Document file to be processed',
2323
},
2424
fileUpload: {
@@ -268,7 +268,7 @@ export const pulseParserV2Tool: ToolConfig<PulseParserV2Input, PulseParserOutput
268268
file: {
269269
type: 'file',
270270
required: true,
271-
visibility: 'hidden',
271+
visibility: 'user-only',
272272
description: 'Document to be processed',
273273
},
274274
pages: pulseParserTool.params.pages,

apps/sim/tools/reducto/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const reductoParserTool: ToolConfig<ReductoParserInput, ReductoParserOutp
2222
file: {
2323
type: 'file',
2424
required: false,
25-
visibility: 'hidden',
25+
visibility: 'user-only',
2626
description: 'Document file to be processed',
2727
},
2828
fileUpload: {
@@ -196,7 +196,7 @@ export const reductoParserV2Tool: ToolConfig<ReductoParserV2Input, ReductoParser
196196
file: {
197197
type: 'file',
198198
required: true,
199-
visibility: 'hidden',
199+
visibility: 'user-only',
200200
description: 'PDF document to be processed',
201201
},
202202
pages: reductoParserTool.params.pages,

apps/sim/tools/sftp/upload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const sftpUploadTool: ToolConfig<SftpUploadParams, SftpUploadResult> = {
5353
files: {
5454
type: 'file[]',
5555
required: false,
56-
visibility: 'hidden',
56+
visibility: 'user-only',
5757
description: 'Files to upload',
5858
},
5959
fileContent: {

apps/sim/tools/vision/tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const visionToolV2: ToolConfig<VisionV2Params, VisionResponse> = {
106106
imageFile: {
107107
type: 'file',
108108
required: true,
109-
visibility: 'hidden',
109+
visibility: 'user-only',
110110
description: 'Image file to analyze',
111111
},
112112
model: visionTool.params.model,

apps/sim/tools/wordpress/upload_media.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const uploadMediaTool: ToolConfig<WordPressUploadMediaParams, WordPressUp
2727
file: {
2828
type: 'file',
2929
required: false,
30-
visibility: 'hidden',
30+
visibility: 'user-only',
3131
description: 'File to upload (UserFile object)',
3232
},
3333
filename: {

0 commit comments

Comments
 (0)