Skip to content

Commit a94efa9

Browse files
chore(copilot): regenerate tool catalog from copilot dev (#247)
Pulls in the workflow_group operations on user_table: add_workflow_group / update_workflow_group / delete_workflow_group / add_workflow_group_output / delete_workflow_group_output / run_workflow_group, plus the autoRun / blockId / dependencies / groupId parameters and a tightened mapping description for import_file. Also picks up biome import-order fixes from `bun run lint`.
1 parent a41ea68 commit a94efa9

7 files changed

Lines changed: 245 additions & 84 deletions

File tree

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,7 @@ export const ResourceContent = memo(function ResourceContent({
147147

148148
switch (resource.type) {
149149
case 'table':
150-
return (
151-
<Table
152-
key={resource.id}
153-
workspaceId={workspaceId}
154-
tableId={resource.id}
155-
embedded
156-
/>
157-
)
150+
return <Table key={resource.id} workspaceId={workspaceId} tableId={resource.id} embedded />
158151

159152
case 'file':
160153
return (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { CellContent } from './cell-content'
2-
export { type CellRenderKind, CellRender, resolveCellRender } from './cell-render'
2+
export { CellRender, type CellRenderKind, resolveCellRender } from './cell-render'
33
export { ExpandedCellPopover } from './expanded-cell-popover'
44
export { InlineEditor } from './inline-editors'

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/column-header-menu.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,10 @@ export const ColumnHeaderMenu = React.memo(function ColumnHeaderMenu({
286286
draggable={false}
287287
>
288288
<ColumnTypeIcon
289-
type={column.type}
290-
isWorkflowColumn={!!column.workflowGroupId}
291-
blockIconInfo={sourceInfo?.blockIconInfo}
292-
/>
289+
type={column.type}
290+
isWorkflowColumn={!!column.workflowGroupId}
291+
blockIconInfo={sourceInfo?.blockIconInfo}
292+
/>
293293
<span className='ml-1.5 min-w-0 overflow-clip text-ellipsis whitespace-nowrap font-medium text-[var(--text-primary)] text-small'>
294294
{column.workflowGroupId ? column.headerLabel : column.name}
295295
</span>

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,11 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
44
import { createLogger } from '@sim/logger'
55
import { useParams } from 'next/navigation'
66
import { usePostHog } from 'posthog-js/react'
7-
import {
8-
Button,
9-
Checkbox,
10-
DropdownMenu,
11-
DropdownMenuContent,
12-
DropdownMenuItem,
13-
DropdownMenuTrigger,
14-
Skeleton,
15-
toast,
16-
} from '@/components/emcn'
7+
import { Button, Checkbox, Skeleton, toast } from '@/components/emcn'
178
import { PlayOutline, Plus, Square, TableX } from '@/components/emcn/icons'
18-
import { Loader } from '@/components/emcn/icons/loader'
199
import { cn } from '@/lib/core/utils/cn'
2010
import { captureEvent } from '@/lib/posthog/client'
21-
import type {
22-
ColumnDefinition,
23-
TableRow as TableRowType,
24-
WorkflowGroup,
25-
} from '@/lib/table'
11+
import type { ColumnDefinition, TableRow as TableRowType, WorkflowGroup } from '@/lib/table'
2612
import { getUnmetGroupDeps } from '@/lib/table/deps'
2713
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
2814
import {
@@ -47,14 +33,14 @@ import {
4733
generateColumnName as sharedGenerateColumnName,
4834
storageToDisplay,
4935
} from '../../utils'
50-
import { type ColumnConfig, COLUMN_TYPE_OPTIONS } from '../column-config-sidebar'
36+
import type { ColumnConfig } from '../column-config-sidebar'
5137
import { ContextMenu } from '../context-menu'
5238
import { NewColumnDropdown } from '../new-column-dropdown'
5339
import { RunStatusControl } from '../run-status-control'
5440
import type { WorkflowConfig } from '../workflow-sidebar'
5541
import { CellContent, ExpandedCellPopover } from './cells'
5642
import { COL_WIDTH, SELECTION_TINT_BG } from './constants'
57-
import { COLUMN_TYPE_ICONS, ColumnHeaderMenu, WorkflowGroupMetaCell } from './headers'
43+
import { ColumnHeaderMenu, WorkflowGroupMetaCell } from './headers'
5844
import type { DisplayColumn } from './types'
5945
import {
6046
areRowDepsSatisfied,
@@ -178,17 +164,13 @@ interface TableGridProps {
178164
* sidebars can fire a column rename back into the grid (rewrites local
179165
* `columnWidths` / `columnOrder` keys). The wrapper just forwards the call.
180166
*/
181-
columnRenameSinkRef: React.MutableRefObject<
182-
((oldName: string, newName: string) => void) | null
183-
>
167+
columnRenameSinkRef: React.MutableRefObject<((oldName: string, newName: string) => void) | null>
184168
/**
185169
* Ref the grid populates with its post-row-delete cleanup (push undo,
186170
* clear selection). The wrapper invokes after the row-delete modal's
187171
* mutation succeeds.
188172
*/
189-
afterDeleteRowsSinkRef: React.MutableRefObject<
190-
((snapshots: DeletedRowSnapshot[]) => void) | null
191-
>
173+
afterDeleteRowsSinkRef: React.MutableRefObject<((snapshots: DeletedRowSnapshot[]) => void) | null>
192174
/**
193175
* Ref the grid populates with its full delete-columns cascade (per-column
194176
* mutation, undo push, columnOrder + columnWidths cleanup). The wrapper's
@@ -563,7 +545,6 @@ export function TableGrid({
563545
},
564546
})
565547

566-
567548
const toggleBooleanCell = useCallback(
568549
(rowId: string, columnName: string, currentValue: unknown) => {
569550
const newValue = !currentValue
@@ -2209,7 +2190,10 @@ export function TableGrid({
22092190
scrollRef.current?.focus({ preventScroll: true })
22102191
}, [])
22112192

2212-
const generateColumnName = useCallback(() => sharedGenerateColumnName(schemaColumnsRef.current), [])
2193+
const generateColumnName = useCallback(
2194+
() => sharedGenerateColumnName(schemaColumnsRef.current),
2195+
[]
2196+
)
22132197

22142198
const handleChangeType = useCallback((columnName: string, newType: ColumnDefinition['type']) => {
22152199
const column = columnsRef.current.find((c) => c.name === columnName)
@@ -2504,7 +2488,6 @@ export function TableGrid({
25042488
deleteNext(0)
25052489
}
25062490

2507-
25082491
/**
25092492
* Row ids the context menu acts on. If the right-clicked row is checked, all
25102493
* checked rows; if it's inside the active range selection, the range;
@@ -2953,7 +2936,6 @@ export function TableGrid({
29532936
<AddRowButton onClick={handleAppendRow} />
29542937
)}
29552938
</div>
2956-
29572939
</div>
29582940

29592941
<ContextMenu
@@ -3348,7 +3330,6 @@ const TableBodySkeleton = React.memo(function TableBodySkeleton({
33483330
)
33493331
})
33503332

3351-
33523333
const SelectAllCheckbox = React.memo(function SelectAllCheckbox({
33533334
checked,
33543335
onCheckedChange,
@@ -3379,7 +3360,6 @@ const SelectAllCheckbox = React.memo(function SelectAllCheckbox({
33793360
)
33803361
})
33813362

3382-
33833363
const AddRowButton = React.memo(function AddRowButton({ onClick }: { onClick: () => void }) {
33843364
return (
33853365
<div className='px-2 py-[7px]'>
@@ -3394,4 +3374,3 @@ const AddRowButton = React.memo(function AddRowButton({ onClick }: { onClick: ()
33943374
</div>
33953375
)
33963376
})
3397-

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use client'
22

33
import { useCallback, useMemo, useReducer, useRef, useState } from 'react'
4-
import { useParams, useRouter } from 'next/navigation'
54
import { createLogger } from '@sim/logger'
5+
import { useParams, useRouter } from 'next/navigation'
66
import {
77
Button,
88
Modal,
@@ -12,14 +12,18 @@ import {
1212
ModalHeader,
1313
toast,
1414
} from '@/components/emcn'
15+
import { Download, Pencil, Table as TableIcon, Trash, Upload } from '@/components/emcn/icons'
16+
import type { ColumnDefinition, Filter, TableRow as TableRowType } from '@/lib/table'
1517
import {
16-
Download,
17-
Pencil,
18-
Plus,
19-
Table as TableIcon,
20-
Trash,
21-
Upload,
22-
} from '@/components/emcn/icons'
18+
type ColumnOption,
19+
ResourceHeader,
20+
ResourceOptionsBar,
21+
type SortConfig,
22+
} from '@/app/workspace/[workspaceId]/components'
23+
import { LogDetails } from '@/app/workspace/[workspaceId]/logs/components'
24+
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
25+
import { ImportCsvDialog } from '@/app/workspace/[workspaceId]/tables/components/import-csv-dialog'
26+
import { useLogByExecutionId } from '@/hooks/queries/logs'
2327
import {
2428
downloadTableExport,
2529
useCancelTableRuns,
@@ -28,21 +32,8 @@ import {
2832
useRunGroup,
2933
} from '@/hooks/queries/tables'
3034
import { useInlineRename } from '@/hooks/use-inline-rename'
31-
import type { DeletedRowSnapshot } from '@/stores/table/types'
3235
import { useLogDetailsUIStore } from '@/stores/logs/store'
33-
import { ImportCsvDialog } from '@/app/workspace/[workspaceId]/tables/components/import-csv-dialog'
34-
import type { ColumnDefinition, Filter, TableRow as TableRowType } from '@/lib/table'
35-
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
36-
import {
37-
type ColumnOption,
38-
ResourceHeader,
39-
ResourceOptionsBar,
40-
type SortConfig,
41-
} from '@/app/workspace/[workspaceId]/components'
42-
import type { QueryOptions } from './types'
43-
import { generateColumnName } from './utils'
44-
import { LogDetails } from '@/app/workspace/[workspaceId]/logs/components'
45-
import { useLogByExecutionId } from '@/hooks/queries/logs'
36+
import type { DeletedRowSnapshot } from '@/stores/table/types'
4637
import {
4738
type ColumnConfig,
4839
ColumnConfigSidebar,
@@ -59,6 +50,8 @@ import {
5950
import { COLUMN_SIDEBAR_WIDTH } from './components/table-grid/constants'
6051
import { COLUMN_TYPE_ICONS } from './components/table-grid/headers'
6152
import { useTable } from './hooks'
53+
import type { QueryOptions } from './types'
54+
import { generateColumnName } from './utils'
6255

6356
const logger = createLogger('Table')
6457

@@ -211,12 +204,7 @@ export function Table({
211204
const cancelRunsMutate = cancelRunsMutation.mutate
212205

213206
const onRunGroup = useCallback(
214-
(
215-
groupId: string,
216-
workflowId: string,
217-
runMode: 'all' | 'incomplete',
218-
rowIds?: string[]
219-
) => {
207+
(groupId: string, workflowId: string, runMode: 'all' | 'incomplete', rowIds?: string[]) => {
220208
runGroupMutate({ groupId, workflowId, runMode, rowIds })
221209
},
222210
[runGroupMutate]

0 commit comments

Comments
 (0)