Repository navigation
fix(console): a list with no declared primary action keeps its header actions as buttons beside a long description - #34045
Merged
Conversation
…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>
Claude-Session: https://claude.ai/code/session_01ADHkmRPuiKPqavVVdijcAp Co-authored-by: Claude <noreply@anthropic.com>
…mary pins Claude-Session: https://claude.ai/code/session_01ADHkmRPuiKPqavVVdijcAp Co-authored-by: Claude <noreply@anthropic.com>
…arness Claude-Session: https://claude.ai/code/session_01ADHkmRPuiKPqavVVdijcAp Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi 维护者速读
席位意见:ACCEPT。PageHeader 的折叠策略本身正确,缺陷在列表传入了一个“只有 …”的折叠面;不传折叠面是根治,未改动折叠策略与其既有钉子。 席位核对 — ACCEPT · domain:ui#2 · head
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #33988
Clause-②: no
Metadata-protocol: none
维护者速读
/data页)页头没有「声明的主操作」时(没有 New,也没有工具栏动作写variant: 'primary'),不再把按钮折叠进「⋯」;按钮一直保留,长描述被截断。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
useObjectViewHeaderChromebuildsfoldedHeaderActionsonly when the list draws New or has a list-toolbar action authoredvariant: 'primary'(declaredPrimaryToolbarAction). Otherwise it passes none, andPageHeaderkeepsactionsat every width (its documented behaviour for a page with nofoldedActions); 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; thefoldedActionsdocblock now says a page with no primary to keep labelled passes none.Why
PageHeaderfolds whenactionswould 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'sclm_contractlist (reader without create, one toolbar actionLaunch Contractnot 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 isPageHeader'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:baroverflow (maxVisible), so many undeclared actions still collapse into that bar's own menu, as before objectui#12705. Belowsmthe 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 itvariant: 'primary'.Tests
ObjectView.headerFold-12705.test.tsx, new top-leveldescribein 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 undeclaredLaunch Contract, the card's description) at a 1110 px, 1184 px (a 1440 px viewport less the 256 px sidebar) and 700 px header keepsLaunch Contractlabelled, the⋯holds onlyAdd to favorites, anddata-foldedis absent. CONTROL: the same list withLaunch Contractauthoredvariant: 'primary'still folds at 600 px and keeps it labelled.ObjectDataPage.createAffordances.test.tsx, new top-leveldescribe: 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")./dataharness'suseWorkspaceAdminStatusmock now reads aworkspaceAdminvariable (defaultfalse, reset inbeforeEach), so the existing cases see the same value as before. TheObjectViewfold harness gains the module-topimport '@objectstack/lint'thatcheck:test-source-aliasasks of an edited test file reachingObjectView.Runs, ablation and the wider suite (head 2daa61d)
/dataharness:Test Files 3 passed (3),Tests 48 passed (48)(lock VERDICT command-exit 0).scripts/ablation-replace.mjs, both fixes mutated together (objectViewHeaderChrome.tsxanchor!isEnvironmentList && (showCreate || primaryToolbarAction) ?1 → 0, replaced by!isEnvironmentList /* ablated */ ?;ObjectDataPage.tsxanchornewButton && <>1 → 0, replaced by(true as boolean) && <>; both restored, blob equal to HEAD,git diff HEADempty): 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 readsAssertionError: expected [] to deeply equal [ 'Launch Contract' ]at 1110, 1184 and 700 px: the action was in the⋯. ui vitest resolves@object-ui/*tosrc/, so no build sits between mutation and run. A first/dataleg replaced the anchor with<>, which the tool refused (the replacement already occurred in the file); it did not run.ui/packages/app-shell/srcandui/apps/console/srcnamingPageHeader,ObjectDataPage,ObjectVieworobjectViewHeaderChrome(191 files, selected bygrep -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 --noEmitandtsc -p tsconfig.test.json) afterturbo run build --filter='@object-ui/app-shell^...': VERDICT command-exit 0.pnpm exec eslinton the five touched files fromui/: 0 errors (21 pre-existing warnings, none on added lines).pnpm run check:new-line-citations(ui):0 new citation(s).Acceptance notes
PackagesPagealways draws New Package, so its folded face always keeps a labelled action; no change there.Launch Contractasvariant: '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/objectstackon 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 themcheck: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 hadcheck:test-source-aliasred (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-shelland@object-ui/consolepatch.Generated by Claude Code