Skip to content

Commit 7de1bad

Browse files
fix(ui): state the real page:header mobileMaxVisible default in designer text (#35951)
Fixes #35840 Clause-②: no Metadata-protocol: none ## 维护者速读 - 在 Studio 设计器和组件文档里,页面头部「手机端最多显示的按钮数」的说明,现在写对了默认值(手机记录页底栏是 2,其他头部是 1,原来写成 1)。 - 为了让设计器说明、文档与已定稿的规格说明一致,避免设计者按错误默认值配置。 - 只改文字和注释,不改任何行为;出错也只是说明文字不准,可直接撤回。 - 要你做什么:无。 ## What changes Text only in `ui/packages/components/src/renderers/layout/containers.tsx`: - the designer input description of `mobileMaxVisible` (was "A positive integer, defaulting to 1") now states the unset default: 2 in a record page's bottom action bar on a phone (host Edit counted), 1 on any other header; - the `PageHeaderActionsProps` comments for `maxVisible` / `mobileMaxVisible` (were "falls back to 3" / "falls back to 1"); - the inline/overflow comment ("default to 3 / 1"). Regenerated, not hand-edited, with `node scripts/gen-sdui-manifest-node.mjs` and `node scripts/gen-sdui-reference.mjs`: `sdui.manifest.json`, `content/docs/ui/components/page.mdx`, and `scripts/sdui-manifest.record.json` (the manifest generator re-records its own sha256 there; one line, `sha256`). One changeset. `types/ui-action.ts` and `action/auto-trigger.ts` are untouched (they describe `action:bar`, fallback still 3 / 1). Spec text matched (`packages/spec/src/ui/component.zod.ts` on main, from #35660 / #35821): - `maxVisible`: "Renderer default when unset: 1 in a record page's one-row header bar, 3 on any other header." - `mobileMaxVisible`: "Renderer default when unset: 2 in a record page's bottom action bar on a phone, 1 on any other header." Code agrees with the spec (read before writing): `containers.tsx` `PHONE_ACTION_BAR_BUTTONS = 2` for `face: 'bar'` (Edit takes a slot there), `?? 1` for other mobile headers, `defaultMaxVisible ?? 3` on desktop with the record one-row header passing 1. ## Tests No behavior change, so no test change. `pnpm check:sdui-reference` exit 0 (page.mdx matches the manifest, 106 components); `node scripts/check-sdui-manifest.mjs` exit 0; `pnpm check:changeset-fixed` exit 0; `node scripts/check-nul-bytes.mjs` exit 0. ## Acceptance notes - Designer description, manifest and page.mdx agree with the spec default; the generated-artefact freshness checks pass locally. - `scripts/sdui-manifest.record.json` is outside the stated file surface but is written by the same generator run (sha256 line only). - Overlap check against #35938 (same file, other region): merges cleanly. ## Verification Read `page.mdx` row `mobileMaxVisible`: it now reads "...when unset it is 2 in a record page's bottom action bar on a phone (counting the host's Edit) and 1 on any other header...". 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgWdb2isyvQFrgHazQx Co-authored-by: Claude <noreply@anthropic.com>
1 parent d17adf5 commit 7de1bad

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/components': patch
3+
---
4+
5+
fix(ui): the designer and docs text for `page:header` `mobileMaxVisible` states the real default
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The Max Inline Actions (mobile) input description, and the `page.mdx` reference generated from it, said the budget defaults to 1. Unset, it is 2 in a record page's bottom action bar on a phone (the host's Edit counts) and 1 on any other header. The description now says so, matching the spec text from #35660, and the stale 3 / 1 comments on the header actions row are corrected. Text only: no value, fallback or rendering changes.

‎content/docs/ui/components/page.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Namespace `page`.
5656
| `recordChrome` | `boolean` | | Set false for the bare h1 header on non-record pages |
5757
| `showCopyId` | `boolean` | | — |
5858
| `maxVisible` | `number` | | How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer — the contract rejects 0 and fractional values. Two kinds of action are routed to the overflow menu regardless of this budget and never occupy an inline slot: an action whose locations declare record_more without record_header, and any action with component action:menu. The host's own buttons (the record page's Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator. |
59-
| `mobileMaxVisible` | `number` | | The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer, defaulting to 1; the desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged. |
59+
| `mobileMaxVisible` | `number` | | The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer; when unset it is 2 in a record page's bottom action bar on a phone (counting the host's Edit) and 1 on any other header. The desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged. |
6060

6161
## `page:section` [#page-section]
6262

