Skip to content

fix(console): a list with no declared primary action keeps its header actions as buttons beside a long description - #34045

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-iy541q
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-iy541q

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #33988

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么: 列表页(和 /data 页)页头没有「声明的主操作」时(没有 New,也没有工具栏动作写 variant: 'primary'),不再把按钮折叠进「⋯」;按钮一直保留,长描述被截断。
  • 为什么改: objectui#12705 的折叠只保留声明的主操作。hotclm 的 Launch Contract 没声明为 primary,读者也没有 New,于是折叠后只剩「⋯」,英文长描述一占满就把唯一的按钮藏进菜单(卡里截图的菜单正是 Launch Contract、Add to favorites)。
  • 风险与回滚: 只动 @object-ui/app-shell 三个文件的条件与注释,PageHeader 的折叠算法不变;有声明主操作的页面行为不变(objectui#12705 的测试原样通过)。没有主操作的页面在窄屏也不再折叠,按钮照常显示、标题和描述先截断。回滚 = revert。
  • 先看: objectViewHeaderChrome.tsx 里 foldedHeaderActions 的新条件;ObjectDataPage.tsx 的 foldedActions;测试 ObjectView.headerFold-12705.test.tsx 新增的 objectstack#33988 describe。
  • 两分钟验证: pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx packages/app-shell/src/views/ObjectDataPage.createAffordances.test.tsx,预期全部通过;在没有 New、只有一个非 primary 工具栏动作、描述很长的列表页上,1440 宽下该动作仍是按钮。
  • 需要你做的: 无,席位落地。

What changes

  • The list page offers its header a folded face only when it has a primary to keep. useObjectViewHeaderChrome builds foldedHeaderActions only when the list draws New or has a list-toolbar action authored variant: 'primary' (declaredPrimaryToolbarAction). Otherwise it passes none, and PageHeader keeps actions at every width (its documented behaviour for a page with no foldedActions); the description truncates instead.
  • /data (ObjectDataPage) follows the same rule: its folded face (New labelled, Save as view in a ⋯) is offered only when New is drawn. An admin who cannot create keeps Save as view as a button.
  • PageHeader: no code change; the foldedActions docblock now says a page with no primary to keep labelled passes none.
  • A list that declares a primary folds exactly as before; the objectui#12705 pins are unchanged.

Why

PageHeader folds when actions would clip the title or the description, and the description counts at its full content width. The list's folded face keeps one labelled action only when that action is DECLARED primary; with none, the face is the ⋯ alone. So on hotclm's clm_contract list (reader without create, one toolbar action Launch Contract not authored primary, a 122-character English description), the header folded at desktop width and moved the page's only action into the menu, exactly the card's menu (Launch Contract, Add to favorites). The PM hypothesis (the action bar measures what the title block leaves) did not hold: the fold decision is PageHeader's, and it worked as designed; the gap was a folded face with nothing labelled in it.

Between phone and desktop widths a list with no declared primary now never folds: its actions stay labelled buttons, the description truncates first and the title truncates inside its 60 % cap. The schema-driven toolbar keeps its own action:bar overflow (maxVisible), so many undeclared actions still collapse into that bar's own menu, as before objectui#12705. Below sm the Console list draws its phone header, which this change does not touch. To keep a toolbar action labelled AND fold the others on a narrow header, author it variant: 'primary'.

Tests

  • ObjectView.headerFold-12705.test.tsx, new top-level describe in the existing harness (the same layout model as the objectui#12705 pins: 10 px per title character, 7 px per description character, 100 px per labelled button): the card's object (no New for the reader, one undeclared Launch Contract, the card's description) at a 1110 px, 1184 px (a 1440 px viewport less the 256 px sidebar) and 700 px header keeps Launch Contract labelled, the ⋯ holds only Add to favorites, and data-folded is absent. CONTROL: the same list with Launch Contract authored variant: 'primary' still folds at 600 px and keeps it labelled.
  • ObjectDataPage.createAffordances.test.tsx, new top-level describe: an admin who cannot create keeps Save as view as a button with no fold offered; CONTROL: with New drawn the fold is offered (data-folded="false").
  • Forced test edits: the /data harness's useWorkspaceAdminStatus mock now reads a workspaceAdmin variable (default false, reset in beforeEach), so the existing cases see the same value as before. The ObjectView fold harness gains the module-top import '@objectstack/lint' that check:test-source-alias asks of an edited test file reaching ObjectView.
Runs, ablation and the wider suite (head 2daa61d)
  • The two fold harnesses plus the /data harness: Test Files 3 passed (3), Tests 48 passed (48) (lock VERDICT command-exit 0).
  • Ablation through scripts/ablation-replace.mjs, both fixes mutated together (objectViewHeaderChrome.tsx anchor !isEnvironmentList && (showCreate || primaryToolbarAction) ? 1 → 0, replaced by !isEnvironmentList /* ablated */ ?; ObjectDataPage.tsx anchor newButton && <> 1 → 0, replaced by (true as boolean) && <>; both restored, blob equal to HEAD, git diff HEAD empty): all four no-primary pins red, both controls green, Tests 4 failed | 37 passed (41). With the assertions reordered to read the action first, the list-page leg reads AssertionError: expected [] to deeply equal [ 'Launch Contract' ] at 1110, 1184 and 700 px: the action was in the ⋯. ui vitest resolves @object-ui/* to src/, so no build sits between mutation and run. A first /data leg replaced the anchor with <>, which the tool refused (the replacement already occurred in the file); it did not run.
  • Every test file under ui/packages/app-shell/src and ui/apps/console/src naming PageHeader, ObjectDataPage, ObjectView or objectViewHeaderChrome (191 files, selected by grep -rlE): Test Files 191 passed (191), Tests 2246 passed (2246) (lock VERDICT command-exit 0), at 1eba7d1; the final head adds only the harness's module-top import, and the three pin files were re-run on it. The rest of Test UI is CI's.
  • pnpm --filter @object-ui/app-shell type-check (tsc --noEmit and tsc -p tsconfig.test.json) after turbo run build --filter='@object-ui/app-shell^...': VERDICT command-exit 0.
  • pnpm exec eslint on the five touched files from ui/: 0 errors (21 pre-existing warnings, none on added lines). pnpm run check:new-line-citations (ui): 0 new citation(s).

Acceptance notes

  • Real browser: NOT MEASURED (no hotclm stack in this container). The pins use the objectui#12705 harnesses' layout model; in it the base code folds the card's list at 1110, 1184 and 700 px, matching the card's 1440 px reading.
  • Same class elsewhere: PackagesPage always draws New Package, so its folded face always keeps a labelled action; no change there.
  • hotclm (carrier: hotclm): authoring Launch Contract as variant: 'primary' would also keep it labelled on a narrow header while the other actions fold; not required for this fix.

Verification

Gates from node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on 2daa61d (change set: 6 paths vs merge base bc6b7ff): 37 derived, 37 run, all exit 0; dispatch-gates --ran: "37 derived famil(ies) accounted for — 37 run, 0 NOT-MEASURED (a DERIVED zero …)". Among them check:test-source-alias, check:type-check-debt, check:type-check-coverage, check:cross-package-test-inputs, check:published-files, check:nul-bytes, check-sdui-manifest (and --self-test), check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main, check-adr-0087-registration --base origin/main, pnpm --dir ui exec vitest run scripts/. The first round on 1eba7d1 had check:test-source-alias red (the edited fold harness lacked the module-top lint import); fixed in 2daa61d and the whole list re-run there. Dogfood: n/a (no ! in the title, no (narrowing) arm). Changeset: .changeset/33988-header-fold-needs-primary.md, @object-ui/app-shell and @object-ui/console patch.


Generated by Claude Code

…elled

A list with no New and no toolbar action authored variant primary handed
the page header a folded face of only the overflow menu, so a long object
description alone moved the page's one action into the menu at desktop
width. Such a page now passes no folded face: its actions stay at every
width and the description truncates. The /data page gets the same rule.

Claude-Session: https://claude.ai/code/session_01ADHkmRPuiKPqavVVdijcAp
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi

维护者速读

  • 改了什么:列表页没有“主操作”(无“新建”、也没有声明为 primary 的工具栏按钮)时,标题栏不再折叠,按钮始终显示;对象描述过长时改为截断描述。/data 页同理。
  • 为什么改:hotclm 合同列表的英文描述很长,唯一的操作 “Launch Contract” 在 1440px 宽屏下被挤进 “…” 菜单(Console list header: a long object description pushes the primary header action into the "…" overflow menu at desktop width #33988)。
  • 风险与回滚:声明了主操作的列表折叠行为完全不变;无主操作的列表在中等宽度下不再折叠,按钮保持标签显示。回滚即还原这一个提交。
  • 先看:ui/packages/app-shell/src/views/objectViewHeaderChrome.tsx 中 foldedHeaderActions 的新条件,及 ObjectView.headerFold-12705.test.tsx 新增用例。
  • 两分钟验证:cd ui && pnpm exec vitest run packages/app-shell/src/views/ObjectView.headerFold-12705.test.tsx。
  • 需要你做的:无,席位落地。

席位意见:ACCEPT。PageHeader 的折叠策略本身正确,缺陷在列表传入了一个“只有 …”的折叠面;不传折叠面是根治,未改动折叠策略与其既有钉子。

席位核对 — ACCEPT · domain:ui#2 · head 2daa61df · 2026-11-15T17:35Z

  • Shape: draft → main, first line Fixes #33988, no other closing keyword in the body. Clause-②: no / Metadata-protocol: none match the claim (6897452024).
  • Diff read by the seat: objectViewHeaderChrome.tsx +7/−1, ObjectDataPage.tsx +4/−2, PageHeader.tsx doc comment +3/−1, two test files, one changeset. All inside the amended surface (6897496661).
  • Mechanism: the card's PM hypothesis was falsified by the dev and the route changed with the seat's amendment; no feat(security,meta): org-scoped presentation authoring capability for tenant org admins #12705 pin edited.
  • Gates: check-runs on 2daa61df = success 38, skipped 13, failure 0, read 2026-11-15T17:35Z. Dev: 37/37 derived gates run, ablation reds all four no-primary pins.
  • Accepted deviation: the pins run in happy-dom's layout model at 1110 / 1184 / 700 px; a real-browser measure was not taken. Between phone and desktop a no-primary list no longer folds (dev report).
  • Out of scope: none. Skills-docs: n/a (Metadata-protocol: none).
  • Landing: K = 8 < 15; no governed path. Ready + auto-merge now.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 17:35
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 27c2f1e Nov 15, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-iy541q branch November 15, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console list header: a long object description pushes the primary header action into the "…" overflow menu at desktop width

2 participants