Skip to content

Commit bb89b2d

Browse files
feat(app-shell): the record's favorite star beside its name, out of the header's overflow (#36456)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbVF7sWPNE4HmjkgyaVxQYif)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jRaJbQ4vqdv4J5peqA Fixes #36246 Clause-②: no Metadata-protocol: none ## 维护者速读 - 记录整页、右侧预览和手机记录页上,记录名右边多了一颗星:空心是没收藏,点一下变实心、记录进左侧栏「收藏」,再点一下取消;「更多」菜单里不再有「添加到收藏」。 - 记录页专题对标 Attio:按维护者「以 attio 为准」,把收藏入口从「更多」挪到记录名旁边。 - 出错时用户在记录页看不到或点不动星标,已有收藏数据和左侧栏「收藏」一组不受影响;改动可直接撤回。 - 宽度说明:1440、1280、1024 宽时记录名长度不变;只有记录名本来就被截断(如 800 宽)时,星标让它再少约 32 像素。星标按裁定始终显示在记录名旁,这一点按实测说明接受(见 Acceptance notes 第一条)。 ## What changes - **The star beside the record's name.** `RecordDetailView` now hands its record context the favorite state and toggle it already computed (`isRecordFavorite`, `handleToggleRecordFavorite`), so `page:header`'s `RecordTitleChip` draws its star in every face it draws: the full page's bar, a drawer or split-pane preview (`embedded`), and a phone's header. Hollow until the record is a favorite, filled yellow once it is, one press to toggle, no confirm. Same `record:OBJECT:ID` favorite as before, so the sidebar's 收藏 group and the stored favorites are unchanged. - **No second entry in the ⋯.** The `sys_favorite` system action is pushed only on a print page (a page that declares `print`): that page draws no `page:header`, so no name and no star, and its chrome row's ⋯ keeps the entry. Everywhere else the ⋯ holds no favorites entry. The print check is one helper, `pageDeclaresPrintOf`, read for the ⋯ entry from the assigned page (only an assigned page can declare `print`) and for the print chrome from the rendered page, as before. - **Phone tap target.** `RecordTitleChip`'s star takes the same 44px phone target as the copy-id button beside it (`min-h-[44px] min-w-[44px]`, reset at `sm:`). Before this PR the record pages never drew this star, so the 24px target was never user-visible. - **The retired `showStar` refusal stays true.** `@objectstack/spec`'s `retiredKey` text for `page:header` `showStar` said the console draws no star beside the record title and that the favorites entry is the ⋯ menu; after this PR both are false. It now reads: the console draws the record's star from the host's favorites toggle, never from metadata, so the key switched nothing; delete the key, the page draws the same star without it. The two jsdoc sentences beside it say the same, `content/docs/references/ui/component.mdx` is regenerated (`pnpm --filter @objectstack/spec gen:docs`), and the changeset carries an `@objectstack/spec` patch entry. Wording only: the key stays refused by the same tombstone, `Clause-②: no`, `Metadata-protocol: none`. The 18 upgrade texts say the same: the D3 semantic entry `page-header-show-star-retired` (its `replacement`, `reason` and `acceptanceCriteria`, which `os migrate meta` prints as the `verify:` line: the record's star beside the record name, and no favorites entry in the ⋯ except on a print page), the D2 conversion `page-header-show-star-removed`'s `summary` (projected into the published `spec-changes.json`) and the step-18 rationale in `registry.ts.template`. The retired-keys entry comment and the CHANGELOG stay as written. - No new i18n key (the chip's existing `detail.addToFavorites` / `detail.removeFromFavorites`), no exported prop, no spec contract change. Read first (by risk): 1. `ui/packages/app-shell/src/views/RecordDetailView.tsx`: the `sys_favorite` push now guarded by `pageDeclaresPrintOf(assignedPage)`, and the two new props on `RecordContextProvider`. 2. `ui/packages/components/src/custom/RecordTitleChip.tsx`: the star's className (phone target). 3. `ui/packages/app-shell/src/views/RecordDetailView.favoritesEntry-12427.test.tsx`: the rewritten first `describe` (three faces, reload). Two-minute check: open any record in the Console, press the star right of the name. Expected: it fills yellow and the record appears at the top of the sidebar's 收藏 group; the header's ⋯ lists no 添加到收藏. ## Screenshots (HotCRM on this branch's Console, zh-CN, 1440 wide, DPR 2) Before this PR (from the card, main `6c7c6db250`): the header has no star, 添加到收藏 is inside ⋯. ![before: no star beside the name](https://github.com/objectstack-ai/objectstack/blob/5ef1288a78bc42aaba1ce459e85b9b23ad1cb13d/widths/2026-11-22-ours-record-page-1440.jpg?raw=true) Full page, 客户 (Acme Corporation): hollow, the ⋯ without 添加到收藏, then filled with the record in 收藏. ![full page, hollow star](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-1-account-hollow.png?raw=true) ![full page, the more menu: refresh, share, delete](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-2-account-more-menu.png?raw=true) ![full page, filled star, record in the sidebar favourites](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-3-account-filled-sidebar.png?raw=true) Right-side preview (the list's 在侧边打开, Stark Medical): hollow, the ⋯, then filled with the record in 收藏. ![preview, hollow star](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-4-preview-hollow.png?raw=true) ![preview, the more menu: share, open as page, delete](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-5-preview-more.png?raw=true) ![preview, filled star, record in the sidebar favourites](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-6-preview-filled-sidebar.png?raw=true) HotCRM 线索 (four labelled header buttons) at 1440 and at 800: ![lead at 1440, star beside the untruncated name](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-7-lead-1440.png?raw=true) ![lead at 800, name truncated, star visible](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-7-lead-800.png?raw=true) Phone (390 wide): hollow, filled, and the bottom bar's ⋯. ![phone, hollow star](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-8-phone-hollow.png?raw=true) ![phone, filled star](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-9-phone-filled.png?raw=true) ![phone, the bottom bar more menu without add to favourites](https://github.com/objectstack-ai/objectstack/blob/b5daf7d1622a99c449619c8808eb600c7dfdacdb/2026-11-22-36246-10-phone-more.png?raw=true) ## Tests - `RecordDetailView.favoritesEntry-12427.test.tsx`, first `describe` rewritten deliberately (it pinned objectui#12427's opposite placement, which the maintainer's ruling reverses): the star sits in the H1's row, hollow (`aria-pressed=false`, no fill), and the ⋯ holds no favorites entry (CONTROL: Share is there); one press stores the `record:` favorite (id, type, href) and fills it, a second press removes it; a stored favorite (a reload) opens filled; an `embedded` mount draws the same star with the same state and toggles it; a phone mount (390 wide, bottom bar drawn as CONTROL) draws it beside the name and its ⋯ has no favorites entry. - `RecordDetailView.headerMenuIcons-12529.test.tsx`: the ⋯ rows lose `Add to favorites`. - `page-header-star-host-toggle-12427.test.tsx`: new case, the star keeps the 44px phone target (CONTROL: the copy-id button carries the same classes). - `RecordDetailView.printPageHeaderActions-12906.test.tsx` unchanged and green: the print page keeps its ⋯ entry. - `packages/spec/src/ui/page-header-show-star-retirement.test.ts` (`PRESCRIPTION`) and `packages/lint/src/validate-component-props.test.ts` pin the reworded refusal. <details><summary>Runs (final head b6db6ed unless named)</summary> - Targeted six files (both RecordDetailView pins, the print pin, the three chip/header pins), at 00a15ab: `Test Files 6 passed (6)`, `Tests 35 passed (35)`, lock VERDICT command-exit 0. - Broader sweep at 00a15ab: every `packages/app-shell/src/views/RecordDetailView*` file, `packages/components/src/__tests__/page-header*`, `record-title-chip*`, `ConsoleToaster.drawerActionsRow-26418`, `PageHeader.actionsFold-12705`: `Test Files 134 passed (134)`, `Tests 1151 passed (1151)`, lock VERDICT command-exit 0. The one commit after it adds a module-top import to the star pin (check:test-source-alias); at b6db6ed the star pin and the favorites file re-run: `Test Files 2 passed (2)`, `Tests 19 passed (19)`, exit 0. - `pnpm --filter @object-ui/app-shell run type-check` (both tsc programs, test tsconfig included): exit 0. </details> <details><summary>Ablations (mutation landed on disk via scripts/ablation-replace.mjs, restored to HEAD with an empty git diff HEAD; no build step: the suites import the source)</summary> - Delete the `onToggleFavorite` prop on the record context (anchor 1 to 0): the favorites file goes 5 failed / 4 passed, every star case red (no star drawn); Share cases stay green. - Revert the guard to `if (favoriteRecord)` (the ⋯ entry back everywhere): 5 red across two files (the three ⋯ assertions in the favorites file, both ⋯ row lists in the 12529 file); the print pin stays green, as it should. </details> ## Acceptance notes - **HotCRM 线索 width, against the card's "the record name is not shorter than today" line: measured, and read as met where the name fits.** Measured on the seeded lead "Pia Anand - Citrine Finance" with its four labelled buttons. At 1440, 1280 and 1024 the name is not truncated and its width is the same with and without the star (204px both); the star is drawn and visible. At 800 the name is already truncated today, and the star takes 32px from it (181px without the star, 149px with it, measured in the same build by hiding the star). The same holds for any name long enough to truncate at a wider width: the star is a fixed 24px plus an 8px gap in a row where the title is the only flexible item. Keeping the name exactly as long as today in that case would mean folding one more labelled header button into the ⋯ when the title truncates, a header-fold rule change outside this card (the preview header's slots are the next card in this area). Reading taken (seat 7): accepted as is, no follow-up card. The ruling puts the star beside the name and always visible, and the 32px only comes off a name that is already cut. - **The custom app 客户 was not built.** The walk ran on HotCRM's own 客户 object instead (same record page, same header faces). - **What main's ⋯ held in the preview and the phone page (the card's unchecked point):** not measured live on main. In the code, one system-action list feeds the ⋯ of every face, so on main all three held 添加到收藏; on this branch the full page, the preview and the phone ⋯ were opened and none holds it (screenshots above). - **Print pages** keep 添加到收藏 in the chrome row's ⋯: they draw no record header, so there is nowhere to put the star. One entry there, as everywhere else. - **Reload:** the full page reload keeps the filled star and the 收藏 entry; the phone run then found the account still a favorite from the desktop session, i.e. the favorite is the user's, not the tab's. - The view favourites entry in the view switcher, the sidebar 收藏 order and cap, and list rows are untouched. ## Verification <details><summary>Local gates (derived with `node scripts/pm/dispatch-gates.mjs --commands`, 38 families)</summary> - 37 derived families run at 00a15ab, exit 0 each; `pnpm check:test-source-alias` went red on the edited star pin (a dynamic `@object-ui/react-runtime` load reached inside a clocked case), fixed by the module-top import in b6db6ed and re-run green. - `pnpm --dir ui exec vitest run scripts/` under the lock at b6db6ed: exit 0, `Test Files 172 passed | 2 skipped (174)`, `Tests 5127 passed | 2 skipped (5129)`. - `--ran` reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. - `pnpm check:changeset-fixed` (roster under `.changeset`) exit 0; `pnpm --dir ui run check:new-line-citations`: 0 new citations. - Rework at 646a72b (origin/main merged in 3195b43): spec `page-header-show-star-retirement.test.ts` `Tests 19 passed (19)`; lint `validate-component-props.test.ts` `Tests 121 passed (121)`; `pnpm --filter @objectstack/spec check:docs` and `check:generated` (14 artifacts up to date, `check:docs content/docs/references/**` green); changeset checks (no-major, empty-changeset, adr-0087-registration, changeset-fixed, changeset-gate-self-tests) exit 0; check:doc-authoring, check:issue-citations, check:spec-docblock-symbol-anchors, check:docs-spec-enumerations, check:cross-package-test-inputs, check:nul-bytes exit 0. - Rework at 735d878 (the D3 entry, D2 summary and rationale reworded): `pnpm --filter @objectstack/spec build` (regenerates the migration registry) lock VERDICT command-exit 0; spec `src/migrations`, `src/conversions`, `page-header-show-star-retirement.test.ts`, `retired-key-removal-version.pin.test.ts`, `component.test.ts`: `Test Files 31 passed (31)`, `Tests 1445 passed (1445)`; `check:generated`, `check:docs`, `check:spec-changes`, `check:upgrade-guide` exit 0 (a generated `spec-changes.json` carries the new wording 6 times and the old 0); changeset checks (no-major, empty-changeset, adr-0087-registration, changeset-fixed, changeset-gate-self-tests), check:issue-citations, closing-keyword-parity, check:nul-bytes exit 0. NOT MEASURED locally: `packages/cli` `test/migrate-meta-engine-guidance.test.ts` (integration tier, spawns the CLI; this tree has no CLI closure build), declared to CI; the new strings carry no tracker id, which is what it pins. - Every other family is CI's: read the PR's check runs. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jRaJbQ4vqdv4J5peqA <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jRaJbQ4vqdv4J5peqA --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 60e79ed commit bb89b2d

13 files changed

Lines changed: 246 additions & 104 deletions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/components': patch
4+
'@objectstack/spec': patch
5+
---
6+
7+
feat(app-shell): the record's favorite star sits beside its name, and the header's `⋯` no longer holds "Add to favorites"
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
The record page draws its favorite star right of the record's name, always visible: hollow until the record is a favorite, filled once it is, one press to toggle with no confirm. The full page, a drawer or split-pane preview, and a phone's record page all draw it, from the same favorite the sidebar's Favorites section reads, so nothing about the stored favorites or that section changes. The header's `⋯` menu drops its "Add to favorites" / "Remove from favorites" entry, so the page keeps one favorites control. On a phone the star keeps a 44px tap target, as the copy-id button beside it does. A print page, which draws no record header and so no star, keeps the entry in its chrome row's `⋯`. The `showStar` refusal in `@objectstack/spec` (the retired `page:header` key) now says what stays true: the console draws the record's star from the host's favorites toggle, never from metadata, so the key switched nothing; it no longer names the `⋯` menu as the favorites entry.

‎content/docs/references/ui/component.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma
15771577
| **actions** | `string[]` | optional | Action IDs the header draws, resolved against the actions declared on the page's object. An authored list is the whole set: an action that declares `record_header` (or `record_more`) in its `locations` but is not named here is not drawn, and a header with neither this key nor `placedActions: true` draws none of the object's actions. `placedActions: true` is the other way to say which actions the header draws (every one placed at `record_header` / `record_more`, read live), and the two are refused together. A named action that declares neither location renders nowhere. The host's own Edit / Share / Delete chrome is separate from this list. |
15781578
| **placedActions** | `boolean` | optional | Draw every action of the page's object whose `locations` include `record_header` or `record_more`, read live from the object's metadata, in place of an authored `actions` list: an action added to the object later, by any package, is drawn without editing the page. Omit it, or set false, to keep the `actions` list as the whole set. Refused as `true` beside an authored `actions` list: keep one. |
15791579
| **recordChrome** | `boolean` | optional (default: `true`) | Render the record chrome — the title as a record chip with its copy-id button. Set false on a non-record page (dashboard, landing) to fall back to the bare heading layout. |
1580-
| **showStar** | `never` | optional | [REMOVED] `page:header` property `showStar` was removed in @objectstack/spec 18 (ADR-0087 D2) — the reference console draws no star beside the record title, so the key switched nothing: the record's favorites entry is the header's ⋯ menu, and metadata does not control it. Delete the key, whether it was `true` or `false`; the ⋯ menu's favorites entry is unchanged. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
1580+
| **showStar** | `never` | optional | [REMOVED] `page:header` property `showStar` was removed in @objectstack/spec 18 (ADR-0087 D2) — the console draws the record's star from the host's favorites toggle, never from metadata, so the key switched nothing. Delete the key, whether it was `true` or `false`; the page draws the same star without it. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
15811581
| **showCopyId** | `boolean` | optional (default: `true`) | Show the copy-record-id button beside the record title. Part of the record chrome — no effect when `recordChrome` is false. |
15821582
| **maxVisible** | `integer` | optional | How many header actions render as inline buttons before the rest fold into the overflow menu. Renderer default when unset: 3 on every header. In a record page's header bar the number, authored or not, is an upper bound: actions that do not fit the bar's width fold as well, so a narrow drawer shows fewer. |
15831583
| **mobileMaxVisible** | `integer` | optional | The `maxVisible` budget on mobile viewports. Renderer default when unset: 2 in a record page's bottom action bar on a phone, where the host's Edit counts as one, 1 on any other header. |

‎packages/lint/src/validate-component-props.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ describe('validateComponentProps — undeclared keys', () => {
105105
});
106106

107107
// #23650 — `PageHeaderProps.showStar` is a retiredKey tombstone, the
108-
// `breadcrumb` route one key over: the reference console draws no star, and
109-
// the record's favorites entry is the header's ⋯ menu. It replaces the
108+
// `breadcrumb` route one key over: the star follows the host's favorites
109+
// toggle, never metadata. It replaces the
110110
// acceptance this file used to pin for `showStar: false` (#6776, below).
111111
it('refuses a retired page-header `showStar` as an error carrying the prescription, for `true` and `false`', () => {
112112
for (const showStar of [true, false]) {
@@ -119,7 +119,7 @@ describe('validateComponentProps — undeclared keys', () => {
119119
expect(f.severity).toBe('error');
120120
expect(f.path).toBe('pages[0].regions[0].components[0].properties.showStar');
121121
expect(f.message).toContain('`page:header` property `showStar` was removed in @objectstack/spec 18');
122-
expect(f.message).toContain('the record\'s favorites entry is the header\'s ⋯ menu, and metadata does not control it');
122+
expect(f.message).toContain('the console draws the record\'s star from the host\'s favorites toggle, never from metadata');
123123
}
124124
});
125125

‎packages/spec/src/conversions/entries/18/page-header-show-star-removed.ts‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,20 @@ import { isDict, stripKeys } from '../shared.js';
1919
* enforce-or-remove; ruling record 6203775759, letter A: 「A 退役 showStar
2020
* (Recommended)」).
2121
*
22-
* The key switched a star the reference console no longer draws. Since
23-
* objectui#12427 the `page:header` record chip draws the follow star only
24-
* where the host wires a favorites toggle into the record context
25-
* (`onToggleFavorite`), and no reference host does: the record's favorites
26-
* entry is the header's ⋯ overflow menu. `true` drew nothing and `false` hid
27-
* nothing. The tombstone on `PageHeaderProps` refuses it for a live author:
22+
* The key switched nothing. Since objectui#12427 the `page:header` record
23+
* chip draws the follow star wherever the host wires a favorites toggle into
24+
* the record context (`onToggleFavorite`), whatever the key says: the console
25+
* draws the record's star from the host's favorites toggle, never from
26+
* metadata. `true` and `false` draw the same star. The tombstone on `PageHeaderProps` refuses it for a live author:
2827
* `os validate`, `os build` and `os lint` refuse it as an `error` with the
2928
* prescription (the component-props gate, `@objectstack/lint`; the load path
3029
* keeps the open `properties` bag as written).
3130
*
3231
* **A delete of both values.** Neither changes what the reference console
3332
* draws, so there is no value to preserve and no rewrite target. The host
34-
* hook is not the key: a third-party host of the published component library
35-
* that wires `onToggleFavorite` keeps its star, and after the strip a header
36-
* that said `false` shows it there as an absent key would. The D3 entry
33+
* hook is not the key: any host of the published component library that wires
34+
* `onToggleFavorite`, the console included, draws its star, and a header that
35+
* said `false` shows it there as an absent key would. The D3 entry
3736
* `page-header-show-star-retired` records that.
3837
*
3938
* Who writes the key: nobody measured. No example app, skill or doc in this
@@ -51,9 +50,8 @@ const pageHeaderShowStarRemoved: MetadataConversion = {
5150
retiredAfter: '17.7.0',
5251
surface: 'page.component.page:header.showStar',
5352
summary:
54-
"page:header prop 'showStar' removed, whether 'true' or 'false' (the reference console draws no star "
55-
+ 'beside the record title: the record\'s favorites entry is the header\'s ⋯ menu, and metadata does '
56-
+ 'not control it)',
53+
"page:header prop 'showStar' removed, whether 'true' or 'false' (the console draws the record's star "
54+
+ 'from the host\'s favorites toggle, never from metadata, so the key switched nothing)',
5755
apply(stack, emit) {
5856
return mapPageComponents(stack, (component, path) => {
5957
if (component.type !== 'page:header') return component;

‎packages/spec/src/migrations/entries/semantic/18.page-header-show-star-retired.ts‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@ import type { SemanticMigration } from '../../types.js';
55
// #23650 (ADR-0049 enforce-or-remove) — the D3 entry of the
66
// `page-header-show-star-removed` family (one D3 entry per retirement family,
77
// even when D2 is lossless). Registered key: `ui/PageHeaderProps:showStar`.
8-
// The strip changes nothing the reference console draws; what it can change
9-
// is a third-party host that wires its own favorites toggle.
8+
// The strip changes nothing the reference console draws: the console draws
9+
// the record's star from the host's favorites toggle, never from metadata.
1010
export const entry: SemanticMigration = {
1111
id: 'page-header-show-star-retired',
1212
surface: 'page.component.page:header.showStar — the follow star beside the record title',
1313
replacement:
14-
'Nothing: delete the key, whether it was `true` or `false`. The record\'s favorites entry is the '
15-
+ 'header\'s ⋯ menu, and metadata does not control it.',
14+
'Nothing: delete the key, whether it was `true` or `false`. The console draws the record\'s star '
15+
+ 'from the host\'s favorites toggle, never from metadata, so the page draws the same star without it.',
1616
reason:
1717
'The D2 conversion `page-header-show-star-removed` deletes `showStar` from every page header, and '
18-
+ 'nothing the reference console draws changes: its record chip draws the follow star only where '
19-
+ 'the host wires a favorites toggle into the record context, and the console wires none, so '
20-
+ '`true` drew nothing and `false` hid nothing. What the conversion cannot decide is a host of '
21-
+ 'your own: if it wires that favorites toggle, the star now draws on every record header, a '
22-
+ 'header that said `false` included, and hiding it there is the host\'s call, not the page\'s.',
18+
+ 'nothing the reference console draws changes: the console draws the record\'s star from the '
19+
+ 'host\'s favorites toggle, never from metadata. Its record chip draws the star beside the record '
20+
+ 'name wherever the host wires that toggle into the record context, and the console wires it on '
21+
+ 'its record pages, so `true` and `false` draw the same star. A host of your own works the same '
22+
+ 'way: the star draws where it wires the favorites toggle, a header that said `false` included, '
23+
+ 'and hiding it there is the host\'s call, not the page\'s.',
2324
acceptanceCriteria:
2425
'No page header carries `showStar`, and the props lint reports one with the prescription. Every '
25-
+ 'record page shows the same header in the console as before the upgrade — title, copy-id '
26-
+ 'button and actions — and the record\'s favorites entry is still in the header\'s ⋯ menu.',
26+
+ 'record page shows the same header in the console as before the strip — title, copy-id button, '
27+
+ 'actions and the record\'s star beside the record name — and the header\'s ⋯ menu holds no '
28+
+ 'favorites entry (only a print page, which draws no header, keeps one in its ⋯).',
2729
};

‎packages/spec/src/migrations/registry.ts.template‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,10 +2665,10 @@ const STEP18_RATIONALE: readonly RationaleFragment[] = [
26652665
order: 98,
26662666
text:
26672667
'It also retires the page header\'s `showStar` switch (ADR-0049 enforce-or-remove): the '
2668-
+ 'reference console draws no star beside the record title — its record chip draws one only '
2669-
+ 'where the host wires a favorites toggle, and the console\'s favorites entry is the '
2670-
+ 'header\'s ⋯ menu — so the key switched nothing. The key is a retiredKey tombstone on '
2671-
+ '`PageHeaderProps`, beside `icon` and `breadcrumb`, and the D2 conversion '
2668+
+ 'console draws the record\'s star from the host\'s favorites toggle, never from metadata — '
2669+
+ 'its record chip draws the star beside the record name wherever the host wires that toggle, '
2670+
+ 'and the console wires it on its record pages — so the key switched nothing. The key is a '
2671+
+ 'retiredKey tombstone on `PageHeaderProps`, beside `icon` and `breadcrumb`, and the D2 conversion '
26722672
+ '`page-header-show-star-removed` strips it from every `page:header`, `true` and `false` '
26732673
+ 'alike, retired from the load path. Its D3 record is the semantic entry '
26742674
+ '`page-header-show-star-retired`. The host hook is not part of it: a host that wires the '

‎packages/spec/src/ui/component.zod.ts‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,8 @@ export const PageHeaderProps = strictObject({
779779
*
780780
* ON (the default) the header carries the **record chrome**: the title
781781
* renders as a record chip with the copy-record-id button beside it (the
782-
* follow star draws there only where a host wires a favorites toggle; the
783-
* reference console's favorites entry is the header's ⋯ menu). OFF it falls back to a bare heading — one title line and
782+
* follow star draws there only where a host wires a favorites toggle, as the
783+
* reference console does on its record pages). OFF it falls back to a bare heading — one title line and
784784
* nothing record-shaped — which is what a dashboard or a landing page wants,
785785
* since there is no record for the chip to describe.
786786
*
@@ -801,11 +801,12 @@ export const PageHeaderProps = strictObject({
801801
* the way `breadcrumb` above left this row; ruling record 6203775759,
802802
* letter A).
803803
*
804-
* A switch for a star the reference console no longer draws. Since
805-
* objectui#12427 the record chip draws the follow star only where the HOST
806-
* wires a favorites toggle into the record context (`onToggleFavorite`),
807-
* and no reference host does: the record's favorites entry is the header's
808-
* ⋯ overflow menu. So `showStar: true` (the default) drew nothing and
804+
* A switch metadata never had a say in. Since objectui#12427 the record chip
805+
* draws the follow star only where the HOST wires a favorites toggle into
806+
* the record context (`onToggleFavorite`); when the key was retired no
807+
* reference host did, and since #36246 the reference console wires it on
808+
* its record pages, beside the record's name. Either way the star follows
809+
* the host's toggle, so `showStar: true` (the default) drew nothing and
809810
* `showStar: false` hid nothing. No example app, skill or doc authored it.
810811
*
811812
* The host hook stays: objectui's `RecordContextValue.onToggleFavorite` is a
@@ -817,9 +818,8 @@ export const PageHeaderProps = strictObject({
817818
*/
818819
showStar: retiredKey(
819820
'`page:header` property `showStar` was removed in @objectstack/spec 18 (ADR-0087 D2) — '
820-
+ 'the reference console draws no star beside the record title, so the key switched nothing: '
821-
+ 'the record\'s favorites entry is the header\'s ⋯ menu, and metadata does not control it. '
822-
+ 'Delete the key, whether it was `true` or `false`; the ⋯ menu\'s favorites entry is unchanged. '
821+
+ 'the console draws the record\'s star from the host\'s favorites toggle, never from metadata, so the key switched nothing. '
822+
+ 'Delete the key, whether it was `true` or `false`; the page draws the same star without it. '
823823
+ 'Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand.',
824824
),
825825
/**

‎packages/spec/src/ui/page-header-show-star-retirement.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
* record context (`onToggleFavorite`), and no reference host does — the
1212
* console's favorites entry is the header's ⋯ overflow menu. So `true` (the
1313
* default) drew nothing and `false` hid nothing. No producer writes the key in
14-
* this repo or in objectui's apps and examples.
14+
* this repo or in objectui's apps and examples. Since objectstack#36246 the
15+
* console wires that toggle on its record pages, and the star still answers
16+
* the host's toggle, never the key.
1517
*
1618
* Bookkeeping shapes, pinned below:
1719
* 1. A `retiredKey()` tombstone on `PageHeaderProps`, a `strictObject` — the
@@ -58,7 +60,7 @@ const REGISTERED_KEY = 'ui/PageHeaderProps:showStar';
5860
// Unanchored, because a thrown `ZodError`'s message is the JSON of its issues;
5961
// the key-first house convention is asserted on the issue message itself.
6062
const PRESCRIPTION =
61-
/`page:header` property `showStar` was removed in @objectstack\/spec 18 \(ADR-0087 D2\) — the reference console draws no star beside the record title.*the record's favorites entry is the header's ⋯ menu, and metadata does not control it\..*Delete the key, whether it was `true` or `false`.*Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand\./s;
63+
/`page:header` property `showStar` was removed in @objectstack\/spec 18 \(ADR-0087 D2\) — the console draws the record's star from the host's favorites toggle, never from metadata, so the key switched nothing\..*Delete the key, whether it was `true` or `false`.*Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand\./s;
6264

6365
/** A page header's live keys — what an author commonly writes, not the retired one. */
6466
const HEADER = { title: 'Account', subtitle: '{industry}', showCopyId: false, actions: ['log_call'] } as const;

0 commit comments

Comments
 (0)