Skip to content

Commit de4a8dc

Browse files
committed
fix(app-shell): row-table draws its own error face, not the object binding's panel
The object-binding error panel marks a consumer of ElementDataSourceGate, which an api-bound product block is not. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTx4LkMSXMTUGZuzQW
1 parent 977ccbb commit de4a8dc

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

‎ui/packages/app-shell/src/console/blocks/productBlocks.tsx‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* each column's `path` with the binding's own path reader
5050
* (`selectElementApiPath`), formats `datetime` through the one date-display
5151
* path (`formatDateTime`, `@object-ui/core`, the `datetime` cell's face),
52-
* and draws a list it cannot read with the binding's error panel.
52+
* and draws a list it cannot read with the binding's error face.
5353
*
5454
* Types and arms: `@object-ui/types` `product-blocks.ts` /
5555
* `zod/product-blocks.zod.ts`.
@@ -60,12 +60,7 @@ import * as React from 'react';
6060
import { Link } from 'react-router-dom';
6161
import { Check, CheckCircle2, Circle, Copy, Plus } from 'lucide-react';
6262
import { ComponentRegistry, formatDateTime, getDisplayTimeZone, subscribeDisplayTimeZone } from '@object-ui/core';
63-
import {
64-
ElementDataSourceErrorPanel,
65-
SchemaRenderer,
66-
selectElementApiPath,
67-
useConfigBagEvaluator,
68-
} from '@object-ui/react';
63+
import { SchemaRenderer, selectElementApiPath, useConfigBagEvaluator } from '@object-ui/react';
6964
import {
7065
Badge,
7166
Button,
@@ -459,12 +454,20 @@ export function RowTableBlock({ schema, className }: BlockRendererProps) {
459454
React.useSyncExternalStore(subscribeDisplayTimeZone, getDisplayTimeZone, getDisplayTimeZone);
460455
const read = readRowTable(props);
461456
if (!read.ok) {
457+
// The binding's own error face and title (`SchemaRenderer`'s
458+
// `ElementApiDataSourcePanel`), drawn here because this block, not the
459+
// binding, finds the list unreadable.
462460
return (
463-
<ElementDataSourceErrorPanel
464-
testId="row-table"
465-
title={t('element.component.apiUnreadable', { defaultValue: 'This component’s API data source could not be read' })}
466-
message={read.message}
467-
/>
461+
<div
462+
className={cn('my-2 rounded border border-red-500 bg-red-50 p-4 text-red-500', className)}
463+
role="alert"
464+
data-testid="row-table-datasource-error"
465+
>
466+
<p className="font-medium">
467+
{t('element.component.apiUnreadable', { defaultValue: 'This component’s API data source could not be read' })}
468+
</p>
469+
<p className="mt-1 text-sm">{read.message}</p>
470+
</div>
468471
);
469472
}
470473
const { rows, columns } = read;

0 commit comments

Comments
 (0)