From 945466c535f1206d375720b036bda8110559ffb4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 06:24:28 +0000 Subject: [PATCH 1/3] fix(app-shell): the key-fields editor draws no record-page strip preview The default record page no longer draws a key-fields strip, so Studio's highlightFields editor stops previewing one: the ordered rows are the one rendering of the list. The file header and HIGHLIGHT_FIELDS_MAX comment say what highlightFields drives now, and the engine.studio.settings.highlightPreview key leaves the studio en/zh catalogues. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .../studio-design/HighlightFieldsEditor.tsx | 39 +++++++------------ ...ettingsPanel.highlightOrder-27054.test.tsx | 19 +++++---- .../studio-design/ObjectSettingsPanel.tsx | 4 +- ui/packages/i18n/src/namespaces/studio/en.ts | 1 - ui/packages/i18n/src/namespaces/studio/zh.ts | 1 - 5 files changed, 27 insertions(+), 37 deletions(-) diff --git a/ui/packages/app-shell/src/views/studio-design/HighlightFieldsEditor.tsx b/ui/packages/app-shell/src/views/studio-design/HighlightFieldsEditor.tsx index c20c9b384e0..92b4e34cf7d 100644 --- a/ui/packages/app-shell/src/views/studio-design/HighlightFieldsEditor.tsx +++ b/ui/packages/app-shell/src/views/studio-design/HighlightFieldsEditor.tsx @@ -9,17 +9,21 @@ /** * The object's `highlightFields` (ADR-0085) as an ORDERED pick list. * - * Order is the whole meaning of the key: the spec says "first entry wins where - * only one fits", and the record page's highlight strip draws the fields in - * this order. So the editor is a list, not a chip cloud: + * Order is the whole meaning of the key. The spec: "Ordered most-important + * fields; first entry wins where only one fits. Drives default list and + * related-list columns, cards, hover cards, previews and the record picker; + * the default record page draws no strip from it." Each of those surfaces + * takes the fields in this order, as many as it has room for. So the editor + * is a list, not a chip cloud: * * - each row can be dragged to a new place, or moved with the up / down * buttons (the keyboard path; the drag has no keyboard equivalent) — the * rows are the shared `OrderedRowList`, which `RelatedListsEditor` uses too; * - fields are added at the end, from the object's visible fields not already - * picked, up to {@link HIGHLIGHT_FIELDS_MAX}; - * - a preview below draws the strip in the picked order, so the order is seen - * as the record page will show it. + * picked, up to {@link HIGHLIGHT_FIELDS_MAX}. + * + * The row order is the one rendering of the list here: no surface preview is + * drawn, since no single surface shows the list the way every other does. * * Removing the last field removes the key: an empty list and an absent key * would both read "not declared" here, and only the absent key says it. @@ -32,8 +36,9 @@ import { OrderedRowList } from './OrderedRowList.js'; import { t, tFormat, type SupportedLocale } from '../metadata-admin/i18n.js'; /** - * How many highlight fields the editor offers. The record-page strip shows a - * handful of facts at a glance; six is the ruled ceiling for authoring here. + * How many highlight fields the editor offers. The surfaces that read the key + * show a handful of facts at a glance, each taking as many as fit; six is the + * ruled ceiling for authoring here. * A stored list that is already longer is shown whole and never truncated. */ export const HIGHLIGHT_FIELDS_MAX = 6; @@ -53,7 +58,7 @@ export function HighlightFieldsEditor({ }: { /** The stored list, in order. */ value: string[]; - /** The object's fields (labels for the rows and the preview). */ + /** The object's fields (labels for the rows). */ fields: readonly FieldEntry[]; /** The next list; `undefined` removes the key. */ onChange: (next: string[] | undefined) => void; @@ -93,22 +98,6 @@ export function HighlightFieldsEditor({ {t('engine.studio.settings.undeclared', locale)} )} - {value.length > 0 && ( -
- {t('engine.studio.settings.highlightPreview', locale)} -
- {value.map((name) => ( -
-
{labelOf(fields, name)}
-
—
-
- ))} -
-
- )} ); } diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.highlightOrder-27054.test.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.highlightOrder-27054.test.tsx index 8a4b6338128..aec9b894841 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.highlightOrder-27054.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.highlightOrder-27054.test.tsx @@ -11,7 +11,9 @@ * one fits"), and the object settings panel authors it as one. * * The real panel, inside a host that feeds every patch back into the draft: - * - the stored order is the row order and the strip preview's order; + * - the stored order is the row order, and no strip preview is drawn: the + * default record page draws no strip from the key, so the rows are the one + * rendering of the list; * - up / down and a drag move a field, and the written list keeps every other * field in place; * - a picked field is appended at the end; @@ -59,15 +61,16 @@ function Host({ initial, writes }: { initial: Row; writes: Row[] }) { const rowOrder = () => screen.getAllByTestId(/^highlight-row-/).map((el) => el.getAttribute('data-testid')!.replace('highlight-row-', '')); -const previewOrder = () => - within(screen.getByTestId('highlight-preview')).getAllByTestId('highlight-preview-cell').map((c) => c.firstChild!.textContent); const lastHighlights = (writes: Row[]) => writes.at(-1)!.highlightFields; -describe('ObjectSettingsPanel — highlightFields is an ordered pick list with a strip preview', () => { - it('shows the stored order in the rows and in the strip preview', () => { +describe('ObjectSettingsPanel — highlightFields is an ordered pick list', () => { + it('shows the stored order in the rows, and draws no strip preview', () => { render(); expect(rowOrder()).toEqual(['status', 'amount', 'name']); - expect(previewOrder()).toEqual(['Status', 'Amount', 'Name']); + // The editor itself is drawn (the control), with no preview beside its rows. + expect(screen.getByTestId('highlight-fields-editor')).toBeInTheDocument(); + expect(screen.queryByTestId('highlight-preview')).toBeNull(); + expect(screen.queryAllByTestId('highlight-preview-cell')).toHaveLength(0); }); it('moves a field with the up / down buttons, keeping every other field in place', () => { @@ -76,7 +79,7 @@ describe('ObjectSettingsPanel — highlightFields is an ordered pick list with a const amountRow = screen.getByTestId('highlight-row-amount'); fireEvent.click(within(amountRow).getByRole('button', { name: 'Move up' })); expect(lastHighlights(writes)).toEqual(['amount', 'status', 'name']); - expect(previewOrder()).toEqual(['Amount', 'Status', 'Name']); + expect(rowOrder()).toEqual(['amount', 'status', 'name']); fireEvent.click(within(screen.getByTestId('highlight-row-amount')).getByRole('button', { name: 'Move down' })); expect(lastHighlights(writes)).toEqual(['status', 'amount', 'name']); }); @@ -130,7 +133,7 @@ describe('ObjectSettingsPanel — highlightFields is an ordered pick list with a render(); fireEvent.click(screen.getByRole('button', { name: 'Remove status' })); expect(writes.at(-1)!.highlightFields).toBeUndefined(); - expect(screen.queryByTestId('highlight-preview')).toBeNull(); + expect(screen.queryAllByTestId(/^highlight-row-/)).toHaveLength(0); expect(screen.getByText(t('engine.studio.settings.undeclared', 'en-US'))).toBeInTheDocument(); }); }); diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx index 256de667959..ce92f5a54e2 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx @@ -27,13 +27,13 @@ * first (`7a90afdf9`). * 3. Semantic roles (ADR-0085) — the cross-surface presentation roles: * `nameField`, `stageField` (string | false | unset), `highlightFields` - * (an ordered list with a strip preview — `HighlightFieldsEditor`), and + * (an ordered list — `HighlightFieldsEditor`), and * `relatedLists` (objectstack#27069), the business order of the record * page's related lists, over the object's inbound relationships * (`RelatedListsEditor`). * These are the ONLY presentation knobs the protocol carries, so the * builder must make them directly editable — otherwise designers fall - * back to guessing which heuristic picked their title/stepper/columns. + * back to guessing which heuristic picked their title/stage/columns. * 4. Capabilities (framework#2707/#2727) — the `enable.*` record-surface * switches. Only LIVE flags are exposed (every toggle is enforced at * runtime — writer gates, 403s, or UI surfaces): trackHistory & files diff --git a/ui/packages/i18n/src/namespaces/studio/en.ts b/ui/packages/i18n/src/namespaces/studio/en.ts index e46153a3ab1..ce7cf14bde8 100644 --- a/ui/packages/i18n/src/namespaces/studio/en.ts +++ b/ui/packages/i18n/src/namespaces/studio/en.ts @@ -2350,7 +2350,6 @@ const STUDIO_EN: Record = { 'engine.studio.settings.addFieldOption': '+ Add field…', 'engine.studio.settings.undeclared': '(not declared — surfaces pick heuristically)', 'engine.studio.settings.highlightMax': 'Up to {max} highlight fields — remove one to add another.', - 'engine.studio.settings.highlightPreview': 'Highlight strip preview', 'engine.studio.settings.relatedLists': 'Related list order (relatedLists) — the order of the lists of child records on this object\'s record page, most important first; it orders only, and showing or hiding a list stays on its relationship field', 'engine.studio.settings.relatedListsAdd': '+ Add relationship…', 'engine.studio.settings.relatedListsTail': 'Not listed — shown after these, in the default order', diff --git a/ui/packages/i18n/src/namespaces/studio/zh.ts b/ui/packages/i18n/src/namespaces/studio/zh.ts index 4077ef6e3fb..ca215aa172e 100644 --- a/ui/packages/i18n/src/namespaces/studio/zh.ts +++ b/ui/packages/i18n/src/namespaces/studio/zh.ts @@ -2136,7 +2136,6 @@ const STUDIO_ZH: Record = { 'engine.studio.settings.addFieldOption': '+ 添加字段…', 'engine.studio.settings.undeclared': '(未声明 —— 各处按启发式自动挑选)', 'engine.studio.settings.highlightMax': '最多 {max} 个重点字段——移除一个才能再添加。', - 'engine.studio.settings.highlightPreview': '要点条预览', 'engine.studio.settings.relatedLists': '关联列表顺序(relatedLists)—— 本对象记录页上各子记录列表的顺序,最重要的在前;只管排序,显示与否仍在关系字段上设置', 'engine.studio.settings.relatedListsAdd': '+ 添加关系…', 'engine.studio.settings.relatedListsTail': '未列出 —— 排在以上之后,按默认顺序', From 08456788625610bc9f3605caa95be751bf8489c7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 06:27:03 +0000 Subject: [PATCH 2/3] test(showcase): detail-shapes smoke reads the default record page without a stage bar or key-field strip Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .../35978-key-fields-no-strip-preview.md | 16 +++ .../app-showcase/e2e/detail-shapes.spec.ts | 135 ++++++++++-------- 2 files changed, 88 insertions(+), 63 deletions(-) create mode 100644 .changeset/35978-key-fields-no-strip-preview.md diff --git a/.changeset/35978-key-fields-no-strip-preview.md b/.changeset/35978-key-fields-no-strip-preview.md new file mode 100644 index 00000000000..3e2c9f3bb60 --- /dev/null +++ b/.changeset/35978-key-fields-no-strip-preview.md @@ -0,0 +1,16 @@ +--- +'@object-ui/app-shell': patch +'@object-ui/console': patch +'@object-ui/i18n': patch +--- + +fix(studio): the key-fields editor no longer previews a record-page strip + +Clause-②: no +Metadata-protocol: none + +The default record page draws no key-field strip, so Studio's object settings +stop drawing a "Highlight strip preview" under the `highlightFields` list. The +ordered rows stay: order still decides which fields each surface takes. The +`engine.studio.settings.highlightPreview` catalogue key leaves the studio +namespace (English and Chinese). diff --git a/examples/app-showcase/e2e/detail-shapes.spec.ts b/examples/app-showcase/e2e/detail-shapes.spec.ts index 6c0c1ee9e8f..a1ef163c4ea 100644 --- a/examples/app-showcase/e2e/detail-shapes.spec.ts +++ b/examples/app-showcase/e2e/detail-shapes.spec.ts @@ -5,30 +5,33 @@ import { test, expect } from '@playwright/test'; * real-backend browser verification that closed objectui#2546 (PR4: legacy * monolith detail renderer + `renderViaSchema` kill-switch removed). * - * Four shapes, one invariant each, all through the single SchemaRenderer / - * `buildDefaultPageSchema` path the console now has: - * - grouped → fieldGroup sections render; `collapse: 'collapsed'` - * actually collapses (Money hides `budget` until opened) - * - ungrouped → flat details body, no section cards - * - stageField:false → NO `record:path` stepper despite a `status` field - * named to bait the heuristic + * Three shapes, all through the single SchemaRenderer / + * `buildDefaultPageSchema` path the console now has. The default record page + * draws no stage bar (`record:path`) and no key-field strip + * (`record:highlights`) — objectstack#35891 — so every case asserts both + * absent: the stage is the status tag beside the record's name, and + * `highlightFields` leaves every field in its group. + * - grouped → fieldGroup sections render, highlighted members + * included; `collapse: 'collapsed'` actually collapses + * (Money hides `amount` and `budget` until opened); the + * header's stage tag reads `stageField: 'status'` + * - stageField:false → NO stage tag despite a `status` field named to bait + * the heuristic * - related-heavy → related lists surface by prominence (ADR-0085), in the * one-column stack tier (objectstack#27524): a * `relatedList: 'primary'` list is a body table in the - * details (objectstack#27055, Target 8), the rest are - * panels of the right column below them and read their - * rows when they come into view + * details (objectstack#27055, Target 8) and takes no tab; + * the rest are tabs of the tab row (objectstack#35595), + * and one with records is a card of the 概览 tab's rail + * below the details (objectstack#35596) * * Runs against the console the backend serves at /_console (baseURL from * playwright.config.ts; storageState carries the admin session). The * semantic-zoo fixtures are objects but not seeded records — each run * creates its own rows via the REST API. * - * Assertions are scoped to what the *pinned* console build supports - * (.objectui-sha). The fb35e48 bump brought in objectui#2577, so the grouped - * case also pins the follow-up UX contract: highlight strip drops the record - * title, group icon/description render, and currencyConfig money shows its - * symbol. + * The grouped case also pins objectui#2577's UX contract: group + * icon/description render, and currencyConfig money shows its symbol. */ // Ambient `process` for the env reads below — the showcase tsconfig doesn't pull @@ -44,6 +47,9 @@ const recordUrl = (object: string, id: string) => `/_console/apps/${APP}/${object}/record/${encodeURIComponent(id)}`; const PATH_STEPPER = '[aria-label="Record path"]'; +const HIGHLIGHT_STRIP = 'section[aria-label="Record highlights"]'; +/** The header's stage tag, plain or as its menu, carries the field it reads. */ +const stageTag = (field: string) => `[data-record-stage-tag="${field}"]:visible`; let zooId = ''; let zooLegacyId = ''; @@ -95,24 +101,20 @@ async function openRecord(page: import('@playwright/test').Page, url: string) { test('grouped: fieldGroup sections render and Money starts collapsed', async ({ page }) => { const errors = await openRecord(page, recordUrl('showcase_semantic_zoo', zooId)); - // Stepper from stageField: 'status'. - // record:path renders a desktop + a mobile variant — assert the visible one. - await expect(page.locator(PATH_STEPPER).first()).toBeVisible(); - - // objectui#2577: the record title is the page H1 — it must NOT repeat as a - // (truncated) chip in the highlight strip; status/amount still do. - const strip = page.locator('section[aria-label="Record highlights"]'); - await expect(strip).toBeVisible(); - const stripText = (await strip.innerText()).replace(/\s+/g, ' '); - expect(stripText, 'strip repeats the record title').not.toContain('E2E Zoo'); - expect(stripText).toContain('4,200'); - - // Declared groups render as titled sections. Their highlighted members - // (status/amount) are hoisted to the strip; the non-highlighted members - // (code/budget) keep the groups visible in the body. - await expect(page.getByText('Basics', { exact: true })).toBeVisible(); - await expect(page.getByText('Money', { exact: true })).toBeVisible(); - await expect(page.getByText('ZG-1')).toBeVisible(); + // objectstack#35891: no stage bar and no key-field strip. The stage + // (stageField: 'status') is the header's tag beside the record's name. + await expect(page.locator(PATH_STEPPER)).toHaveCount(0); + await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0); + await expect(page.locator(stageTag('status')).first()).toHaveText(/Active/); + + // Declared groups render as titled sections, every member in its own + // group: the highlighted ones (status in Basics, amount in Money) are not + // taken out of them. + const details = page.locator('[data-record-column="details"]'); + await expect(details.getByText('Basics', { exact: true })).toBeVisible(); + await expect(details.getByText('Money', { exact: true })).toBeVisible(); + await expect(details.getByText('ZG-1')).toBeVisible(); + await expect(details.getByText('Status', { exact: true })).toBeVisible(); // objectui#2577: fieldGroups[].icon renders as a real (Lucide svg) icon in // the section header — not as literal icon-name text. @@ -130,10 +132,13 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({ ).toBeVisible(); await expect(page.getByText('banknote', { exact: true })).toHaveCount(0); - // collapse: 'collapsed' — Budget stays hidden until the header is opened. - await expect(page.getByText('Budget', { exact: true })).toHaveCount(0); + // collapse: 'collapsed' — Amount and Budget stay hidden until the header is + // opened; then both are in the Money group. + await expect(details.getByText('Budget', { exact: true })).toHaveCount(0); + await expect(details.getByText('4,200')).toHaveCount(0); await page.getByText('Money', { exact: true }).click(); - await expect(page.getByText('Budget', { exact: true })).toBeVisible(); + await expect(details.getByText('Budget', { exact: true })).toBeVisible(); + await expect(details.getByText('4,200')).toBeVisible(); // objectui#2577: fieldGroups[].description renders under the expanded // header, and the fixed-mode currencyConfig.defaultCurrency (USD) drives a // real $ symbol. @@ -143,28 +148,31 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({ expect(errors, 'uncaught page errors on grouped detail').toEqual([]); }); -test('stageField:false: status renders as a plain field, no stepper', async ({ page }) => { +test('stageField:false: status renders as a plain field, no stage tag', async ({ page }) => { const errors = await openRecord( page, recordUrl('showcase_semantic_zoo_legacy', zooLegacyId), ); // The whole point of `stageField: false`: the status-named select must NOT - // become a chevron path. (objectui#2168 pinned strict-false handling.) + // become the header's stage tag. (objectui#2168 pinned strict-false + // handling.) No stage bar or strip either, as on every default page. + await expect(page.locator('[data-record-stage-tag]')).toHaveCount(0); await expect(page.locator(PATH_STEPPER)).toHaveCount(0); + await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0); // …but the field itself still renders (as a value, not a lifecycle). await expect(page.getByText('Green').first()).toBeVisible(); expect(errors, 'uncaught page errors on stageField:false detail').toEqual([]); }); -test('ungrouped + related-heavy: flat details and the related panels on Contoso', async ({ page }) => { +test('related-heavy: body tables, the tab row and the rail on Contoso', async ({ page }) => { // The synthesized record page lays itself out by the width of the view it // occupies, by one rule (objectstack#26678, objectstack#27524): details | // the right column from `RECORD_PAGE_TWO_COLUMN_MIN_WIDTH` (760 px, // `@object-ui/plugin-detail`), and ONE column below it — the details, then - // the right column's panels in their order. No tier draws a tab strip. The - // case stays in that stack tier on purpose: the column tiers are what every + // the 概览 tab's rail. The tab row (objectstack#35595) is drawn in every + // tier. The case stays in that stack tier on purpose: the column tiers are what every // other page of this smoke draws at the Desktop Chrome viewport, and the // stack is also what the split pane (720 px) and a phone draw. // @@ -195,21 +203,24 @@ test('ungrouped + related-heavy: flat details and the related panels on Contoso' await page.getByTestId('sidebar-keep-open').click(); await expect(page.getByTestId('sidebar-keep-open')).toHaveAttribute('aria-pressed', 'true'); - // Heuristic stepper (account.status is a select named "status"). - // record:path renders a desktop + a mobile variant — assert the visible one. - await expect(page.locator(PATH_STEPPER).first()).toBeVisible(); + // objectstack#35891: no stage bar, no key-field strip; the heuristic stage + // (account.status is a select named "status") is the header's tag. + await expect(page.locator(PATH_STEPPER)).toHaveCount(0); + await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0); + await expect(page.locator(stageTag('status')).first()).toBeVisible(); - // One column and no tab strip: the details, then the right column. + // One column: the details, then the rail. The tab row opens on 概览. await expect(page.locator('[data-record-page-tier]')).toHaveAttribute('data-record-page-tier', 'stack'); await expect(page.locator('[data-record-columns]')).toHaveAttribute('data-record-columns-shown', 'details'); - await expect(page.getByRole('tab', { name: /Details|Related|Invoices|Projects/i })).toHaveCount(0); + await expect(page.locator('[data-record-tab="overview"]')).toHaveAttribute('aria-selected', 'true'); // Related lists surface by prominence (ADR-0085), as record page v3 draws // them (objectstack#27055, Target 8): Invoices and Projects are // `relatedList: 'primary'` (CORE relationships), so each is a body table in - // the details, with its rows read at open; the rest of Contoso's lists - // (Contacts and the Field Zoo lookups) are panels of the right column, - // before its last panel, 动态 (objectstack#34590). + // the details, with its rows read at open, and takes no tab of its own; the + // rest of Contoso's lists (Contacts and the Field Zoo lookups) are tabs, and + // one with records is a card of the rail (objectstack#35596). + await expect(page.locator('[data-record-tab^="showcase_invoice."], [data-record-tab^="showcase_project."]')).toHaveCount(0); const details = page.locator('[data-record-column="details"]'); const invoicesTable = details .getByRole('table') @@ -220,29 +231,27 @@ test('ungrouped + related-heavy: flat details and the related panels on Contoso' await expect(invoicesTable.getByRole('cell', { name: 'INV-1002', exact: true })).toBeVisible(); await expect(projectsTable.getByRole('cell', { name: 'Data Platform', exact: true })).toBeVisible(); const rightColumn = page.locator('[data-record-column="right"]'); - // objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first). - await expect(rightColumn.locator(':scope > *').last()).toHaveAttribute('data-record-timeline-panel', ''); await expect(rightColumn.getByRole('region', { name: /^(Invoices|Projects)$/ })).toHaveCount(0); - // Ungrouped shape: the details body is flat — no fieldGroup section cards. - // (Contoso declares no fieldGroups; spot-check a body field label.) - await expect(page.getByText('Basics', { exact: true })).toHaveCount(0); + // Contoso's own groups render in the details (ADR-0085 §5), its highlighted + // fields among their members. + await expect(details.getByText('Profile', { exact: true })).toBeVisible(); - // objectui#2577 + currencyConfig: annual revenue renders with its symbol - // in the strip, and the meta footer doesn't dangle "Created by" on the - // actor-less seeded row. - await expect(page.getByText('$25,000,000', { exact: false }).first()).toBeVisible(); + // objectui#2577 + currencyConfig: annual revenue (a highlighted field, left + // in its Profile group) renders with its symbol in the details, and the + // meta footer doesn't dangle "Created by" on the actor-less seeded row. + await expect(details.getByText('$25,000,000', { exact: false }).first()).toBeVisible(); const footer = page.locator('[data-testid="record-meta-footer"]'); await expect(footer).toBeVisible(); const footerText = (await footer.innerText()).replace(/\s+/g, ' '); expect(footerText, 'footer dangles "Created by" without an actor').not.toMatch(/Created by/); expect(footerText).toMatch(/Created/); - // A panel reads its rows once it is in view: below the details here, so - // the Contacts panel reads Contoso's seeded contacts when scrolled to. - const contactsPanel = rightColumn.getByRole('region', { name: 'Contacts', exact: true }); - await contactsPanel.scrollIntoViewIfNeeded(); - await expect(contactsPanel.locator('[data-related-card-row]').filter({ hasText: 'Carl Fox' })).toBeVisible(); + // The rail's Contacts card summarizes the Contacts tab: its first rows, + // Contoso's seeded contacts among them. + const contactsCard = rightColumn.getByRole('region', { name: 'Contacts', exact: true }); + await contactsCard.scrollIntoViewIfNeeded(); + await expect(contactsCard.locator('[data-record-summary-row]').filter({ hasText: 'Carl Fox' })).toBeVisible(); expect(errors, 'uncaught page errors on related-heavy detail').toEqual([]); }); From c3bf8d3c998cf5b2a420ff8451fb26c899a78eb7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 21 Nov 2026 06:53:05 +0000 Subject: [PATCH 3/3] revert(showcase): leave detail-shapes smoke to its own card The e2e rider moved to a separate card; this file returns to origin/main. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv --- .../app-showcase/e2e/detail-shapes.spec.ts | 135 ++++++++---------- 1 file changed, 63 insertions(+), 72 deletions(-) diff --git a/examples/app-showcase/e2e/detail-shapes.spec.ts b/examples/app-showcase/e2e/detail-shapes.spec.ts index a1ef163c4ea..6c0c1ee9e8f 100644 --- a/examples/app-showcase/e2e/detail-shapes.spec.ts +++ b/examples/app-showcase/e2e/detail-shapes.spec.ts @@ -5,33 +5,30 @@ import { test, expect } from '@playwright/test'; * real-backend browser verification that closed objectui#2546 (PR4: legacy * monolith detail renderer + `renderViaSchema` kill-switch removed). * - * Three shapes, all through the single SchemaRenderer / - * `buildDefaultPageSchema` path the console now has. The default record page - * draws no stage bar (`record:path`) and no key-field strip - * (`record:highlights`) — objectstack#35891 — so every case asserts both - * absent: the stage is the status tag beside the record's name, and - * `highlightFields` leaves every field in its group. - * - grouped → fieldGroup sections render, highlighted members - * included; `collapse: 'collapsed'` actually collapses - * (Money hides `amount` and `budget` until opened); the - * header's stage tag reads `stageField: 'status'` - * - stageField:false → NO stage tag despite a `status` field named to bait - * the heuristic + * Four shapes, one invariant each, all through the single SchemaRenderer / + * `buildDefaultPageSchema` path the console now has: + * - grouped → fieldGroup sections render; `collapse: 'collapsed'` + * actually collapses (Money hides `budget` until opened) + * - ungrouped → flat details body, no section cards + * - stageField:false → NO `record:path` stepper despite a `status` field + * named to bait the heuristic * - related-heavy → related lists surface by prominence (ADR-0085), in the * one-column stack tier (objectstack#27524): a * `relatedList: 'primary'` list is a body table in the - * details (objectstack#27055, Target 8) and takes no tab; - * the rest are tabs of the tab row (objectstack#35595), - * and one with records is a card of the 概览 tab's rail - * below the details (objectstack#35596) + * details (objectstack#27055, Target 8), the rest are + * panels of the right column below them and read their + * rows when they come into view * * Runs against the console the backend serves at /_console (baseURL from * playwright.config.ts; storageState carries the admin session). The * semantic-zoo fixtures are objects but not seeded records — each run * creates its own rows via the REST API. * - * The grouped case also pins objectui#2577's UX contract: group - * icon/description render, and currencyConfig money shows its symbol. + * Assertions are scoped to what the *pinned* console build supports + * (.objectui-sha). The fb35e48 bump brought in objectui#2577, so the grouped + * case also pins the follow-up UX contract: highlight strip drops the record + * title, group icon/description render, and currencyConfig money shows its + * symbol. */ // Ambient `process` for the env reads below — the showcase tsconfig doesn't pull @@ -47,9 +44,6 @@ const recordUrl = (object: string, id: string) => `/_console/apps/${APP}/${object}/record/${encodeURIComponent(id)}`; const PATH_STEPPER = '[aria-label="Record path"]'; -const HIGHLIGHT_STRIP = 'section[aria-label="Record highlights"]'; -/** The header's stage tag, plain or as its menu, carries the field it reads. */ -const stageTag = (field: string) => `[data-record-stage-tag="${field}"]:visible`; let zooId = ''; let zooLegacyId = ''; @@ -101,20 +95,24 @@ async function openRecord(page: import('@playwright/test').Page, url: string) { test('grouped: fieldGroup sections render and Money starts collapsed', async ({ page }) => { const errors = await openRecord(page, recordUrl('showcase_semantic_zoo', zooId)); - // objectstack#35891: no stage bar and no key-field strip. The stage - // (stageField: 'status') is the header's tag beside the record's name. - await expect(page.locator(PATH_STEPPER)).toHaveCount(0); - await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0); - await expect(page.locator(stageTag('status')).first()).toHaveText(/Active/); - - // Declared groups render as titled sections, every member in its own - // group: the highlighted ones (status in Basics, amount in Money) are not - // taken out of them. - const details = page.locator('[data-record-column="details"]'); - await expect(details.getByText('Basics', { exact: true })).toBeVisible(); - await expect(details.getByText('Money', { exact: true })).toBeVisible(); - await expect(details.getByText('ZG-1')).toBeVisible(); - await expect(details.getByText('Status', { exact: true })).toBeVisible(); + // Stepper from stageField: 'status'. + // record:path renders a desktop + a mobile variant — assert the visible one. + await expect(page.locator(PATH_STEPPER).first()).toBeVisible(); + + // objectui#2577: the record title is the page H1 — it must NOT repeat as a + // (truncated) chip in the highlight strip; status/amount still do. + const strip = page.locator('section[aria-label="Record highlights"]'); + await expect(strip).toBeVisible(); + const stripText = (await strip.innerText()).replace(/\s+/g, ' '); + expect(stripText, 'strip repeats the record title').not.toContain('E2E Zoo'); + expect(stripText).toContain('4,200'); + + // Declared groups render as titled sections. Their highlighted members + // (status/amount) are hoisted to the strip; the non-highlighted members + // (code/budget) keep the groups visible in the body. + await expect(page.getByText('Basics', { exact: true })).toBeVisible(); + await expect(page.getByText('Money', { exact: true })).toBeVisible(); + await expect(page.getByText('ZG-1')).toBeVisible(); // objectui#2577: fieldGroups[].icon renders as a real (Lucide svg) icon in // the section header — not as literal icon-name text. @@ -132,13 +130,10 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({ ).toBeVisible(); await expect(page.getByText('banknote', { exact: true })).toHaveCount(0); - // collapse: 'collapsed' — Amount and Budget stay hidden until the header is - // opened; then both are in the Money group. - await expect(details.getByText('Budget', { exact: true })).toHaveCount(0); - await expect(details.getByText('4,200')).toHaveCount(0); + // collapse: 'collapsed' — Budget stays hidden until the header is opened. + await expect(page.getByText('Budget', { exact: true })).toHaveCount(0); await page.getByText('Money', { exact: true }).click(); - await expect(details.getByText('Budget', { exact: true })).toBeVisible(); - await expect(details.getByText('4,200')).toBeVisible(); + await expect(page.getByText('Budget', { exact: true })).toBeVisible(); // objectui#2577: fieldGroups[].description renders under the expanded // header, and the fixed-mode currencyConfig.defaultCurrency (USD) drives a // real $ symbol. @@ -148,31 +143,28 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({ expect(errors, 'uncaught page errors on grouped detail').toEqual([]); }); -test('stageField:false: status renders as a plain field, no stage tag', async ({ page }) => { +test('stageField:false: status renders as a plain field, no stepper', async ({ page }) => { const errors = await openRecord( page, recordUrl('showcase_semantic_zoo_legacy', zooLegacyId), ); // The whole point of `stageField: false`: the status-named select must NOT - // become the header's stage tag. (objectui#2168 pinned strict-false - // handling.) No stage bar or strip either, as on every default page. - await expect(page.locator('[data-record-stage-tag]')).toHaveCount(0); + // become a chevron path. (objectui#2168 pinned strict-false handling.) await expect(page.locator(PATH_STEPPER)).toHaveCount(0); - await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0); // …but the field itself still renders (as a value, not a lifecycle). await expect(page.getByText('Green').first()).toBeVisible(); expect(errors, 'uncaught page errors on stageField:false detail').toEqual([]); }); -test('related-heavy: body tables, the tab row and the rail on Contoso', async ({ page }) => { +test('ungrouped + related-heavy: flat details and the related panels on Contoso', async ({ page }) => { // The synthesized record page lays itself out by the width of the view it // occupies, by one rule (objectstack#26678, objectstack#27524): details | // the right column from `RECORD_PAGE_TWO_COLUMN_MIN_WIDTH` (760 px, // `@object-ui/plugin-detail`), and ONE column below it — the details, then - // the 概览 tab's rail. The tab row (objectstack#35595) is drawn in every - // tier. The case stays in that stack tier on purpose: the column tiers are what every + // the right column's panels in their order. No tier draws a tab strip. The + // case stays in that stack tier on purpose: the column tiers are what every // other page of this smoke draws at the Desktop Chrome viewport, and the // stack is also what the split pane (720 px) and a phone draw. // @@ -203,24 +195,21 @@ test('related-heavy: body tables, the tab row and the rail on Contoso', async ({ await page.getByTestId('sidebar-keep-open').click(); await expect(page.getByTestId('sidebar-keep-open')).toHaveAttribute('aria-pressed', 'true'); - // objectstack#35891: no stage bar, no key-field strip; the heuristic stage - // (account.status is a select named "status") is the header's tag. - await expect(page.locator(PATH_STEPPER)).toHaveCount(0); - await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0); - await expect(page.locator(stageTag('status')).first()).toBeVisible(); + // Heuristic stepper (account.status is a select named "status"). + // record:path renders a desktop + a mobile variant — assert the visible one. + await expect(page.locator(PATH_STEPPER).first()).toBeVisible(); - // One column: the details, then the rail. The tab row opens on 概览. + // One column and no tab strip: the details, then the right column. await expect(page.locator('[data-record-page-tier]')).toHaveAttribute('data-record-page-tier', 'stack'); await expect(page.locator('[data-record-columns]')).toHaveAttribute('data-record-columns-shown', 'details'); - await expect(page.locator('[data-record-tab="overview"]')).toHaveAttribute('aria-selected', 'true'); + await expect(page.getByRole('tab', { name: /Details|Related|Invoices|Projects/i })).toHaveCount(0); // Related lists surface by prominence (ADR-0085), as record page v3 draws // them (objectstack#27055, Target 8): Invoices and Projects are // `relatedList: 'primary'` (CORE relationships), so each is a body table in - // the details, with its rows read at open, and takes no tab of its own; the - // rest of Contoso's lists (Contacts and the Field Zoo lookups) are tabs, and - // one with records is a card of the rail (objectstack#35596). - await expect(page.locator('[data-record-tab^="showcase_invoice."], [data-record-tab^="showcase_project."]')).toHaveCount(0); + // the details, with its rows read at open; the rest of Contoso's lists + // (Contacts and the Field Zoo lookups) are panels of the right column, + // before its last panel, 动态 (objectstack#34590). const details = page.locator('[data-record-column="details"]'); const invoicesTable = details .getByRole('table') @@ -231,27 +220,29 @@ test('related-heavy: body tables, the tab row and the rail on Contoso', async ({ await expect(invoicesTable.getByRole('cell', { name: 'INV-1002', exact: true })).toBeVisible(); await expect(projectsTable.getByRole('cell', { name: 'Data Platform', exact: true })).toBeVisible(); const rightColumn = page.locator('[data-record-column="right"]'); + // objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first). + await expect(rightColumn.locator(':scope > *').last()).toHaveAttribute('data-record-timeline-panel', ''); await expect(rightColumn.getByRole('region', { name: /^(Invoices|Projects)$/ })).toHaveCount(0); - // Contoso's own groups render in the details (ADR-0085 §5), its highlighted - // fields among their members. - await expect(details.getByText('Profile', { exact: true })).toBeVisible(); + // Ungrouped shape: the details body is flat — no fieldGroup section cards. + // (Contoso declares no fieldGroups; spot-check a body field label.) + await expect(page.getByText('Basics', { exact: true })).toHaveCount(0); - // objectui#2577 + currencyConfig: annual revenue (a highlighted field, left - // in its Profile group) renders with its symbol in the details, and the - // meta footer doesn't dangle "Created by" on the actor-less seeded row. - await expect(details.getByText('$25,000,000', { exact: false }).first()).toBeVisible(); + // objectui#2577 + currencyConfig: annual revenue renders with its symbol + // in the strip, and the meta footer doesn't dangle "Created by" on the + // actor-less seeded row. + await expect(page.getByText('$25,000,000', { exact: false }).first()).toBeVisible(); const footer = page.locator('[data-testid="record-meta-footer"]'); await expect(footer).toBeVisible(); const footerText = (await footer.innerText()).replace(/\s+/g, ' '); expect(footerText, 'footer dangles "Created by" without an actor').not.toMatch(/Created by/); expect(footerText).toMatch(/Created/); - // The rail's Contacts card summarizes the Contacts tab: its first rows, - // Contoso's seeded contacts among them. - const contactsCard = rightColumn.getByRole('region', { name: 'Contacts', exact: true }); - await contactsCard.scrollIntoViewIfNeeded(); - await expect(contactsCard.locator('[data-record-summary-row]').filter({ hasText: 'Carl Fox' })).toBeVisible(); + // A panel reads its rows once it is in view: below the details here, so + // the Contacts panel reads Contoso's seeded contacts when scrolled to. + const contactsPanel = rightColumn.getByRole('region', { name: 'Contacts', exact: true }); + await contactsPanel.scrollIntoViewIfNeeded(); + await expect(contactsPanel.locator('[data-related-card-row]').filter({ hasText: 'Carl Fox' })).toBeVisible(); expect(errors, 'uncaught page errors on related-heavy detail').toEqual([]); });