Repository navigation
feat(app-shell): an object list's title names the object ahead of the view switcher - #28438
Merged
Merged
Conversation
… view switcher Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyHsuwJSdPnjSmNWsB
…ne, the sidebar states and the phone bar; docs and changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyHsuwJSdPnjSmNWsB
Contributor
Author
|
domain:ui#2 · os-tesla · session_01L9qibxgfM8p8t3fo6y9eFK 席位意见:同意。按裁决 B 落在列表页页头,顶栏 AppHeader 未动;窄行对象名不缩、视图名先截断;对象名链接回该对象默认列表。席位落地。 席位核对ACCEPT · 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 Tesla · project thread
Fixes #27950
Clause-②: no
Metadata-protocol: none
维护者速读
ui/packages/app-shell/src/views/objectViewPageHeader.tsx(ObjectListTitle与title的三种取值)、ui/packages/app-shell/src/views/objectViewViewCrud.tsx(手机按钮文字)、新测试ObjectView.objectListTitle-27950.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.objectListTitle-27950.test.tsx,预期 9 个测试全过;或在 Console 打开 CRM 线索的任一视图,标题左侧可见「线索 /」。What changes
The maintainer's ruling B on #27950 (comment 6539906268), verbatim: 「#27950 裁 B:页头对象名前置视图切换器;窄列表下对象名优先保留、视图名截断或换行、计数可省」.
objectViewPageHeader.tsx): when the list has a view switcher, the title is 「OBJECT / VIEW ▾ · COUNT」. The object's plural label (the reader's language, throughobjectPluralLabel) comes first, as a link to/apps/APP/OBJECT. That bare address opens the reader's pinned view, or else the declared default. Off an app route it is plain text.labelis already called by the plural (objectui#12774). Its title stays the switcher alone, so the object is named once and never as 「Leads / Leads」.shrink-0 whitespace-nowrap. The view label is the switcher's owntruncatespan inside amin-w-0row, so the view label is cut first and the object label never is. The count stays: it is a few characters, and the ruling makes dropping it optional.objectViewViewCrud.tsx): the page header is not drawn belowsm. The app bar's view switcher trigger now receivestriggerLabel「OBJECT / VIEW」 through the existingMobileViewSwitcherContextfield. That span truncates its end, so the view label gives way before the object's. A label-less view keeps the plain label.AppHeader.tsxis not touched.useObjectViewTitleSwitcheralso returns thetitleLabelit already computed, andObjectViewpasses it and the object list href to the header.content/docs/ui/views.mdx› Switching views. Changeset:.changeset/27950-object-list-title-names-object.md(@object-ui/app-shellpatch).Tests
New
ui/packages/app-shell/src/views/ObjectView.objectListTitle-27950.test.tsx(9 cells, realObjectView→ pluginObjectView→ListViewchain, theObjectView.titleViewSwitcher-27594harness):Leadsthen the switcher. The label is anAwithhref="/apps/crm/crm_lead", and following it opens the default view.SidebarProvider;useSidebar().stateis read back asexpanded/collapsed), the object label is drawn exactly once.?recordId=) gives one object label and one switcher.Notes.shrink-0+whitespace-nowrap, and the view label istruncate.Leads / My Leads.The record route's crumb is not drawn by this page:
RecordDetailViewis a separate route chunk. The existingAppHeader.appBarLeftGroup-12461cells ("an object's view and record routes draw no crumb either") pin the app bar, and they pass unchanged in the run below.Ablations (scripts/ablation-replace.mjs, WRAP mode, under os-verify-lock, trap restore)
No dist leg: the suite imports
./ObjectViewfrom source.Tests 7 failed / 2 passed (9)(the label-less and phone cells stay green)triggerLabeldroppedTests 1 failed / 8 passed (9)shrink-0 whitespace-nowrap→min-w-0 truncateTests 1 failed / 8 passed (9)Tests 1 failed / 8 passed (9)Every leg:
ok mutation landed: anchor 1 -> 0. Every restore:blob == HEAD(objectViewPageHeader.tsx540eb8ba8885,objectViewViewCrud.tsxa05153fc75e3) andgit diff HEADempty. These ablations ran at the pre-merge head, where both files were byte-identical to the final head.Acceptance notes
AppHeader.tsx) was replaced by the ruling. The diff lands inobjectViewPageHeader.tsx,objectViewViewCrud.tsx,objectViewTitleSwitcher.tsx(one returned value) andObjectView.tsx(two props), as the decision comment's 裁后执行 line named.titleprop of the samePageHeadercall inobjectViewPageHeader.tsx, a different region.AppHeader. An object plural longer than that would itself be cut. No authored object in this tree comes close, and widening the cap isAppHeader's, outside this ruling.aria-hidden), and the link's name is the object's own label.Verification
All at head
750e100f(branch merged withorigin/main5da3a8ce, which carries #28394), except the ablations as noted.Derived gates — 66 derived, 66 run, all exit 0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 66 commands from 7 paths vs merge base5da3a8ce3. Each ran with</dev/null, and each exit code was recorded before any pipe. This includesnode scripts/check-sdui-manifest.mjs(exit 0) andpnpm --dir ui exec vitest run scripts/(Test Files 169 passed | 2 skipped (171),Tests 4901 passed | 2 skipped (4903)). Reconciliation:dispatch-gates --ran:66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN. Before the gates:env -u OS_SKIP_DTS pnpm turbo run build --filter=@objectstack/spec --filter='@objectstack/lint...' --filter='@objectstack/client-react...'(38/38).Tests and type-check
app-shellObjectView.*andAppHeader.*suite, plus every test namingMobileViewSwitcher, the page header, the title switcher or the view CRUD hook) under os-verify-lock:Test Files 106 passed (106),Tests 818 passed (818), VERDICT command-exit 0.pnpm --filter @object-ui/app-shell type-check(bothtsconfig.jsonandtsconfig.test.json; the test config lists the new suite) afterenv -u OS_SKIP_DTS pnpm turbo run build --filter='@object-ui/app-shell^...'(64/64): VERDICT command-exit 0.eslint --no-inline-configon the four changedapp-shellfiles: 0 errors (34 pre-existing warnings, none on the new lines).pnpm check:new-line-citations(ui): 0 new citations.Generated by Claude Code