‎scripts/sdui-manifest.record.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"source": "built-tree",
1515
"generator": "scripts/gen-sdui-manifest-node.mjs",
1616
"generatedAt": "2026-11-20",
17-
"sha256": "95510b0adeaef1efbfdb761325bcb96f034d252e179587f82dd9a7ae2d98f262",
17+
"sha256": "eb1d4319bfd42d09fd5e3783c00572f77a281626724481f815da7686509d73de",
1818
"components": 106,
1919
"inTree": {
2020
"modulesRoot": "ui/apps/console",

‎sdui.manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3544,7 +3544,7 @@
35443544
{
35453545
"name": "mobileMaxVisible",
35463546
"type": "number",
3547-
"description": "The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer, defaulting to 1; the desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged."
3547+
"description": "The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer; when unset it is 2 in a record page's bottom action bar on a phone (counting the host's Edit) and 1 on any other header. The desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged."
35483548
}
35493549
]
35503550
},

‎ui/packages/components/src/renderers/layout/containers.tsx‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,9 +1944,9 @@ export interface PageHeaderActionsProps {
19441944
* live, in place of an `actions` list. Only the boolean `true` opts in.
19451945
*/
19461946
placedActions?: unknown;
1947-
/** The inline-button budget on desktop, as `page:header`'s `maxVisible`; an out-of-contract value falls back to 3. */
1947+
/** The inline-button budget on desktop, as `page:header`'s `maxVisible`; an out-of-contract value falls back to the unset default: 1 in a record page's one-row header (`defaultMaxVisible`), 3 on any other header. */
19481948
maxVisible?: unknown;
1949-
/** The inline-button budget on mobile, as `page:header`'s `mobileMaxVisible`; an out-of-contract value falls back to 1. */
1949+
/** The inline-button budget on mobile, as `page:header`'s `mobileMaxVisible`; an out-of-contract value falls back to the unset default: 2 in a record page's phone bottom bar (`face: 'bar'`, the host's Edit included), 1 on any other header. */
19501950
mobileMaxVisible?: unknown;
19511951
/** Drawn in place of the action row when no action survives the gates. */
19521952
emptySlot?: React.ReactNode;
@@ -2572,8 +2572,10 @@ export const PageHeaderActions: React.FC<PageHeaderActionsProps> = ({
25722572
// 4. a host button (the record page's Edit) is not one of the page's
25732573
// actions: it takes no slot and never folds (objectui#12617).
25742574
// `maxVisible` / `mobileMaxVisible` are overridable on the page:header
2575-
// schema and default to 3 / 1. This keeps the header from drowning in 4–5
2576-
// buttons on every record page.
2575+
// schema. Unset, `maxVisible` is 1 in a record page's one-row header and 3
2576+
// on any other header; `mobileMaxVisible` is 2 in a phone's record bottom
2577+
// bar (the host's Edit included) and 1 on any other header. This keeps the
2578+
// header from drowning in 4–5 buttons on every record page.
25772579
//
25782580
// `readMax` enforces the SPEC's value domain rather than a laxer renderer
25792581
// tolerance (objectui#5006). Measured on `ComponentPropsMap['page:header']`
@@ -3651,7 +3653,7 @@ ComponentRegistry.register('header', PageHeaderRenderer, {
36513653
// `description` stays the only authoring-time expression of it, and spec
36523654
// stays the sole judge of values.)
36533655
{ name: 'maxVisible', type: 'number', description: 'How many header actions render as inline buttons on desktop before the rest fold into the overflow menu. A positive integer — the contract rejects 0 and fractional values. Two kinds of action are routed to the overflow menu regardless of this budget and never occupy an inline slot: an action whose locations declare record_more without record_header, and any action with component action:menu. The host\'s own buttons (the record page\'s Edit) take no slot and never fold. The first inline action, or the one declaring variant primary, is the one filled primary button; the others are outline buttons. An action declaring variant danger is never the primary: inline it is a destructive button, and in the overflow menu it is a red row below a separator.' },
3654-
{ name: 'mobileMaxVisible', type: 'number', description: 'The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer, defaulting to 1; the desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged.' },
3656+
{ name: 'mobileMaxVisible', type: 'number', description: 'The same inline-button budget on mobile viewports, where horizontal room is scarce. A positive integer; when unset it is 2 in a record page\'s bottom action bar on a phone (counting the host\'s Edit) and 1 on any other header. The desktop half is Max Inline Actions, and the overflow routing rules stated there apply unchanged.' },
36553657
],
36563658
});
36573659

0 commit comments

Comments
 (0)