Skip to content

Commit 4e7b751

Browse files
feat(tables): show "Not found" badge for empty completed enrichment cells
An enrichment that runs to completion but matches nothing now renders a gray "Not found" badge (like the Queued/Waiting cell states) instead of a blank cell, so a real miss is distinguishable from an unrun cell. Scoped to enrichment output columns; an empty string no longer counts as a value.
1 parent 61343a1 commit 4e7b751

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ interface CellContentProps {
2020
* is empty. `undefined` (or empty) means no waiting state.
2121
*/
2222
waitingOnLabels?: string[]
23+
/** Column is an enrichment output — a completed-but-empty cell renders "Not found". */
24+
isEnrichmentOutput?: boolean
2325
}
2426

2527
/**
@@ -37,8 +39,9 @@ export function CellContent({
3739
onSave,
3840
onCancel,
3941
waitingOnLabels,
42+
isEnrichmentOutput,
4043
}: CellContentProps) {
41-
const kind = resolveCellRender({ value, exec, column, waitingOnLabels })
44+
const kind = resolveCellRender({ value, exec, column, waitingOnLabels, isEnrichmentOutput })
4245

4346
return (
4447
<>

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type CellRenderKind =
2020
| { kind: 'cancelled' }
2121
| { kind: 'error' }
2222
| { kind: 'waiting'; labels: string[] }
23+
| { kind: 'not-found' }
2324
// Plain typed cells
2425
| { kind: 'boolean'; checked: boolean }
2526
| { kind: 'json'; text: string }
@@ -34,15 +35,20 @@ interface ResolveCellRenderInput {
3435
exec: RowExecutionMetadata | undefined
3536
column: DisplayColumn
3637
waitingOnLabels: string[] | undefined
38+
/** Column is an enrichment-group output — a completed-but-empty cell renders
39+
* "Not found" rather than a blank, since the enrichment ran and matched nothing. */
40+
isEnrichmentOutput?: boolean
3741
}
3842

3943
export function resolveCellRender({
4044
value,
4145
exec,
4246
column,
4347
waitingOnLabels,
48+
isEnrichmentOutput,
4449
}: ResolveCellRenderInput): CellRenderKind {
4550
const isNull = value === null || value === undefined
51+
const isEmpty = isNull || value === ''
4652

4753
if (column.workflowGroupId) {
4854
const blockId = column.outputBlockId
@@ -57,8 +63,9 @@ export function resolveCellRender({
5763
if (inFlight && blockRunning) return { kind: 'running' }
5864

5965
// Value wins over pending-upstream: a finished column stays finished even
60-
// while other blocks in the group are still running.
61-
if (!isNull) return { kind: 'value', text: stringifyValue(value) }
66+
// while other blocks in the group are still running. An empty string is not
67+
// a value — it falls through so a completed enrichment can show "Not found".
68+
if (!isEmpty) return { kind: 'value', text: stringifyValue(value) }
6269

6370
if (inFlight && !(groupHasBlockErrors && !blockRunning)) {
6471
// A `pending` cell whose jobId starts with `paused-` is mid-pause
@@ -79,6 +86,8 @@ export function resolveCellRender({
7986
}
8087
if (exec?.status === 'cancelled') return { kind: 'cancelled' }
8188
if (exec?.status === 'error') return { kind: 'error' }
89+
// Enrichment ran to completion but matched nothing → "Not found".
90+
if (isEnrichmentOutput && exec?.status === 'completed') return { kind: 'not-found' }
8291
return { kind: 'empty' }
8392
}
8493

@@ -273,6 +282,15 @@ export function CellRender({ kind, isEditing }: CellRenderProps): React.ReactEle
273282
</span>
274283
)
275284

285+
case 'not-found':
286+
return (
287+
<Wrap isEditing={isEditing}>
288+
<Badge variant='gray' dot size='sm'>
289+
Not found
290+
</Badge>
291+
</Wrap>
292+
)
293+
276294
case 'empty':
277295
return null
278296

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ export const DataRow = React.memo(function DataRow({
332332
? (waitingByGroupId?.get(column.workflowGroupId) ?? undefined)
333333
: undefined
334334
}
335+
isEnrichmentOutput={
336+
column.workflowGroupId
337+
? workflowGroups.find((g) => g.id === column.workflowGroupId)?.type ===
338+
'enrichment'
339+
: false
340+
}
335341
/>
336342
</div>
337343
</td>

0 commit comments

Comments
 (0)