(null);
+ // The master a `controlled_by_parent` row derives under is named by its
+ // label (`ux-conventions.labels-over-machine-names`): this package's own
+ // object as this table reads it (its pending draft included), else the
+ // served object's label, else its machine name. A master outside this
+ // package is read by name (`readObjectsByName`), so the panel asks for the
+ // few masters it names, never the whole object registry.
+ const shellMetadata = useMetadata();
+ const servedMasters = readObjectsByName(
+ shellMetadata,
+ rows.flatMap((r) => (r.master && !rows.some((o) => o.name === r.master) ? [r.master] : [])),
+ );
+ const masterLabelOf = (master: string): string =>
+ rows.find((r) => r.name === master)?.label ||
+ navItemLabelText(findByName(servedMasters, master)?.label as I18nLabel | undefined, locale).trim() ||
+ master;
const load = React.useCallback(async () => {
setLoaded(false);
@@ -596,7 +616,7 @@ export function PackageOwdOverviewPanel({
>
{row.master
- ? tFormat('engine.studio.owd.byParent', locale, { master: row.master })
+ ? tFormat('engine.studio.owd.byParent', locale, { master: masterLabelOf(row.master) })
: t('engine.studio.owd.byParentNoMaster', locale)}
)}
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessSuggestionsReadOnly-33158.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessSuggestionsReadOnly-33158.test.tsx
index 066026e2a36..134448ee906 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessSuggestionsReadOnly-33158.test.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessSuggestionsReadOnly-33158.test.tsx
@@ -74,7 +74,7 @@ vi.mock('../metadata-admin/AccessExplainPanel', () => ({ AccessExplainPanel: ()
vi.mock('./StudioAiCopilot', () => ({ StudioChatDock: () => null }));
import { toast } from 'sonner';
-import { t } from '../metadata-admin/i18n';
+import { t, tFormat } from '../metadata-admin/i18n';
import { AccessPillar } from './StudioDesignSurface';
window.matchMedia = ((query: string) => ({
@@ -164,3 +164,77 @@ describe('objectstack#33158 — the suggested-bindings strip on a read-only pack
expect(toast.error).not.toHaveBeenCalled();
});
});
+
+/**
+ * objectstack#33864 — the strip names the suggested set by the label the rail
+ * reads for it (`ux-conventions.labels-over-machine-names`), never by its
+ * machine name: the banner, the Accept and Dismiss toasts, and the state line
+ * a resolved row keeps. The suggestion row carries the machine name only; the
+ * double's set list (`crm_user` → "CRM user") is where the label comes from.
+ */
+describe('objectstack#33864 — the suggested-bindings strip names its set by label', () => {
+ const fmt = (key: string, set: string, anchor?: string) =>
+ tFormat(key, 'en', anchor === undefined ? { set } : { set, anchor });
+
+ it('the pending banner names the set by its label', async () => {
+ api.list.mockResolvedValue([PENDING]);
+ renderAccess(false);
+ const row = await screen.findByTestId('suggested-binding-crm_user', undefined, { timeout: 8000 });
+ await waitFor(() =>
+ expect(row).toHaveTextContent(fmt('engine.studio.access.suggestPromptEveryone', 'CRM user')),
+ );
+ expect(row).not.toHaveTextContent('"crm_user"');
+ });
+
+ it('the Accept toast and the accepted state line name the set by its label', async () => {
+ api.list.mockResolvedValue([PENDING]);
+ api.confirm.mockResolvedValue({
+ suggestion: { ...PENDING, status: 'confirmed', deployment_decision: true },
+ bindingCreated: true,
+ });
+ renderAccess(false);
+ const row = await screen.findByTestId('suggested-binding-crm_user', undefined, { timeout: 8000 });
+ await waitFor(() => expect(row).toHaveTextContent('CRM user'));
+ within(row).getByTestId('suggested-binding-confirm-crm_user').click();
+ await waitFor(() =>
+ expect(toast.success).toHaveBeenCalledWith(
+ fmt('engine.studio.access.suggestConfirmedToast', 'CRM user', 'everyone'),
+ ),
+ );
+ await waitFor(() =>
+ expect(screen.getByTestId('suggested-binding-crm_user')).toHaveTextContent(
+ fmt('engine.studio.access.suggestAcceptedState', 'CRM user'),
+ ),
+ );
+ });
+
+ it('the Dismiss toast and the dismissed state line name the set by its label', async () => {
+ api.list.mockResolvedValue([PENDING]);
+ api.dismiss.mockResolvedValue({ ...PENDING, status: 'dismissed', deployment_decision: true });
+ renderAccess(false);
+ const row = await screen.findByTestId('suggested-binding-crm_user', undefined, { timeout: 8000 });
+ await waitFor(() => expect(row).toHaveTextContent('CRM user'));
+ within(row).getByTestId('suggested-binding-dismiss-crm_user').click();
+ await waitFor(() =>
+ expect(toast.success).toHaveBeenCalledWith(fmt('engine.studio.access.suggestDismissedToast', 'CRM user')),
+ );
+ await waitFor(() =>
+ expect(screen.getByTestId('suggested-binding-crm_user')).toHaveTextContent(
+ fmt('engine.studio.access.suggestDismissedState', 'CRM user'),
+ ),
+ );
+ });
+
+ it('CONTROL: a set the rail holds no label for is named by its machine name', async () => {
+ client.list.mockImplementationOnce(async (type: string) =>
+ type === 'permission' ? [{ name: 'crm_user', label: '', isDefault: true }] : [],
+ );
+ api.list.mockResolvedValue([PENDING]);
+ renderAccess(false);
+ const row = await screen.findByTestId('suggested-binding-crm_user', undefined, { timeout: 8000 });
+ await screen.findByTestId('studio-rail-access');
+ await waitFor(() =>
+ expect(row).toHaveTextContent(fmt('engine.studio.access.suggestPromptEveryone', 'crm_user')),
+ );
+ });
+});
diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx
index 03687b1d6b8..1bd3f838f99 100644
--- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx
+++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx
@@ -359,6 +359,7 @@ import { useRegisterUnsavedEdits } from '../../chrome/unsavedEdits.js';
import { ObjectPicker } from '../metadata-admin/inspectors/ObjectPicker.js';
import { useDisplayLocale } from '@object-ui/i18n';
import { SuggestedBindingsPanel } from '../../components/SuggestedBindingsPanel.js';
+import type { SuggestedBinding } from '../../services/suggestedBindingsApi.js';
import {
AppNavCanvas,
heldNavEntriesOf,
@@ -10369,6 +10370,14 @@ export function AccessPillar({
/>
);
+ // A suggestion names its set by machine name only; the banner, its toasts
+ // and its state lines name it by the label the rail shows for that set
+ // (`ux-conventions.labels-over-machine-names`). The suggestions listed here
+ // are this package's own sets, which the rail read; a set the rail does not
+ // hold, or one with no label, is named by its machine name.
+ const suggestedSetLabel = (s: SuggestedBinding): string =>
+ perms.find((p) => p.name === s.permission_set_name)?.label || s.permission_set_name;
+
return (
{/* ADR-0090 D5/D9 — this package's suggested audience bindings
@@ -10391,33 +10400,33 @@ export function AccessPillar({
? 'engine.studio.access.suggestPromptGuest'
: 'engine.studio.access.suggestPromptEveryone',
locale,
- { set: s.permission_set_name },
+ { set: suggestedSetLabel(s) },
),
confirm: t('engine.studio.access.suggestConfirm', locale),
confirming: t('engine.studio.access.suggestConfirming', locale),
dismiss: t('engine.studio.access.suggestDismiss', locale),
confirmedToast: (s) =>
tFormat('engine.studio.access.suggestConfirmedToast', locale, {
- set: s.permission_set_name,
+ set: suggestedSetLabel(s),
anchor: s.anchor,
}),
dismissedToast: (s) =>
- tFormat('engine.studio.access.suggestDismissedToast', locale, { set: s.permission_set_name }),
+ tFormat('engine.studio.access.suggestDismissedToast', locale, { set: suggestedSetLabel(s) }),
guestUnsupported: t('engine.studio.access.suggestGuestUnsupported', locale),
acceptedState: (s) =>
- tFormat('engine.studio.access.suggestAcceptedState', locale, { set: s.permission_set_name }),
+ tFormat('engine.studio.access.suggestAcceptedState', locale, { set: suggestedSetLabel(s) }),
notInForceState: (s) =>
- tFormat('engine.studio.access.suggestNotInForceState', locale, { set: s.permission_set_name }),
+ tFormat('engine.studio.access.suggestNotInForceState', locale, { set: suggestedSetLabel(s) }),
dismissedState: (s) =>
- tFormat('engine.studio.access.suggestDismissedState', locale, { set: s.permission_set_name }),
+ tFormat('engine.studio.access.suggestDismissedState', locale, { set: suggestedSetLabel(s) }),
revoke: t('engine.studio.access.suggestRevoke', locale),
revoking: t('engine.studio.access.suggestRevoking', locale),
revokedToast: (s) =>
- tFormat('engine.studio.access.suggestRevokedToast', locale, { set: s.permission_set_name }),
+ tFormat('engine.studio.access.suggestRevokedToast', locale, { set: suggestedSetLabel(s) }),
reopen: t('engine.studio.access.suggestReopen', locale),
reopening: t('engine.studio.access.suggestReopening', locale),
reopenedToast: (s) =>
- tFormat('engine.studio.access.suggestReopenedToast', locale, { set: s.permission_set_name }),
+ tFormat('engine.studio.access.suggestReopenedToast', locale, { set: suggestedSetLabel(s) }),
}}
/>
diff --git a/ui/packages/plugin-grid/README.md b/ui/packages/plugin-grid/README.md
index 2414ae08fca..cc072094159 100644
--- a/ui/packages/plugin-grid/README.md
+++ b/ui/packages/plugin-grid/README.md
@@ -108,6 +108,7 @@ import {
SplitPaneGrid,
ImportWizard,
InlineEditing,
+ RecordPointerCell,
FormulaBar,
GroupRow,
RowActionMenu,
@@ -135,6 +136,8 @@ import type {
ImportWizardProps,
ImportResult,
InlineEditingProps,
+ RecordPointerCellProps,
+ RecordPointerSource,
FormulaBarProps,
GroupRowProps,
RowActionMenuProps,
@@ -157,6 +160,12 @@ import type {
} from '@object-ui/plugin-grid';
```
+`RecordPointerCell` is the face a `referenceVia` pointer column draws: given an
+(object name, record id) pair and a data source, it names the record by its
+display name, batching every cell's read into one `find` per object. A page
+that lists such pairs outside a grid (the Console's audit log) draws the same
+face.
+
The *schema* types are not here — they live in `@object-ui/types`
(`ObjectGridSchema`, `ListColumn`), because the schema is the shared authoring
contract rather than this package's component API.
diff --git a/ui/packages/plugin-grid/src/index.tsx b/ui/packages/plugin-grid/src/index.tsx
index 9e0cd234830..c1ad54fb5ac 100644
--- a/ui/packages/plugin-grid/src/index.tsx
+++ b/ui/packages/plugin-grid/src/index.tsx
@@ -21,6 +21,11 @@ import { VirtualGrid } from './VirtualGrid';
import { ImportWizard } from './ImportWizard';
export { ObjectGrid, VirtualGrid, ImportWizard };
+// The list face for a `referenceVia` pointer pair (objectui#12608): a page that
+// lists (object, record id) pairs outside a grid names the record through the
+// same batched resolver the grid's pointer columns use.
+export { RecordPointerCell } from './RecordPointerCell';
+export type { RecordPointerCellProps, RecordPointerSource } from './RecordPointerCell';
// Spreadsheet parsers (pure functions; ExcelJS lazy-loads inside) — exported
// for the chat-native attachment flow (cloud#797 WS3): the AI build panel
// parses an attached Excel/CSV client-side and briefs the agent with the