Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit 52bf348

Browse files
fix(app-shell): the page designer stops offering the retired page:header breadcrumb toggle (objectui#11173) (#11214)
Fixes #11173 Clause-②: no The Studio page designer stops offering the "Show breadcrumb" toggle on the canonical `page:header` block. `breadcrumb` leaves `BLOCK_CONFIG['page:header']`, and its label key `engine.inspector.pageBlock.field.page:header.breadcrumb` leaves both the en and zh tables of the designer's i18n file. This is the shape the header's `icon` field took. The field-set pin and the label pin move with it. Why: the canonical `page:header` renderer already ignores the key (objectui#11166, landed as PR objectui#11172), and objectstack#20758 retires `PageHeaderProps.breadcrumb` in the spec through ADR-0087. Until then the toggle authors a key nothing reads. Once objectui pins a spec release carrying that tombstone, the platform refuses the key by name. The producer leaves first, so the pin bump does not find it standing. Implemented by the dispatched os-dev of `domain:ui` seat 2, session `https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec`, branch `claude/issue-11173-retire-breadcrumb-toggle`. ## Stored pages: no strip (triage ruling on the card) A page that already carries `breadcrumb` is not rewritten by the designer. It opens, the key shows under Advanced by its raw name (a checkbox, still checked), and the next save keeps it. `RETIRED_BLOCK_PROP_KEYS` deliberately gains no `page:header` entry: the spec's ADR-0087 conversion strips the key on load, with its notice, and a second strip in the designer would be a second mechanism that hides that notice. A new screen-level control pins this, and an ablation shows it can fail (below). ## Changes, all in the `page:header` region - `previews/block-config.ts`: the `breadcrumb` entry leaves `BLOCK_CONFIG['page:header']`. A comment beside the existing `icon` note says why, and why the strip table stays untouched. - `metadata-admin/i18n.ts`: the en row ("Show breadcrumb") and the zh row of `engine.inspector.pageBlock.field.page:header.breadcrumb` are removed, with a one-line note beside each `icon` note. - `previews/__tests__/block-config.test.ts`: the header field-set pin is now `['title', 'subtitle']`. A new describe, "page:header `breadcrumb` — the designer toggle retired with its reader", pins that the toggle is not offered and that neither locale keeps a translation for it. - `inspectors/PageBlockInspector.i18n.test.tsx`: the zh-CN label pair for the toggle leaves the "one language" case. Its absence is now pinned in the new file. - `inspectors/PageBlockInspector.pageHeaderBreadcrumb-11173.test.tsx` (new): screen pins. In en-US and zh-CN, the panel offers Title and Subtitle, has no checkbox, and shows no label or raw key for the toggle. A stored `breadcrumb: true` opens, visible and checked under Advanced, and an edit to Title commits `{ title: 'Customer', breadcrumb: true }`, which is the control. - `.changeset/11173-retire-page-header-breadcrumb-toggle.md`: `@object-ui/app-shell` patch. ## Verification (at `1d8257ab5`, the branch head) - Target tests: `pnpm exec vitest run` over `block-config.test.ts`, `block-config-i18n.test.ts`, `PageBlockInspector.i18n.test.tsx`, `PageBlockInspector.retiredBlockProps.test.tsx` and the new file gives **5 files, 98 passed**. At BASE `846cec0ef` the first four gave 4 files, 92 passed, so the change adds +2 in `block-config.test.ts` and +4 in the new file. A verbose run lists all six new cases by name. - Ablation 1, put the toggle back. `ablation-replace` planted the entry back into `BLOCK_CONFIG['page:header']` (anchor 1 to 0, blob `73518960b48b` to `ebc2ef0c43c7`). Result: **3 files failed, 9 failed / 61 passed**. The failures include the field-set pin ("still offers the canonical header fields the renderer does implement"), "does NOT offer the retired `breadcrumb` toggle", `block-config-i18n.test.ts`'s "every key resolves in en-US" / "in zh-CN", "zh-CN is actually translated", "the extractor really sees the keys the derivation implies", and three of the four new screen cases. The restore was proven: blob equal to HEAD `73518960b48b`, `git diff HEAD` on the path empty. The restore leg ran 3 files, 70 passed. A first attempt was a no-op: its replacement contained its anchor, so the tool refused (anchor 1 to 1) before running any test. It was re-run with a non-overlapping anchor. - Ablation 2, add the strip the ruling forbids. Planting `'page:header': ['breadcrumb']` into `RETIRED_BLOCK_PROP_KEYS` gave **2 files failed, 3 failed / 67 passed**: both stored-page control cases ("opens" and "saves") and the existing "every registered key really is one the block schema refuses BY NAME". The restore was proven the same way, and the restore leg passed 70 of 70. - Both ablations mutate source that the tests import by relative path (`../block-config`, `../previews/block-config.js`), not through a package `exports`/`dist`, so no rebuild hop applies. - Lock-free gates, all exit 0: `node scripts/check-changeset-presence.mjs` ("5 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)"), `check:control-bytes`, `check:new-line-citations` ("0 new citation(s)"), `check:i18n-keys`, `check-changeset-no-major`, `check-changeset-fixed`, `check-changeset-overwrite`, `check:changeset-claims`, `check:pending-changeset-literals`, and `node scripts/markdown-test-inputs.mjs --audit`. A raw control-byte self-scan of the changed files found no hits. - `check:changeset-claims` listed six pending changesets that name a file this diff touches. Each paragraph was read, and none makes a claim about the `page:header` breadcrumb toggle or its field set. - ESLint, narrowed to the changed files: `pnpm exec eslint` on the 5 changed `.ts`/`.tsx` files (`--format json` counts 5 files) gives 0 errors and 2 warnings. Both warnings are `no-explicit-any` in `block-config.test.ts`, and BASE's copy of that file carries the same 2. Population: the root `eslint.config.js` (`**/*.{ts,tsx}`) that each package's `lint` (`eslint .`) runs. Invariance: the config enables no type-aware linting (no `parserOptions.project` / `projectService`), and no local rule in `eslint-rules/` reads another file, so this diff cannot move the verdict on any untouched file. - Root `scripts/__tests__`, narrowed because the diff adds a markdown changeset: I ran the 38 test files there that mention `changeset` (`vitest run --maxWorkers=2`, lock-free) and got **38 files, 1433 passed**. The whole suite was not run locally. - **NOT MEASURED locally, declared to CI:** the `@object-ui/app-shell` dependency-closure build (29 packages) and `pnpm --filter @object-ui/app-shell type-check`. Reason: the shared verify lock was held for more than 49 minutes by one run (issue-11196's `verify-all.sh`, pid 14872, alive and busy), with three waiters ahead. This branch spent about an hour queued across five tries without getting the lock for this half. CI's `Type Check` job runs both `tsc` projects, and CI's test job runs the full `scripts/__tests__` suite. ## Overlap with PR objectui#10278 PR objectui#10278 edits `block-config.ts`, `block-config.test.ts`, `block-config-i18n.test.ts` and `PageBlockInspector.retiredBlockProps.test.tsx` in the `object-kanban` region only. This PR touches the `page:header` region of `block-config.ts` and `block-config.test.ts`, and does not touch the other two files. The hunks are disjoint. ## Acceptance notes - A stored `breadcrumb` stays editable under Advanced, which can set a value but has no delete. That follows from the no-strip ruling. The spec's ADR-0087 conversion removes it on load once objectui pins that release. - For the seat that bumps the `@objectstack/spec` pin to a release carrying objectstack#20758's tombstone: - `RETIRED_BLOCK_PROP_KEYS` membership criterion 2 ("the node schema refuses the key BY NAME") would then admit `breadcrumb`, and the existing "every registered key really is one the block schema refuses BY NAME" pin would stop objecting. The new round-trip control is what keeps the ruling. - The `icon` describe's tombstone probe (`isShapeKeyTombstoned(PageHeaderProps, …)`) is the pattern for a breadcrumb tombstone assertion. - The `page:header` component registration in `@object-ui/components` still declares a `breadcrumb` input described as "Ignored … Leave it out." That was PR objectui#11172's deliberate choice while the contract accepts the key. It is not this card's surface. - Known external red: the required `Spec Main Shape Gate` is red on every objectui PR against objectstack main (anchor card objectui#11206). It is not caused by this diff and is not touched here. --- _Generated by [Claude Code](https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 340dc71 commit 52bf348

6 files changed

Lines changed: 205 additions & 7 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): the page designer stops offering the retired `page:header` breadcrumb toggle (objectui#11173)
6+
7+
The Studio page designer's properties panel offered a "Show breadcrumb" toggle on the
8+
canonical `page:header` block, which wrote `breadcrumb` into the stored page. The
9+
header renderer no longer reads that key (objectui#11166), and objectstack#20758
10+
retires `PageHeaderProps.breadcrumb` in the spec through ADR-0087, after which the
11+
platform refuses it by name. The toggle is gone from `BLOCK_CONFIG['page:header']`,
12+
and its label key `engine.inspector.pageBlock.field.page:header.breadcrumb` left
13+
both the en and zh tables, the same shape the header's `icon` field took.
14+
15+
A page that already carries `breadcrumb` is not rewritten by the designer: it opens,
16+
the key shows under Advanced by its raw name, and the next save keeps it. The one
17+
strip belongs to the spec's ADR-0087 conversion on load, with its notice.

‎packages/app-shell/src/views/metadata-admin/i18n.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,9 @@ const ENGINE_STRINGS_EN: Record<string, string> = {
769769
// 17.0.0-rc.6). Their only reader was the canonical `page:header` icon field
770770
// removed from `previews/block-config.ts`; a key kept past its field is dead
771771
// vocabulary that the next author reads as a live surface. objectui#3829.
772-
'engine.inspector.pageBlock.field.page:header.breadcrumb': 'Show breadcrumb',
772+
// `…field.page:header.breadcrumb` left the same way with the designer's
773+
// breadcrumb toggle (objectui#11173; the spec key retires through
774+
// objectstack#20758).
773775
'engine.inspector.pageBlock.field.page:card.title': 'Title',
774776
'engine.inspector.pageBlock.field.page:card.bordered': 'Bordered',
775777
'engine.inspector.pageBlock.field.page:tabs.items': 'Tabs',
@@ -3728,8 +3730,8 @@ const ENGINE_STRINGS_ZH: Record<string, string> = {
37283730
'engine.inspector.pageBlock.field.page:header.subtitle': '副标题',
37293731
// `…field.page:header.icon` and its placeholder retired with the spec key —
37303732
// see the matching note in the `en` table above. Removed from BOTH tables in
3731-
// the same edit so the two key sets stay identical.
3732-
'engine.inspector.pageBlock.field.page:header.breadcrumb': '显示面包屑',
3733+
// the same edit so the two key sets stay identical. `…field.page:header.breadcrumb`
3734+
// likewise left both tables with its toggle (objectui#11173).
37333735
'engine.inspector.pageBlock.field.page:card.title': '标题',
37343736
'engine.inspector.pageBlock.field.page:card.bordered': '显示边框',
37353737
'engine.inspector.pageBlock.field.page:tabs.items': '标签页',

‎packages/app-shell/src/views/metadata-admin/inspectors/PageBlockInspector.i18n.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ describe('PageBlockInspector PROPERTIES labels follow the locale (#3913)', () =>
204204
expect(screen.getByText('属性')).toBeTruthy(); // chrome, already worked
205205
expect(screen.getByText('标题')).toBeTruthy(); // contents, the fix
206206
expect(screen.getByText('副标题')).toBeTruthy();
207-
expect(screen.getByText('显示面包屑')).toBeTruthy();
208207
expect(screen.queryByText('Subtitle')).toBeNull();
209-
expect(screen.queryByText('Show breadcrumb')).toBeNull();
208+
// The breadcrumb toggle's label pair left with the toggle (objectui#11173);
209+
// its absence is pinned in `PageBlockInspector.pageHeaderBreadcrumb-11173.test.tsx`.
210210
});
211211
});
212212

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* objectui#11173 — the `page:header` panel on screen after the designer's
5+
* `breadcrumb` toggle left `BLOCK_CONFIG['page:header']`.
6+
*
7+
* The sibling `previews/__tests__/block-config.test.ts` pins the TABLE (the
8+
* curated field set is `title` / `subtitle`). This file pins the two facts only
9+
* a real render and a real commit can answer:
10+
*
11+
* - the panel offers no breadcrumb control, in either locale;
12+
* - a page that ALREADY carries `breadcrumb` (a released designer build wrote
13+
* it) opens, and its next save keeps the key. That is the triage ruling on
14+
* the card: no strip in the designer. objectstack#20758's ADR-0087
15+
* conversion is the one strip, on load, with its notice; a second strip
16+
* here would be a second mechanism and would hide that notice. So
17+
* `RETIRED_BLOCK_PROP_KEYS` has no `page:header` entry, and the round-trip
18+
* case below is the control that goes red if one is added.
19+
*
20+
* FIXTURE DISCIPLINE (#3216's method, as in the sibling suites): the page is
21+
* authored the way a user does and fed through `PageSchema.parse`, so the
22+
* fixture cannot drift from the spec. `PageSchema` does not judge a block's
23+
* `properties` (the sibling `PageBlockInspector.retiredBlockProps.test.tsx`
24+
* header records that measurement), so the stored fixture keeps parsing when a
25+
* later spec pin tombstones the key.
26+
*/
27+
28+
import { describe, it, expect, vi, afterEach } from 'vitest';
29+
import { render, screen, fireEvent, cleanup } from '@testing-library/react';
30+
import { PageSchema } from '@objectstack/spec/ui';
31+
32+
// objectui#4697 — see PageBlockInspector.i18n.test.tsx for the full mechanism;
33+
// same STABLE stub, short-circuiting useObjectFields/useObjectOptions's
34+
// mount-time fetch instead of letting it escape to the real network. No
35+
// assertion here reads the fetched object list or its fields.
36+
const state = vi.hoisted(() => ({
37+
metadataClient: { get: vi.fn(async () => undefined), list: vi.fn(async () => [] as unknown[]) },
38+
}));
39+
vi.mock('../useMetadata', () => ({
40+
useMetadataClient: () => state.metadataClient,
41+
}));
42+
43+
import { PageBlockInspector } from './PageBlockInspector';
44+
45+
afterEach(cleanup);
46+
47+
const BLOCK_PATH = 'regions[0].components[0]';
48+
49+
/** A record page carrying one `page:header` block with the given properties. */
50+
function pageDraft(properties: Record<string, unknown>): Record<string, unknown> {
51+
return PageSchema.parse({
52+
name: 'account_record',
53+
label: 'Account',
54+
type: 'record',
55+
object: 'account',
56+
template: 'default',
57+
regions: [{ name: 'main', components: [{ type: 'page:header', id: 'b1', properties }] }],
58+
}) as unknown as Record<string, unknown>;
59+
}
60+
61+
function renderInspector(
62+
draft: Record<string, unknown>,
63+
locale: 'en-US' | 'zh-CN',
64+
onPatch = vi.fn(),
65+
) {
66+
render(
67+
<PageBlockInspector
68+
type="page"
69+
name="account_record"
70+
draft={draft}
71+
selection={{ kind: 'block', id: BLOCK_PATH }}
72+
onPatch={onPatch}
73+
onClearSelection={() => {}}
74+
readOnly={false}
75+
locale={locale as never}
76+
/>,
77+
);
78+
return onPatch;
79+
}
80+
81+
/** The block's `properties` as the inspector last committed them. */
82+
function committedProps(onPatch: ReturnType<typeof vi.fn>): Record<string, unknown> {
83+
const patch = onPatch.mock.calls.at(-1)![0] as {
84+
regions: Array<{ components: Array<{ properties: Record<string, unknown> }> }>;
85+
};
86+
return patch.regions[0].components[0].properties;
87+
}
88+
89+
const LABELS = {
90+
'en-US': { title: 'Title', subtitle: 'Subtitle' },
91+
'zh-CN': { title: '标题', subtitle: '副标题' },
92+
} as const;
93+
94+
describe('page:header inspector · no breadcrumb toggle (objectui#11173)', () => {
95+
it.each(['en-US', 'zh-CN'] as const)('%s: offers title and subtitle, and no toggle at all', (locale) => {
96+
renderInspector(pageDraft({}), locale);
97+
// Non-vacuity: the curated section IS rendering, so the zeroes below are a
98+
// reading about the toggle rather than about an empty panel.
99+
expect(screen.getByLabelText(LABELS[locale].title)).toBeTruthy();
100+
expect(screen.getByLabelText(LABELS[locale].subtitle)).toBeTruthy();
101+
// The toggle was the header's only boolean control, so no checkbox is left.
102+
expect(screen.queryAllByRole('checkbox')).toEqual([]);
103+
// Neither label spelling, and no raw key standing in for a missing one.
104+
expect(screen.queryByText('Show breadcrumb')).toBeNull();
105+
expect(screen.queryByText('显示面包屑')).toBeNull();
106+
expect(document.body.textContent ?? '').not.toContain('engine.inspector.pageBlock.');
107+
});
108+
});
109+
110+
describe('page:header inspector · a stored `breadcrumb` round-trips (objectui#11173)', () => {
111+
/** A block saved by a released build, while the toggle was still offered. */
112+
const stored = () => pageDraft({ title: 'Account', breadcrumb: true });
113+
114+
it('opens: the stored key stays visible, in Advanced under its raw name', () => {
115+
renderInspector(stored(), 'en-US');
116+
expect((screen.getByLabelText('Title') as HTMLInputElement).value).toBe('Account');
117+
// No longer curated, so the generic editor shows it; it was not dropped on
118+
// read, which is what a strip would have done.
119+
const box = screen.getByLabelText('breadcrumb') as HTMLInputElement;
120+
expect(box.type).toBe('checkbox');
121+
expect(box.checked).toBe(true);
122+
});
123+
124+
it('saves: an edit to another field keeps `breadcrumb` in the committed document', () => {
125+
const onPatch = renderInspector(stored(), 'en-US');
126+
fireEvent.change(screen.getByLabelText('Title'), { target: { value: 'Customer' } });
127+
// Everything the block carried rides out; only the edited field moved.
128+
expect(committedProps(onPatch)).toEqual({ title: 'Customer', breadcrumb: true });
129+
});
130+
});

‎packages/app-shell/src/views/metadata-admin/previews/__tests__/block-config.test.ts‎

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ describe('page:header `icon` — the designer field retired with the spec key (#
406406
// POSITIVE half, for the reason the location dropdown states: without it the
407407
// negative pin below passes just as happily on a deleted panel.
408408
it('still offers the canonical header fields the renderer does implement', () => {
409-
expect(fieldNames()).toEqual(['title', 'subtitle', 'breadcrumb']);
409+
// `breadcrumb` left this list with objectui#11173 — see the next describe.
410+
expect(fieldNames()).toEqual(['title', 'subtitle']);
410411
});
411412

412413
it('does NOT offer the retired `icon` field', () => {
@@ -446,6 +447,45 @@ describe('page:header `icon` — the designer field retired with the spec key (#
446447
});
447448
});
448449

450+
/**
451+
* `page:header.breadcrumb` — the second canonical header toggle retired under
452+
* the rule the `icon` describe above states (objectui#11173).
453+
*
454+
* The canonical `page:header` renderer stopped reading the key (objectui#11166),
455+
* and objectstack#20758 retires `PageHeaderProps.breadcrumb` through ADR-0087.
456+
* A designer that kept offering the toggle would author a key nothing reads,
457+
* and — once objectui pins a spec release carrying that tombstone — one the
458+
* platform refuses BY NAME. The producer leaves first, so the pin bump does not
459+
* find it standing. When that bump lands, the `icon` describe's tombstone probe
460+
* is the pattern for a third assertion here.
461+
*
462+
* NOT a strip, deliberately (triage ruling on the card): `RETIRED_BLOCK_PROP_KEYS`
463+
* gains no `page:header` entry, because the spec's ADR-0087 conversion is the
464+
* one strip and a second one here would hide its notice. The stored-page half —
465+
* a page already carrying `breadcrumb: true` opens, and its next save keeps the
466+
* key — is a fact about a real commit, so it is pinned on screen in
467+
* `inspectors/PageBlockInspector.pageHeaderBreadcrumb-11173.test.tsx`.
468+
*/
469+
describe('page:header `breadcrumb` — the designer toggle retired with its reader (objectui#11173)', () => {
470+
const fieldNames = () => BLOCK_CONFIG['page:header'].map((f) => f.name);
471+
472+
// The POSITIVE half is the `icon` describe's field-set pin above; it is the
473+
// non-vacuity control for this negative one as well.
474+
it('does NOT offer the retired `breadcrumb` toggle', () => {
475+
expect(fieldNames().length, 'field list is empty — the pin would be vacuous').toBeGreaterThan(0);
476+
expect(fieldNames()).not.toContain('breadcrumb');
477+
});
478+
479+
// The i18n side, as for `icon`: a label kept past its field is dead
480+
// vocabulary, so BOTH locale tables lost it. `t()` returns the key unchanged
481+
// on a miss.
482+
it('has no leftover translation for the retired toggle in either locale', () => {
483+
const key = 'engine.inspector.pageBlock.field.page:header.breadcrumb';
484+
expect(t(key, 'en-US')).toBe(key);
485+
expect(t(key, 'zh-CN')).toBe(key);
486+
});
487+
});
488+
449489
/**
450490
* `page:accordion` `title` / items `value` — designer inputs no renderer
451491
* reads (#5212).

‎packages/app-shell/src/views/metadata-admin/previews/block-config.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,16 @@ export const BLOCK_CONFIG: Record<string, BlockPropField[]> = {
398398
// would let the designer author metadata that fails to parse, which is
399399
// strictly worse than the silent drop it replaced. Pinned negatively in
400400
// `__tests__/block-config.test.ts`. objectui#3829.
401-
{ name: 'breadcrumb', label: 'engine.inspector.pageBlock.field.page:header.breadcrumb', kind: 'boolean' },
401+
//
402+
// No `breadcrumb` toggle either, for the same reason one step earlier
403+
// (objectui#11173): the canonical `page:header` renderer stopped reading it
404+
// (objectui#11166), and objectstack#20758 retires `PageHeaderProps.breadcrumb`
405+
// through ADR-0087. The toggle would go on authoring a key nothing reads
406+
// now and the platform refuses by name once that release is pinned.
407+
// Deliberately NOT added to `RETIRED_BLOCK_PROP_KEYS` below: a stored
408+
// `breadcrumb` round-trips untouched, because the spec's ADR-0087
409+
// conversion is the one strip (with its notice) and a second one here
410+
// would hide that notice.
402411
],
403412
'page:card': [
404413
{ name: 'title', label: 'engine.inspector.pageBlock.field.page:card.title', kind: 'text' },

0 commit comments

Comments
 (0)