From 672e2affda04a1aba2e753d4f2711e10ed17d07f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 15:48:02 +0000 Subject: [PATCH 01/17] wip(ui): list page bar and view switcher trigger --- .../app-shell/src/layout/PageHeader.tsx | 43 +++- .../app-shell/src/views/ObjectView.tsx | 20 +- .../src/views/objectViewHeaderChrome.tsx | 6 +- .../src/views/objectViewHeaderToolbar.ts | 2 + .../src/views/objectViewPageHeader.tsx | 196 ++++++------------ .../src/views/objectViewTitleSwitcher.tsx | 58 ++++-- 6 files changed, 159 insertions(+), 166 deletions(-) diff --git a/ui/packages/app-shell/src/layout/PageHeader.tsx b/ui/packages/app-shell/src/layout/PageHeader.tsx index f2b2303e4f5..4ba51faf00e 100644 --- a/ui/packages/app-shell/src/layout/PageHeader.tsx +++ b/ui/packages/app-shell/src/layout/PageHeader.tsx @@ -30,7 +30,14 @@ * The posture is read off the route (`useInSetupApp`), not passed by the * page, so a console page outside Setup keeps the one-row header. * - * The fold — in either posture (objectui#12705), a page may also pass + * List posture — an object's list page passes `posture="list"` + * (objectstack#35548): one 44px bar, the object's single-colour icon and its + * name at 13px, and the actions; no accent hairline, no icon tile, no + * subtitle. Inside the Setup app the Setup posture still wins, so every Setup + * page keeps one header shape. + * [icon] Name [kind] [actions...] + * + * The fold — in every posture (objectui#12705), a page may also pass * `foldedActions`: its primary action and its `⋯` menu holding the rest. When * the header is too narrow for `actions` and its text, it draws that instead, * so the actions fold before the title or the description is cut: @@ -158,6 +165,11 @@ export interface ConsolePageHeaderProps { * conflict with z-index of overlays). */ sticky?: boolean; + /** + * `'list'` — the object list page's 44px bar (objectstack#35548). Absent ⇒ + * the one-row header above. Ignored inside the Setup app. + */ + posture?: 'list'; /** Additional className applied to the outer container. */ className?: string; /** Optional data-testid for E2E selectors. */ @@ -186,6 +198,7 @@ export function PageHeader({ foldedActions, accentColor, sticky = false, + posture, className, 'data-testid': testId, }: ConsolePageHeaderProps) { @@ -195,6 +208,8 @@ export function PageHeader({ const style = { '--page-header-accent': accent } as React.CSSProperties; // objectui#12606 — Setup's posture: the description under the title. const setup = useInSetupApp(); + // objectstack#35548 — the list page's 44px bar; Setup's posture outranks it. + const list = posture === 'list' && !setup; // objectui#12705 — the actions fold before the text is cut. const canFold = foldedActions != null && foldedActions !== false; @@ -235,16 +250,18 @@ export function PageHeader({ style={style} className={cn( 'relative shrink-0 border-b bg-background z-10', + list && 'h-11', sticky && 'sticky top-0 bg-background/85 backdrop-blur supports-[backdrop-filter]:bg-background/75', className, )} data-testid={testId ?? 'page-header'} - data-posture={setup ? 'setup' : 'row'} + data-posture={setup ? 'setup' : list ? 'list' : 'row'} > {/* Accent hairline — a 2px gradient strip that fades to transparent at both edges. Picks up the app's accent color, or the default primary - token. Decorative only. */} + token. Decorative only, and not on the list bar. */} + {!list && (
+ )} - {setup ? ( + {list ? ( +
+ {/* One line at 13px: the object's icon in one colour (the object + model carries no colour, objectstack#35547), its name, its kind. */} +
+ {icon && ( + + {icon} + + )} +

+ {title} +

+ {badge} +
+ {trailing} +
+ ) : setup ? (
{icon && {icon}} diff --git a/ui/packages/app-shell/src/views/ObjectView.tsx b/ui/packages/app-shell/src/views/ObjectView.tsx index f8619621c3a..67e8634ed21 100644 --- a/ui/packages/app-shell/src/views/ObjectView.tsx +++ b/ui/packages/app-shell/src/views/ObjectView.tsx @@ -74,7 +74,7 @@ import { loadViewOverrides, buildViewTabs, } from './objectViewTabs.js'; -import { ObjectNotFoundState, useViewTabsFit } from './objectViewChrome.js'; +import { ObjectNotFoundState } from './objectViewChrome.js'; import { useObjectViewLiveData } from './objectViewLiveData.js'; import { useObjectViewIdentity } from './objectViewIdentity.js'; import { useObjectViewRecordNavigation } from './objectViewRecordNavigation.js'; @@ -976,9 +976,6 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co // objectstack#27058 — on a phone the record is always a page: a row tap // navigates to it, and no pane is mounted beside or over the list. const phone = usePhoneViewport(); - // Below `sm` the page header, and the switcher in its title, is not drawn: - // the switcher leads the list's toolbar row instead (objectstack#27058). - const pageHeaderShown = useViewTabsFit(); const { listRecordActions, navOverlay, handleDrawerClose, handleRowClick, handleOpenAsPage, handleOpenRowAsPage, drawerRoot, drawerRestore, handleListRowsChange, handleRootStep, listLabel } = useObjectViewRecordNavigation({ activeView, objectDef, @@ -1033,7 +1030,7 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co // objectstack#27594: the list title is the view switcher, which replaced the // view tab strip; the view items `ManageViewsDialog` lists come with it. - const { viewTabItems, titleSwitcher, titleLabel } = useObjectViewTitleSwitcher({ + const { viewTabItems, titleSwitcher } = useObjectViewTitleSwitcher({ views, savedViews, objectDef, @@ -1095,8 +1092,11 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co // objectstack#33317 — the resolved mode: `none` for an authored // `none` and for a list-only object (`servesRecordRead`). rowOpensRecord: navOverlay.mode !== 'none', - phoneTitle: !pageHeaderShown && titleSwitcher ? ( - + // objectstack#35548 — the view switcher leads the list's view bar at + // every width (on a phone since objectstack#27058); the page bar only + // names the object. + phoneTitle: titleSwitcher ? ( + {titleSwitcher} {personalizedMarker} @@ -1211,11 +1211,6 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co {/* objectstack#25992 slice 10: the header moved to `./objectViewPageHeader.tsx`. */}