Skip to content

Commit 0845678

Browse files
committed
test(showcase): detail-shapes smoke reads the default record page without a stage bar or key-field strip
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv
1 parent 945466c commit 0845678

2 files changed

Lines changed: 88 additions & 63 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/console': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
fix(studio): the key-fields editor no longer previews a record-page strip
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
The default record page draws no key-field strip, so Studio's object settings
13+
stop drawing a "Highlight strip preview" under the `highlightFields` list. The
14+
ordered rows stay: order still decides which fields each surface takes. The
15+
`engine.studio.settings.highlightPreview` catalogue key leaves the studio
16+
namespace (English and Chinese).

‎examples/app-showcase/e2e/detail-shapes.spec.ts‎

Lines changed: 72 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,33 @@ import { test, expect } from '@playwright/test';
55
* real-backend browser verification that closed objectui#2546 (PR4: legacy
66
* monolith detail renderer + `renderViaSchema` kill-switch removed).
77
*
8-
* Four shapes, one invariant each, all through the single SchemaRenderer /
9-
* `buildDefaultPageSchema` path the console now has:
10-
* - grouped → fieldGroup sections render; `collapse: 'collapsed'`
11-
* actually collapses (Money hides `budget` until opened)
12-
* - ungrouped → flat details body, no section cards
13-
* - stageField:false → NO `record:path` stepper despite a `status` field
14-
* named to bait the heuristic
8+
* Three shapes, all through the single SchemaRenderer /
9+
* `buildDefaultPageSchema` path the console now has. The default record page
10+
* draws no stage bar (`record:path`) and no key-field strip
11+
* (`record:highlights`) — objectstack#35891 — so every case asserts both
12+
* absent: the stage is the status tag beside the record's name, and
13+
* `highlightFields` leaves every field in its group.
14+
* - grouped → fieldGroup sections render, highlighted members
15+
* included; `collapse: 'collapsed'` actually collapses
16+
* (Money hides `amount` and `budget` until opened); the
17+
* header's stage tag reads `stageField: 'status'`
18+
* - stageField:false → NO stage tag despite a `status` field named to bait
19+
* the heuristic
1520
* - related-heavy → related lists surface by prominence (ADR-0085), in the
1621
* one-column stack tier (objectstack#27524): a
1722
* `relatedList: 'primary'` list is a body table in the
18-
* details (objectstack#27055, Target 8), the rest are
19-
* panels of the right column below them and read their
20-
* rows when they come into view
23+
* details (objectstack#27055, Target 8) and takes no tab;
24+
* the rest are tabs of the tab row (objectstack#35595),
25+
* and one with records is a card of the 概览 tab's rail
26+
* below the details (objectstack#35596)
2127
*
2228
* Runs against the console the backend serves at /_console (baseURL from
2329
* playwright.config.ts; storageState carries the admin session). The
2430
* semantic-zoo fixtures are objects but not seeded records — each run
2531
* creates its own rows via the REST API.
2632
*
27-
* Assertions are scoped to what the *pinned* console build supports
28-
* (.objectui-sha). The fb35e48 bump brought in objectui#2577, so the grouped
29-
* case also pins the follow-up UX contract: highlight strip drops the record
30-
* title, group icon/description render, and currencyConfig money shows its
31-
* symbol.
33+
* The grouped case also pins objectui#2577's UX contract: group
34+
* icon/description render, and currencyConfig money shows its symbol.
3235
*/
3336

3437
// Ambient `process` for the env reads below — the showcase tsconfig doesn't pull
@@ -44,6 +47,9 @@ const recordUrl = (object: string, id: string) =>
4447
`/_console/apps/${APP}/${object}/record/${encodeURIComponent(id)}`;
4548

4649
const PATH_STEPPER = '[aria-label="Record path"]';
50+
const HIGHLIGHT_STRIP = 'section[aria-label="Record highlights"]';
51+
/** The header's stage tag, plain or as its menu, carries the field it reads. */
52+
const stageTag = (field: string) => `[data-record-stage-tag="${field}"]:visible`;
4753

4854
let zooId = '';
4955
let zooLegacyId = '';
@@ -95,24 +101,20 @@ async function openRecord(page: import('@playwright/test').Page, url: string) {
95101
test('grouped: fieldGroup sections render and Money starts collapsed', async ({ page }) => {
96102
const errors = await openRecord(page, recordUrl('showcase_semantic_zoo', zooId));
97103

98-
// Stepper from stageField: 'status'.
99-
// record:path renders a desktop + a mobile variant — assert the visible one.
100-
await expect(page.locator(PATH_STEPPER).first()).toBeVisible();
101-
102-
// objectui#2577: the record title is the page H1 — it must NOT repeat as a
103-
// (truncated) chip in the highlight strip; status/amount still do.
104-
const strip = page.locator('section[aria-label="Record highlights"]');
105-
await expect(strip).toBeVisible();
106-
const stripText = (await strip.innerText()).replace(/\s+/g, ' ');
107-
expect(stripText, 'strip repeats the record title').not.toContain('E2E Zoo');
108-
expect(stripText).toContain('4,200');
109-
110-
// Declared groups render as titled sections. Their highlighted members
111-
// (status/amount) are hoisted to the strip; the non-highlighted members
112-
// (code/budget) keep the groups visible in the body.
113-
await expect(page.getByText('Basics', { exact: true })).toBeVisible();
114-
await expect(page.getByText('Money', { exact: true })).toBeVisible();
115-
await expect(page.getByText('ZG-1')).toBeVisible();
104+
// objectstack#35891: no stage bar and no key-field strip. The stage
105+
// (stageField: 'status') is the header's tag beside the record's name.
106+
await expect(page.locator(PATH_STEPPER)).toHaveCount(0);
107+
await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0);
108+
await expect(page.locator(stageTag('status')).first()).toHaveText(/Active/);
109+
110+
// Declared groups render as titled sections, every member in its own
111+
// group: the highlighted ones (status in Basics, amount in Money) are not
112+
// taken out of them.
113+
const details = page.locator('[data-record-column="details"]');
114+
await expect(details.getByText('Basics', { exact: true })).toBeVisible();
115+
await expect(details.getByText('Money', { exact: true })).toBeVisible();
116+
await expect(details.getByText('ZG-1')).toBeVisible();
117+
await expect(details.getByText('Status', { exact: true })).toBeVisible();
116118

117119
// objectui#2577: fieldGroups[].icon renders as a real (Lucide svg) icon in
118120
// the section header — not as literal icon-name text.
@@ -130,10 +132,13 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({
130132
).toBeVisible();
131133
await expect(page.getByText('banknote', { exact: true })).toHaveCount(0);
132134

133-
// collapse: 'collapsed' — Budget stays hidden until the header is opened.
134-
await expect(page.getByText('Budget', { exact: true })).toHaveCount(0);
135+
// collapse: 'collapsed' — Amount and Budget stay hidden until the header is
136+
// opened; then both are in the Money group.
137+
await expect(details.getByText('Budget', { exact: true })).toHaveCount(0);
138+
await expect(details.getByText('4,200')).toHaveCount(0);
135139
await page.getByText('Money', { exact: true }).click();
136-
await expect(page.getByText('Budget', { exact: true })).toBeVisible();
140+
await expect(details.getByText('Budget', { exact: true })).toBeVisible();
141+
await expect(details.getByText('4,200')).toBeVisible();
137142
// objectui#2577: fieldGroups[].description renders under the expanded
138143
// header, and the fixed-mode currencyConfig.defaultCurrency (USD) drives a
139144
// real $ symbol.
@@ -143,28 +148,31 @@ test('grouped: fieldGroup sections render and Money starts collapsed', async ({
143148
expect(errors, 'uncaught page errors on grouped detail').toEqual([]);
144149
});
145150

146-
test('stageField:false: status renders as a plain field, no stepper', async ({ page }) => {
151+
test('stageField:false: status renders as a plain field, no stage tag', async ({ page }) => {
147152
const errors = await openRecord(
148153
page,
149154
recordUrl('showcase_semantic_zoo_legacy', zooLegacyId),
150155
);
151156

152157
// The whole point of `stageField: false`: the status-named select must NOT
153-
// become a chevron path. (objectui#2168 pinned strict-false handling.)
158+
// become the header's stage tag. (objectui#2168 pinned strict-false
159+
// handling.) No stage bar or strip either, as on every default page.
160+
await expect(page.locator('[data-record-stage-tag]')).toHaveCount(0);
154161
await expect(page.locator(PATH_STEPPER)).toHaveCount(0);
162+
await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0);
155163
// …but the field itself still renders (as a value, not a lifecycle).
156164
await expect(page.getByText('Green').first()).toBeVisible();
157165

158166
expect(errors, 'uncaught page errors on stageField:false detail').toEqual([]);
159167
});
160168

161-
test('ungrouped + related-heavy: flat details and the related panels on Contoso', async ({ page }) => {
169+
test('related-heavy: body tables, the tab row and the rail on Contoso', async ({ page }) => {
162170
// The synthesized record page lays itself out by the width of the view it
163171
// occupies, by one rule (objectstack#26678, objectstack#27524): details |
164172
// the right column from `RECORD_PAGE_TWO_COLUMN_MIN_WIDTH` (760 px,
165173
// `@object-ui/plugin-detail`), and ONE column below it — the details, then
166-
// the right column's panels in their order. No tier draws a tab strip. The
167-
// case stays in that stack tier on purpose: the column tiers are what every
174+
// the 概览 tab's rail. The tab row (objectstack#35595) is drawn in every
175+
// tier. The case stays in that stack tier on purpose: the column tiers are what every
168176
// other page of this smoke draws at the Desktop Chrome viewport, and the
169177
// stack is also what the split pane (720 px) and a phone draw.
170178
//
@@ -195,21 +203,24 @@ test('ungrouped + related-heavy: flat details and the related panels on Contoso'
195203
await page.getByTestId('sidebar-keep-open').click();
196204
await expect(page.getByTestId('sidebar-keep-open')).toHaveAttribute('aria-pressed', 'true');
197205

198-
// Heuristic stepper (account.status is a select named "status").
199-
// record:path renders a desktop + a mobile variant — assert the visible one.
200-
await expect(page.locator(PATH_STEPPER).first()).toBeVisible();
206+
// objectstack#35891: no stage bar, no key-field strip; the heuristic stage
207+
// (account.status is a select named "status") is the header's tag.
208+
await expect(page.locator(PATH_STEPPER)).toHaveCount(0);
209+
await expect(page.locator(HIGHLIGHT_STRIP)).toHaveCount(0);
210+
await expect(page.locator(stageTag('status')).first()).toBeVisible();
201211

202-
// One column and no tab strip: the details, then the right column.
212+
// One column: the details, then the rail. The tab row opens on 概览.
203213
await expect(page.locator('[data-record-page-tier]')).toHaveAttribute('data-record-page-tier', 'stack');
204214
await expect(page.locator('[data-record-columns]')).toHaveAttribute('data-record-columns-shown', 'details');
205-
await expect(page.getByRole('tab', { name: /Details|Related|Invoices|Projects/i })).toHaveCount(0);
215+
await expect(page.locator('[data-record-tab="overview"]')).toHaveAttribute('aria-selected', 'true');
206216

207217
// Related lists surface by prominence (ADR-0085), as record page v3 draws
208218
// them (objectstack#27055, Target 8): Invoices and Projects are
209219
// `relatedList: 'primary'` (CORE relationships), so each is a body table in
210-
// the details, with its rows read at open; the rest of Contoso's lists
211-
// (Contacts and the Field Zoo lookups) are panels of the right column,
212-
// before its last panel, 动态 (objectstack#34590).
220+
// the details, with its rows read at open, and takes no tab of its own; the
221+
// rest of Contoso's lists (Contacts and the Field Zoo lookups) are tabs, and
222+
// one with records is a card of the rail (objectstack#35596).
223+
await expect(page.locator('[data-record-tab^="showcase_invoice."], [data-record-tab^="showcase_project."]')).toHaveCount(0);
213224
const details = page.locator('[data-record-column="details"]');
214225
const invoicesTable = details
215226
.getByRole('table')
@@ -220,29 +231,27 @@ test('ungrouped + related-heavy: flat details and the related panels on Contoso'
220231
await expect(invoicesTable.getByRole('cell', { name: 'INV-1002', exact: true })).toBeVisible();
221232
await expect(projectsTable.getByRole('cell', { name: 'Data Platform', exact: true })).toBeVisible();
222233
const rightColumn = page.locator('[data-record-column="right"]');
223-
// objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
224-
await expect(rightColumn.locator(':scope > *').last()).toHaveAttribute('data-record-timeline-panel', '');
225234
await expect(rightColumn.getByRole('region', { name: /^(Invoices|Projects)$/ })).toHaveCount(0);
226235

227-
// Ungrouped shape: the details body is flat — no fieldGroup section cards.
228-
// (Contoso declares no fieldGroups; spot-check a body field label.)
229-
await expect(page.getByText('Basics', { exact: true })).toHaveCount(0);
236+
// Contoso's own groups render in the details (ADR-0085 §5), its highlighted
237+
// fields among their members.
238+
await expect(details.getByText('Profile', { exact: true })).toBeVisible();
230239

231-
// objectui#2577 + currencyConfig: annual revenue renders with its symbol
232-
// in the strip, and the meta footer doesn't dangle "Created by" on the
233-
// actor-less seeded row.
234-
await expect(page.getByText('$25,000,000', { exact: false }).first()).toBeVisible();
240+
// objectui#2577 + currencyConfig: annual revenue (a highlighted field, left
241+
// in its Profile group) renders with its symbol in the details, and the
242+
// meta footer doesn't dangle "Created by" on the actor-less seeded row.
243+
await expect(details.getByText('$25,000,000', { exact: false }).first()).toBeVisible();
235244
const footer = page.locator('[data-testid="record-meta-footer"]');
236245
await expect(footer).toBeVisible();
237246
const footerText = (await footer.innerText()).replace(/\s+/g, ' ');
238247
expect(footerText, 'footer dangles "Created by" without an actor').not.toMatch(/Created by/);
239248
expect(footerText).toMatch(/Created/);
240249

241-
// A panel reads its rows once it is in view: below the details here, so
242-
// the Contacts panel reads Contoso's seeded contacts when scrolled to.
243-
const contactsPanel = rightColumn.getByRole('region', { name: 'Contacts', exact: true });
244-
await contactsPanel.scrollIntoViewIfNeeded();
245-
await expect(contactsPanel.locator('[data-related-card-row]').filter({ hasText: 'Carl Fox' })).toBeVisible();
250+
// The rail's Contacts card summarizes the Contacts tab: its first rows,
251+
// Contoso's seeded contacts among them.
252+
const contactsCard = rightColumn.getByRole('region', { name: 'Contacts', exact: true });
253+
await contactsCard.scrollIntoViewIfNeeded();
254+
await expect(contactsCard.locator('[data-record-summary-row]').filter({ hasText: 'Carl Fox' })).toBeVisible();
246255

247256
expect(errors, 'uncaught page errors on related-heavy detail').toEqual([]);
248257
});

0 commit comments

Comments
 (0)