From 137a92a782bbb6ba37b85e3fe894e71198a12a8e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 17:22:40 +0000 Subject: [PATCH 1/7] fix(console): name sets, master objects, audited records and condition subjects by label Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01ADHkmSBi2p2cTsYqd7ScSZ --- .../console/src/pages/system/AuditLogPage.tsx | 16 +++++++++++- .../inspectors/FlowNodeConfigField.tsx | 3 +++ .../studio-design/PackageOwdOverviewPanel.tsx | 15 ++++++++++- .../studio-design/StudioDesignSurface.tsx | 25 +++++++++++++------ ui/packages/plugin-grid/src/index.tsx | 5 ++++ 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/ui/apps/console/src/pages/system/AuditLogPage.tsx b/ui/apps/console/src/pages/system/AuditLogPage.tsx index c8fb04b7a8b..0a1ca1381eb 100644 --- a/ui/apps/console/src/pages/system/AuditLogPage.tsx +++ b/ui/apps/console/src/pages/system/AuditLogPage.tsx @@ -75,6 +75,7 @@ import { type ComboboxOption, } from '@object-ui/components'; import { LookupField, getLazyFieldWidget, objectRefOptionLabel } from '@object-ui/fields'; +import { RecordPointerCell } from '@object-ui/plugin-grid'; import { ConsolePageHeader, useAdapter, useMetadata } from '@object-ui/app-shell'; import { Search, X, AlertCircle, ScrollText, ExternalLink } from 'lucide-react'; import { actionBadgeVariant, actionFilterOptionsOf, actionLabelOf } from './auditLogActions'; @@ -719,7 +720,20 @@ export function AuditLogPage() { {formatDate(r.created_at, displayLocale)} {actionLabelOf(actionOptions, r.action) ?? '—'} {objectLabelOf(objects, r.object_name) ?? '—'} - {truncate(r.record_id, 18)} + + {/* The record by its display name, through the batched + pointer resolver the grid's `referenceVia` columns + use (`sys_audit_log.record_id` is the id half of the + pair `object_name` types). */} + {r.object_name && r.record_id ? ( + + ) : ( + {truncate(r.record_id, 18)} + )} + {r.ip_address || '—'} diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.tsx index 6413297e98e..1b335fd6f09 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.tsx @@ -730,6 +730,9 @@ export function FlowNodeConfigField({ field, value, onCommit, disabled, locale, // objectui#11789 — one verdict: the scope note this field renders // below replaces the raw editor's "Valid CEL", never sits under it. scopeIssue={unknownRefs.length > 0} + // A subject reads by its field label, its CEL spelling beside it + // (`ux-conventions.labels-over-machine-names`). + labelSubjects /> ); } diff --git a/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx b/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx index bd277f86ed7..f9c528f85b6 100644 --- a/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx +++ b/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx @@ -52,6 +52,10 @@ import { SelectValue, } from '@object-ui/components'; import { errorCodeIs } from '@object-ui/types'; +import { useMetadata } from '@object-ui/react'; +import type { I18nLabel } from '@objectstack/spec/ui'; +import { findByName } from '../../hooks/useNavTargetLabel.js'; +import { navItemLabelText } from '../metadata-admin/previews/navItemLabel.js'; import { readFields } from '../metadata-admin/previews/object-fields-io.js'; import { t, tFormat, type SupportedLocale } from '../metadata-admin/i18n.js'; import { cbpMasterDetailDefaultsRequired, deriveMasterObject, requireCbpMasterDetails } from './owd-sharing.js'; @@ -250,6 +254,15 @@ export function PackageOwdOverviewPanel({ const [saving, setSaving] = React.useState(false); const [saveError, setSaveError] = React.useState(null); const [prereq, setPrereq] = React.useState(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. + const shellMetadata = useMetadata(); + const masterLabelOf = (master: string): string => + rows.find((r) => r.name === master)?.label || + navItemLabelText(findByName(shellMetadata.objects, master)?.label as I18nLabel | undefined, locale).trim() || + master; const load = React.useCallback(async () => { setLoaded(false); @@ -596,7 +609,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.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/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 From f66870d8eb3844240f8532fbd1d3c4a1cfa7bf51 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 17:24:44 +0000 Subject: [PATCH 2/7] test(console): pin the labels the five surfaces show Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01ADHkmSBi2p2cTsYqd7ScSZ --- .../AuditLogPage.objectLabels-28968.test.tsx | 42 +++++++++- ...lowNodeConfigField.entryCondition.test.tsx | 62 ++++++++++++++- .../PackageOwdOverviewPanel.test.tsx | 54 ++++++++++++- ...e.accessSuggestionsReadOnly-33158.test.tsx | 76 ++++++++++++++++++- 4 files changed, 225 insertions(+), 9 deletions(-) diff --git a/ui/apps/console/src/pages/system/AuditLogPage.objectLabels-28968.test.tsx b/ui/apps/console/src/pages/system/AuditLogPage.objectLabels-28968.test.tsx index 9198ef00070..85dfe6ae43e 100644 --- a/ui/apps/console/src/pages/system/AuditLogPage.objectLabels-28968.test.tsx +++ b/ui/apps/console/src/pages/system/AuditLogPage.objectLabels-28968.test.tsx @@ -45,10 +45,19 @@ const { ADAPTER, METADATA, SERVED_OBJECTS } = vi.hoisted(() => { { name: 'sys_audit_log', label: '审计日志' }, ]) as readonly unknown[]; return { + // objectstack#33864 — `crm_account` is readable through the adapter, so + // its record can be named; every other object answers no definition and + // no rows (the actor lookup's `sys_user` included). ADAPTER: { - find: async () => ({ data: [], total: 0 }), + find: async (objectName: string) => + objectName === 'crm_account' + ? { data: [{ id: 'acc_1', name: 'Acme Corp' }], total: 1 } + : { data: [], total: 0 }, findOne: async () => null, - getObjectSchema: async () => undefined, + getObjectSchema: async (objectName: string) => + objectName === 'crm_account' + ? { name: 'crm_account', label: '客户', nameField: 'name', fields: { name: { type: 'text', label: 'Name' } } } + : undefined, }, SERVED_OBJECTS, // Mutable per test: the served objects. @@ -167,3 +176,32 @@ describe('AuditLogPage — the Object column and drawer show the served object l expect(options).toContain('crm_blank'); }); }); + +/** The Record cell's text, by row. */ +function recordCells(): string[] { + return bodyRows().map((row) => row.querySelectorAll('td')[3]?.textContent ?? ''); +} + +/** + * objectstack#33864 — the Record column names the audited record by its + * display name (`ux-conventions.labels-over-machine-names`), read through the + * grid's batched `referenceVia` pointer resolver (`record_id` is the id half + * of the pair `object_name` types). The raw id stays the cell's tooltip. + */ +describe('AuditLogPage — the Record column names the audited record (objectstack#33864)', () => { + it("shows a readable record's display name, the raw id as its tooltip", async () => { + renderPage(); + await waitFor(() => expect(recordCells()[0]).toBe('Acme Corp')); + const cell = bodyRows()[0]!.querySelectorAll('td')[3]!; + expect(cell.querySelector('[data-record-pointer="readable"]')).toHaveAttribute('title', 'acc_1'); + expect(recordCells()[0]).not.toContain('acc_1'); + }); + + it('CONTROL: a record no read answers reads as unavailable, never as a bare id; a row with no record shows the dash', async () => { + renderPage(); + await waitFor(() => expect(recordCells()[1]).toBe('nightly_widget · record unavailable')); + const cell = bodyRows()[1]!.querySelectorAll('td')[3]!; + expect(cell.querySelector('[data-record-pointer="unreadable"]')).toHaveAttribute('title', 'wid_1'); + expect(recordCells()[3]).toBe('—'); + }); +}); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.entryCondition.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.entryCondition.test.tsx index 7c721ab3f6e..c21ec5339ef 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.entryCondition.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.entryCondition.test.tsx @@ -76,6 +76,7 @@ const FIELD_NAMES_IN_SCOPE = FIELDS.filter((f) => !f.hidden).map((f) => f.name); import { FlowNodeConfigField } from './FlowNodeConfigField'; import { fieldsForNodeType, type FlowConfigField } from './flow-node-config'; import { resolveFlowScope, type TriggerScope } from './flow-scope'; +import { tFormat } from '../i18n'; afterEach(cleanup); @@ -277,12 +278,29 @@ describe('#6226 probe instrument — positive controls', () => { /* ── the subject vocabulary AT THIS SITE ─────────────────────────────────── */ -/** Open the row's SUBJECT dropdown and read back every subject offered. */ +/** + * An option's CEL spelling. A field subject reads by its label with the + * spelling beside it (objectstack#33864), so the spelling is that hint; an + * unlabelled subject (`previous`) reads as its spelling alone. + */ +function spellingOf(option: HTMLElement): string { + const hint = option.querySelector('.font-mono'); + return (hint ?? option).textContent ?? ''; +} + +/** Open the row's SUBJECT dropdown and read back the spelling of every subject offered. */ async function subjectOptions(container: HTMLElement): Promise { const trigger = container.querySelectorAll('[role="combobox"]')[0] as HTMLElement; await userEvent.click(trigger); const opts = await screen.findAllByRole('option'); - return opts.map((o) => o.textContent ?? ''); + return opts.map(spellingOf); +} + +/** The open dropdown's option that offers `spelling`. */ +function optionBySpelling(spelling: string): HTMLElement { + const option = screen.getAllByRole('option').find((o) => spellingOf(o) === spelling); + if (!option) throw new Error(`no option offers ${spelling}`); + return option; } /** The field holding exactly one row, ready to have its subject read. The @@ -348,14 +366,14 @@ describe('#6226 the flow entry field offers the FLATTENED trigger vocabulary', ( const { container, onCommit } = mountOneRow(); const opts = await subjectOptions(container); expect(opts).toContain('amount'); - await userEvent.click(screen.getByRole('option', { name: 'amount' })); + await userEvent.click(optionBySpelling('amount')); expect(onCommit).toHaveBeenCalledWith("amount == 'x'"); }); it('authors the create-path idiom `previous == null` end to end', async () => { const { container, onCommit } = mountOneRow(); await userEvent.click(container.querySelectorAll('[role="combobox"]')[0] as HTMLElement); - await userEvent.click(screen.getByRole('option', { name: 'previous' })); + await userEvent.click(optionBySpelling('previous')); const valueBox = container.querySelector('input') as HTMLInputElement; fireEvent.change(valueBox, { target: { value: 'null' } }); expect(onCommit).toHaveBeenLastCalledWith('previous == null'); @@ -372,6 +390,42 @@ describe('#6226 the flow entry field offers the FLATTENED trigger vocabulary', ( /* ── the escape hatch ────────────────────────────────────────────────────── */ +/** + * objectstack#33864 — the subject list names a field by its label, its CEL + * spelling beside it as secondary text (`ux-conventions.labels-over-machine-names`). + */ +describe('objectstack#33864 the flow entry field names each subject by its field label', () => { + /** Open the dropdown; each option as [its main text, its secondary spelling or null]. */ + async function labelledOptions(container: HTMLElement): Promise> { + await userEvent.click(container.querySelectorAll('[role="combobox"]')[0] as HTMLElement); + const opts = await screen.findAllByRole('option'); + return opts.map((o) => { + const hint = o.querySelector('.font-mono')?.textContent ?? null; + const text = o.textContent ?? ''; + return [hint === null ? text : text.slice(0, text.length - hint.length), hint]; + }); + } + + it('a field reads by its label, with its spelling as the hint', async () => { + const opts = await labelledOptions(mountOneRow().container); + expect(opts).toContainEqual(['Status', 'status']); + expect(opts).toContainEqual(['Contract term (months)', 'contract_term_months']); + }); + + it("a `previous.FIELD` reads by the field's label, before the change", async () => { + const opts = await labelledOptions(mountOneRow().container); + expect(opts).toContainEqual([ + tFormat('engine.inspector.condition.previousField', 'en', { field: 'Status' }), + 'previous.status', + ]); + }); + + it('CONTROL: the whole-record `previous` has no label, so it reads as its spelling', async () => { + const opts = await labelledOptions(mountOneRow().container); + expect(opts).toContainEqual(['previous', null]); + }); +}); + describe('#6226 raw CEL remains reachable — the ruling\'s escape hatch', () => { it('a row-mode field can be switched to the raw expression editor', async () => { const container = mountField({ value: 'status == "done"' }); diff --git a/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.test.tsx b/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.test.tsx index ddc285a76e3..ae0b7561690 100644 --- a/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.test.tsx @@ -19,7 +19,8 @@ import React from 'react'; vi.mock('sonner', () => ({ toast: { success: vi.fn(), error: vi.fn() } })); -import { t } from '../metadata-admin/i18n'; +import { MetadataCtx, type MetadataContextValue } from '@object-ui/react'; +import { t, tFormat } from '../metadata-admin/i18n'; import { PackageOwdOverviewPanel } from './PackageOwdOverviewPanel'; const en = (key: string) => t(key, 'en-US'); @@ -156,7 +157,56 @@ describe('PackageOwdOverviewPanel — controlled_by_parent', () => { renderPanel(freshServer()); await screen.findByTestId('owd-row-crm_case'); const master = screen.getByTestId('owd-master-crm_case'); - expect(master.textContent).toMatch(/crm_account/); + // objectstack#33864 — the master is named by its label, not its name. + expect(master.textContent).toBe(tFormat('engine.studio.owd.byParent', 'en-US', { master: 'Account' })); + }); +}); + +/** + * objectstack#33864 — "By parent → …" names the master object by its label + * (`ux-conventions.labels-over-machine-names`): this package's own object as + * the table reads it, else the served object's label, else the machine name. + */ +describe('PackageOwdOverviewPanel — the master is named by its label (objectstack#33864)', () => { + function servedObjects(objects: unknown[]): MetadataContextValue { + return { + apps: [], + objects, + dashboards: [], + reports: [], + pages: [], + loading: false, + error: null, + refresh: async () => {}, + invalidate: () => {}, + ensureType: async () => [], + getItem: async () => null, + getItemsByType: () => [], + getTypeStatus: () => 'ready', + }; + } + const byParent = (master: string) => tFormat('engine.studio.owd.byParent', 'en-US', { master }); + + /** A package that holds only the detail: its master lives in another package. */ + function detailOnly(): Server { + const server = freshServer(); + delete server.objects.crm_account; + return server; + } + + // This package's own master is pinned by 'shows the master link' above. + it("a master outside this package reads as the served object's label", async () => { + render( + + + , + ); + expect(await screen.findByTestId('owd-master-crm_case')).toHaveTextContent(byParent('Customer Account')); + }); + + it('CONTROL: a master no read can label is named by its machine name', async () => { + renderPanel(detailOnly()); + expect(await screen.findByTestId('owd-master-crm_case')).toHaveTextContent(byParent('crm_account')); }); }); 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')), + ); + }); +}); From 1c48f57d97d5325a5dd715b8b23d91c6ea09894b Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 17:28:06 +0000 Subject: [PATCH 3/7] docs(plugin-grid): list RecordPointerCell; changeset for the label surfaces Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01ADHkmSBi2p2cTsYqd7ScSZ --- .changeset/33864-labels-over-machine-names.md | 17 +++++++++++++++++ ui/packages/plugin-grid/README.md | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 .changeset/33864-labels-over-machine-names.md diff --git a/.changeset/33864-labels-over-machine-names.md b/.changeset/33864-labels-over-machine-names.md new file mode 100644 index 00000000000..8440a2d1932 --- /dev/null +++ b/.changeset/33864-labels-over-machine-names.md @@ -0,0 +1,17 @@ +--- +'@object-ui/app-shell': patch +'@object-ui/console': patch +'@object-ui/plugin-grid': patch +--- + +fix(console): four Console surfaces name things by their label, not their machine name + +Clause-②: no +Metadata-protocol: none + +Anything shown to a person uses the label; the machine name appears at most as secondary text. + +- Studio → Access: the suggested-binding banner, its Grant and Dismiss toasts and the state line a resolved suggestion keeps name the permission set by the label the rail shows for it, not by its machine name. A set with no label is still named by its machine name. +- Studio → Access → Record sharing: a "Controlled by parent" row reads `By parent → ` and the master object's label: this package's own object as the table reads it, else the served object's label, else its machine name. +- Setup → Audit Log: the Record column names the audited record by its display name, through the same batched resolver a list grid's `referenceVia` pointer column uses. The raw id is the tooltip; a record no read answers reads as `OBJECT · record unavailable` (its object's label). `@object-ui/plugin-grid` now exports that resolver's face, `RecordPointerCell`. +- Studio flow editor → Entry condition: the subject list offers each field by its label, with its path (`status`, `previous.status`) beside it. 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. From 97f873ec2f1412be84adc6bbcdc8a77ba6befd41 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 17:30:10 +0000 Subject: [PATCH 4/7] test(console): read the flow inspector's subject spellings beside their labels Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01ADHkmSBi2p2cTsYqd7ScSZ --- .../inspectors/FlowNodeInspector.entryCondition.test.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.entryCondition.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.entryCondition.test.tsx index cd87d197ff0..b18ef49ead4 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.entryCondition.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.entryCondition.test.tsx @@ -120,7 +120,11 @@ describe('#6226 the flow inspector hands the entry condition its trigger vocabul .parentElement!; const subject = row.querySelector('[role="combobox"]') as HTMLElement; await userEvent.click(subject); - const opts = (await screen.findAllByRole('option')).map((o) => o.textContent ?? ''); + // A field subject reads by its label with its spelling beside it + // (objectstack#33864): read the spelling, the hint where there is one. + const opts = (await screen.findAllByRole('option')).map( + (o) => (o.querySelector('.font-mono') ?? o).textContent ?? '', + ); expect(opts).toContain('status'); expect(opts).toContain('previous.status'); // One subject per value: the bare spelling, never `record.FIELD` beside it From c0343878d011595275df29af43533489b8cbddf9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 17:45:27 +0000 Subject: [PATCH 5/7] test(console): pay the lint load at collection in the two flow entry-condition suites Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01ADHkmSBi2p2cTsYqd7ScSZ --- .../inspectors/FlowNodeConfigField.entryCondition.test.tsx | 3 +++ .../inspectors/FlowNodeInspector.entryCondition.test.tsx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.entryCondition.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.entryCondition.test.tsx index c21ec5339ef..943a26b7707 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.entryCondition.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.entryCondition.test.tsx @@ -44,6 +44,9 @@ import * as React from 'react'; import { describe, it, expect, afterEach, beforeAll, vi } from 'vitest'; import { render, cleanup, screen, fireEvent } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +// The source under test reaches a dynamic `import('@objectstack/lint')`; pay +// that load during collection, never inside a case's clocked window. +import '@objectstack/lint'; /** * The trigger object's field catalog. Stubbed at the hook rather than at the diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.entryCondition.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.entryCondition.test.tsx index b18ef49ead4..85bbc366749 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.entryCondition.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.entryCondition.test.tsx @@ -25,6 +25,9 @@ import { describe, it, expect, vi, afterEach, beforeAll } from 'vitest'; import { render, screen, cleanup } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +// The source under test reaches a dynamic `import('@objectstack/lint')`; pay +// that load during collection, never inside a case's clocked window. +import '@objectstack/lint'; // The engine config-schema hook is stubbed empty so the inspector uses its // hardcoded field groups (fieldsForNodeType); the trigger field catalog is From 319ae3fc3a1af3a6820eb28f40131cdc0b42f8c3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 18:22:57 +0000 Subject: [PATCH 6/7] chore(changeset): declare the plugin-grid export as a published-surface widening Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01ADHkmSBi2p2cTsYqd7ScSZ --- .changeset/33864-labels-over-machine-names.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/33864-labels-over-machine-names.md b/.changeset/33864-labels-over-machine-names.md index 8440a2d1932..f5d9023daab 100644 --- a/.changeset/33864-labels-over-machine-names.md +++ b/.changeset/33864-labels-over-machine-names.md @@ -6,7 +6,7 @@ fix(console): four Console surfaces name things by their label, not their machine name -Clause-②: no +Clause-②: yes (widening) Metadata-protocol: none Anything shown to a person uses the label; the machine name appears at most as secondary text. From 5f4c47f5a82cdf965bbbdecc2557fe4c5d8a1a1f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 19:22:38 +0000 Subject: [PATCH 7/7] fix(console): read an outside master by name, and pin the entry-condition draft fields by label The record-sharing table asked useMetadata().objects for a master outside the package, which loads the whole object registry; it now reads the masters it names through readObjectsByName and the objects-reader census classifies it byName. The draft-overlay entry-condition pin finds its options by the label-first name the builder renders and reads each option's spelling. Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01ADHkmSBi2p2cTsYqd7ScSZ --- .../openPathObjectReaders-12811.test.ts | 4 +++ ...seObjectFields.draftOverlay-11895.test.tsx | 25 ++++++++++++++----- .../studio-design/PackageOwdOverviewPanel.tsx | 11 ++++++-- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ui/packages/app-shell/src/console/__tests__/openPathObjectReaders-12811.test.ts b/ui/packages/app-shell/src/console/__tests__/openPathObjectReaders-12811.test.ts index 577dcdc2635..285ce7e0ef0 100644 --- a/ui/packages/app-shell/src/console/__tests__/openPathObjectReaders-12811.test.ts +++ b/ui/packages/app-shell/src/console/__tests__/openPathObjectReaders-12811.test.ts @@ -131,6 +131,10 @@ const OBJECTS_READERS: Record = { kind: 'off', why: "Studio: the Data pillar's Form tab asks selectRecordFormView which form view the app opens, over the served objects (objectstack#30057)", }, + 'packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx': { + kind: 'byName', + why: "Studio's record-sharing table: a controlled-by-parent row's master outside the package, its label by name (objectstack#33864)", + }, 'packages/app-shell/src/views/studio-design/relatedListVocabulary.ts': { kind: 'off', why: "Studio: an object's inbound relationships, read while its Settings relatedLists editor or a field group's related-table picker is mounted", diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/useObjectFields.draftOverlay-11895.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/previews/useObjectFields.draftOverlay-11895.test.tsx index 8cabdf8442f..977e8c748e3 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/useObjectFields.draftOverlay-11895.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/useObjectFields.draftOverlay-11895.test.tsx @@ -66,6 +66,9 @@ vi.mock('../useMetadata', async (importOriginal) => ({ useMetadataClient: () => h.client, })); +// The source under test reaches a dynamic `import('@objectstack/lint')`; pay +// that load during collection, never inside a case's clocked window. +import '@objectstack/lint'; import { useObjectFields } from './useObjectFields'; import { t, useMetadataLocale } from '../i18n'; import { FlowNodeConfigField } from '../inspectors/FlowNodeConfigField'; @@ -190,8 +193,18 @@ function startNodeScope(objectName: string): TriggerScope | undefined { return resolveFlowScope(draft, 'start').trigger; } -/** Open the entry condition's SUBJECT dropdown and read every subject it offers. */ -async function entrySubjects(objectName: string, expectField: string): Promise { +/** + * The CEL spelling an option offers. The entry-condition builder names a field + * subject by its label with its spelling beside it (`labelSubjects`, + * objectstack#33864); a subject with no label (`previous`) is its spelling. + */ +function spellingOf(option: HTMLElement): string { + const hint = option.querySelector('.font-mono'); + return (hint ?? option).textContent ?? ''; +} + +/** Open the entry condition's SUBJECT dropdown and read the spelling of every subject it offers. */ +async function entrySubjects(objectName: string, expectOption: string): Promise { const { container } = render( o.textContent ?? ''); + await screen.findByRole('option', { name: expectOption }); + return screen.getAllByRole('option').map(spellingOf); } describe('the flow entry-condition builder offers a draft-only object\'s fields (objectui#11895)', () => { it('offers the draft object\'s fields, not only `previous`', async () => { installServer(WORLD); - const opts = await entrySubjects('repair_ticket', 'issue_summary'); + const opts = await entrySubjects('repair_ticket', 'Issue summary issue_summary'); expect(opts).toContain('issue_summary'); expect(opts).toContain('severity'); expect(opts).toContain('previous.issue_summary'); @@ -218,7 +231,7 @@ describe('the flow entry-condition builder offers a draft-only object\'s fields it('CONTROL — a published object\'s fields are offered as before', async () => { installServer(WORLD); - const opts = await entrySubjects('account', 'industry'); + const opts = await entrySubjects('account', 'Industry industry'); expect(opts).toContain('name'); expect(opts).toContain('industry'); }); diff --git a/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx b/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx index f9c528f85b6..539240311d7 100644 --- a/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx +++ b/ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx @@ -55,6 +55,7 @@ import { errorCodeIs } from '@object-ui/types'; import { useMetadata } from '@object-ui/react'; import type { I18nLabel } from '@objectstack/spec/ui'; import { findByName } from '../../hooks/useNavTargetLabel.js'; +import { readObjectsByName } from '../../hooks/useObjectPresence.js'; import { navItemLabelText } from '../metadata-admin/previews/navItemLabel.js'; import { readFields } from '../metadata-admin/previews/object-fields-io.js'; import { t, tFormat, type SupportedLocale } from '../metadata-admin/i18n.js'; @@ -257,11 +258,17 @@ export function PackageOwdOverviewPanel({ // 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. + // 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(shellMetadata.objects, master)?.label as I18nLabel | undefined, locale).trim() || + navItemLabelText(findByName(servedMasters, master)?.label as I18nLabel | undefined, locale).trim() || master; const load = React.useCallback(async () => {