From 40fb58dede0ff43d41ff15a713667e1cac83bc18 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 06:15:07 +0000 Subject: [PATCH 1/9] feat(console): phone Home folds the first-run checklist to one line after the apps Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz --- ui/apps/console/src/App.tsx | 19 +- .../src/pages/settings/FirstRunChecklist.tsx | 172 +++++++++++++----- .../app-shell/src/console/home/HomePage.tsx | 33 +++- ui/packages/i18n/src/locales/ar.ts | 1 + ui/packages/i18n/src/locales/de.ts | 1 + ui/packages/i18n/src/locales/en.ts | 2 + ui/packages/i18n/src/locales/es.ts | 1 + ui/packages/i18n/src/locales/fr.ts | 1 + ui/packages/i18n/src/locales/ja.ts | 1 + ui/packages/i18n/src/locales/ko.ts | 1 + ui/packages/i18n/src/locales/pt-BR.ts | 1 + ui/packages/i18n/src/locales/ru.ts | 1 + ui/packages/i18n/src/locales/zh-Hans.ts | 1 + ui/packages/i18n/src/locales/zh-Hant.ts | 1 + 14 files changed, 178 insertions(+), 58 deletions(-) diff --git a/ui/apps/console/src/App.tsx b/ui/apps/console/src/App.tsx index 133bc9c175f..e35b11e0f06 100644 --- a/ui/apps/console/src/App.tsx +++ b/ui/apps/console/src/App.tsx @@ -43,7 +43,7 @@ import { } from '@object-ui/app-shell'; import { AppContent, ConsolePermissionsRequest, ConsolePermissionsScope } from './AppContent'; -import { FirstRunChecklist } from './pages/settings/FirstRunChecklist'; +import { FirstRunChecklist, type FirstRunChecklistPlacement } from './pages/settings/FirstRunChecklist'; import { publishAuthState } from './i18nSession'; import { FaviconSync } from './components/FaviconSync'; import { RootLandingRedirect } from './components/RootLandingRedirect'; @@ -198,19 +198,24 @@ function NativeShellRouting() { return null; } +/** Home's checklist slot: the first-run checklist, where Home places it. */ +function homeChecklist(placement: FirstRunChecklistPlacement) { + return ; +} + /** * Wraps `DefaultHomeLayout` so the FAB gets the signed-in user id, and draws - * an administrator's first-run checklist above the page's own sections - * (objectstack#30206). The route sits under `ConsolePermissionsScope`, which - * is what tells the checklist whether this session may write the settings it - * lists; for anyone else it draws nothing. + * an administrator's first-run checklist in Home's checklist slot + * (objectstack#30206): above the page's own sections on a desktop, after the + * apps on a phone (objectstack#34596). The route sits under + * `ConsolePermissionsScope`, which is what tells the checklist whether this + * session may write the settings it lists; for anyone else it draws nothing. */ function HomeRoute() { const { user } = useAuth(); return ( - - + ); } diff --git a/ui/apps/console/src/pages/settings/FirstRunChecklist.tsx b/ui/apps/console/src/pages/settings/FirstRunChecklist.tsx index c4f7a6c6ac2..87710f946b4 100644 --- a/ui/apps/console/src/pages/settings/FirstRunChecklist.tsx +++ b/ui/apps/console/src/pages/settings/FirstRunChecklist.tsx @@ -10,13 +10,23 @@ * * ## Where it is drawn * - * Home (`/home`), above the page's own sections. Home is the environment's own - * home (ObjectUI ADR-0075): every deployment that declares no landing app opens + * Home (`/home`), in the slot Home's page gives its host's checklist + * (app-shell's `HomePage`, `checklist`). Home is the environment's own home + * (ObjectUI ADR-0075): every deployment that declares no landing app opens * there after sign-in, the Setup-only one included (`RootLandingRedirect`). * Mounted by the console's Home route (`App.tsx`), inside the * `ConsolePermissionsScope` that route already sits under: that provider is * what answers which capabilities this session holds. * + * Home names the placement (`placement`). `top`, above the page's sections + * (a desktop, or a page with no app yet), draws the card as it always was. + * `afterApps` is a phone's: the card sits in the content column after the + * apps and starts folded to one line, its title, its progress and Continue, + * so the first screen keeps the launcher (objectstack#34596). Continue opens + * the card in place, and a fold control closes it again; like the done rows' + * fold, this is the mount's own state and a fresh visit starts folded. + * Folding changes no row and no completion rule. + * * ## Who sees it, and what each row says * * An administrator: a session that may write `localization` @@ -110,7 +120,7 @@ import { useEffect, useState, type ReactNode } from 'react'; import { Link } from 'react-router-dom'; import { toast } from 'sonner'; -import { CheckCircle2, ChevronDown, ChevronUp, Circle, Loader2, X } from 'lucide-react'; +import { CheckCircle2, ChevronDown, ChevronRight, ChevronUp, Circle, Loader2, X } from 'lucide-react'; import { Button, cn } from '@object-ui/components'; import { appRouteSegment, @@ -444,7 +454,13 @@ function SettingsRowEditor({ ); } -export function FirstRunChecklist() { +/** + * Where Home draws the checklist: app-shell's `HomeChecklistPlacement`, by + * value (see the module doc). + */ +export type FirstRunChecklistPlacement = 'top' | 'afterApps'; + +export function FirstRunChecklist({ placement = 'top' }: { placement?: FirstRunChecklistPlacement } = {}) { const { t, language } = useObjectTranslation(); const { user, activeOrganization, getMembers, listInvitations, getAuthConfig } = useAuth(); const { systemPermissions } = usePermissions(); @@ -459,6 +475,9 @@ export function FirstRunChecklist() { const [editing, setEditing] = useState(null); // Whether the rows that are done are drawn; folded on every visit. const [showDone, setShowDone] = useState(false); + // A phone's card starts folded to one line; folded on every visit. + const foldable = placement === 'afterApps'; + const [unfolded, setUnfolded] = useState(false); // The browser's answers are read once per mount: what the rows offer does not // change under the administrator while they look at it. const [browser] = useState(readBrowserAnswers); @@ -847,61 +866,114 @@ export function FirstRunChecklist() { setHiddenKey(recordKey); }; - return ( -
+ const progress = t('console.firstRunChecklist.progress', { done: completion.done, total: completion.total }); + + if (foldable && !unfolded) { + return (
-
-
-

- {t('console.firstRunChecklist.title')} -

-

{t('console.firstRunChecklist.description')}

-
-
- - {t('console.firstRunChecklist.progress', { done: completion.done, total: completion.total })} - - -
+

+ + {t('console.firstRunChecklist.title')} + + + {progress} + +

+ +
+ ); + } + + const card = ( +
+
+
+

+ {t('console.firstRunChecklist.title')} +

+

{t('console.firstRunChecklist.description')}

-
    - {drawn.filter((row) => showDone || !row.done).map((row) => row.node)} -
- {doneCount > 0 ? ( -
+
+ + {progress} + + {foldable ? ( -
- ) : null} -
-
+ ) : null} + + + +
    + {drawn.filter((row) => showDone || !row.done).map((row) => row.node)} +
+ {doneCount > 0 ? ( +
+ +
+ ) : null} + ); + + // In the content column (a phone's placement) the column gives the width + // and the gutters; above the page the card brings its own. + return foldable ? card :
{card}
; } diff --git a/ui/packages/app-shell/src/console/home/HomePage.tsx b/ui/packages/app-shell/src/console/home/HomePage.tsx index a6d7a220d97..53fb03493ba 100644 --- a/ui/packages/app-shell/src/console/home/HomePage.tsx +++ b/ui/packages/app-shell/src/console/home/HomePage.tsx @@ -12,6 +12,12 @@ * - Responsive grid layout * - i18n support * + * The host's checklist slot (`checklist`, objectstack#34596): on a desktop it + * is drawn above the page's sections; on a phone (`usePhoneViewport`, below + * 768 px) it is drawn after the apps, so the first screen keeps the launcher. + * With no app yet it is drawn above the empty state at every width, and while + * the page is loading it is not drawn, so it mounts once, where it stays. + * * @module */ @@ -69,6 +75,22 @@ import { fetchPackages } from '../../views/studio-design/packages-io.js'; import { resolveAiApiBase } from '../../hooks/useAiSurface.js'; import { isAiStudioEnabled, isMarketplaceEnabled } from '../../runtime-config.js'; import { STUDIO_NEW_PACKAGE_PATH } from '../../views/studio-design/studioNewPackage.js'; +import { usePhoneViewport } from '../../hooks/usePhoneViewport.js'; + +/** + * Where Home draws its host's checklist: `top`, above the page's sections (a + * desktop, or a page with no app yet), or `afterApps`, in the content column + * right after the apps (a phone). + */ +export type HomeChecklistPlacement = 'top' | 'afterApps'; + +export interface HomePageProps { + /** + * The host's checklist, drawn where Home places it (see the module doc). + * Called on each render with the placement; it may draw nothing. + */ + checklist?: (placement: HomeChecklistPlacement) => React.ReactNode; +} /** * Which AI home CTAs to surface, driven by the live agent catalog (the single @@ -348,8 +370,10 @@ function usePendingDraftsRow(t: (key: string, opts?: any) => string, language: s /** Home's labels read each object they name by name (objectstack#29121). */ const BY_NAME: NavTargetLabelOptions = { byName: true }; -export function HomePage() { +export function HomePage({ checklist }: HomePageProps = {}) { const navigate = useNavigate(); + // Phone or desktop decides where the checklist is mounted (module doc). + const phone = usePhoneViewport(); const { t, language } = useObjectTranslation(); const metadata = useMetadata(); const { apps, loading } = metadata; @@ -574,6 +598,7 @@ export function HomePage() { {/* objectstack#30120 — administrators, production only: what this server keeps on its own disk. Above the recovery nudge, which is one person's; this is the deployment's. */} + {checklist?.('top')} @@ -661,6 +686,8 @@ export function HomePage() { return (
+ {/* The host's checklist, above the page on a desktop (module doc). */} + {!phone && checklist?.('top')} {/* objectstack#30120 — see the empty-state branch above. */} @@ -837,6 +864,10 @@ export function HomePage() { marketplaceEnabled={marketplaceEnabled} /> + {/* On a phone the host's checklist comes after the apps, so the + first screen keeps them (objectstack#34596). */} + {phone && checklist?.('afterApps')} + {/* My work (objectui#12602) — approvals, then unread notifications, with the pending-drafts row under its heading. */} Date: Tue, 17 Nov 2026 06:16:19 +0000 Subject: [PATCH 2/9] refactor(app-shell): keep the Home checklist slot's lines apart from neighbouring edits Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz --- .../app-shell/src/console/home/HomePage.tsx | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ui/packages/app-shell/src/console/home/HomePage.tsx b/ui/packages/app-shell/src/console/home/HomePage.tsx index 53fb03493ba..137fb2d29da 100644 --- a/ui/packages/app-shell/src/console/home/HomePage.tsx +++ b/ui/packages/app-shell/src/console/home/HomePage.tsx @@ -47,6 +47,7 @@ import { HomeActionCenter, HomeContinue, HomeActivity, HomePendingDraftsRow, typ import { resolveI18nLabel } from '@objectstack/spec/ui'; import { useHomeInbox } from '../../hooks/useHomeInbox.js'; import { useLauncherApps } from '../../hooks/useLauncherApps.js'; +import { usePhoneViewport } from '../../hooks/usePhoneViewport.js'; import { useNavigationContext } from '../../context/NavigationContext.js'; import { appRouteSegment, @@ -75,22 +76,6 @@ import { fetchPackages } from '../../views/studio-design/packages-io.js'; import { resolveAiApiBase } from '../../hooks/useAiSurface.js'; import { isAiStudioEnabled, isMarketplaceEnabled } from '../../runtime-config.js'; import { STUDIO_NEW_PACKAGE_PATH } from '../../views/studio-design/studioNewPackage.js'; -import { usePhoneViewport } from '../../hooks/usePhoneViewport.js'; - -/** - * Where Home draws its host's checklist: `top`, above the page's sections (a - * desktop, or a page with no app yet), or `afterApps`, in the content column - * right after the apps (a phone). - */ -export type HomeChecklistPlacement = 'top' | 'afterApps'; - -export interface HomePageProps { - /** - * The host's checklist, drawn where Home places it (see the module doc). - * Called on each render with the placement; it may draw nothing. - */ - checklist?: (placement: HomeChecklistPlacement) => React.ReactNode; -} /** * Which AI home CTAs to surface, driven by the live agent catalog (the single @@ -367,17 +352,32 @@ function usePendingDraftsRow(t: (key: string, opts?: any) => string, language: s ); } +/** + * Where Home draws its host's checklist: `top`, above the page's sections (a + * desktop, or a page with no app yet), or `afterApps`, in the content column + * right after the apps (a phone). + */ +export type HomeChecklistPlacement = 'top' | 'afterApps'; + +export interface HomePageProps { + /** + * The host's checklist, drawn where Home places it (see the module doc). + * Called on each render with the placement; it may draw nothing. + */ + checklist?: (placement: HomeChecklistPlacement) => React.ReactNode; +} + /** Home's labels read each object they name by name (objectstack#29121). */ const BY_NAME: NavTargetLabelOptions = { byName: true }; export function HomePage({ checklist }: HomePageProps = {}) { const navigate = useNavigate(); - // Phone or desktop decides where the checklist is mounted (module doc). - const phone = usePhoneViewport(); const { t, language } = useObjectTranslation(); const metadata = useMetadata(); const { apps, loading } = metadata; const { recentItems } = useRecentItems(); + // Phone or desktop decides where the checklist is mounted (module doc). + const phone = usePhoneViewport(); // A recent entry stores identity; the rail labels it with this, on the // render, in the current language (objectui#11678). const recentLabel = useRecentItemLabel(); From 2b1cd18158dfb7a51e8d29dec03e1af159ea5795 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 07:00:47 +0000 Subject: [PATCH 3/9] test(console): pin the phone Home checklist slot and the folded one-line card Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz --- .../34596-phone-home-checklist-top-bar.md | 14 ++++ .../__tests__/FirstRunChecklist.test.tsx | 79 ++++++++++++++++++- .../HomePage.phoneTapTargets-29147.test.tsx | 59 ++++++++++++++ 3 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 .changeset/34596-phone-home-checklist-top-bar.md diff --git a/.changeset/34596-phone-home-checklist-top-bar.md b/.changeset/34596-phone-home-checklist-top-bar.md new file mode 100644 index 00000000000..1cb729b2036 --- /dev/null +++ b/.changeset/34596-phone-home-checklist-top-bar.md @@ -0,0 +1,14 @@ +--- +'@object-ui/app-shell': patch +'@object-ui/console': patch +'@object-ui/i18n': patch +--- + +feat(console): on a phone, Home keeps its first screen for the apps — the setup checklist folds to one line after them + +Clause-②: no +Metadata-protocol: none + +Below 768 px, Home draws the administrator's first-run checklist after the apps instead of above the greeting, folded to one line: its title, its progress (「已完成 2/5」, "2 of 5 done") and **Continue**. Continue opens the whole card in place; a fold control beside the progress closes it to one line again. A fresh visit starts folded. The rows, the progress count, the done rule and the close button are unchanged, and from 768 px up the card is drawn above the page as before. With no app yet the card stays above the empty state at every width. + +`HomePage` (`@object-ui/app-shell`) takes an optional `checklist(placement)` slot: Home calls it with `'top'` on a desktop or with no app, and with `'afterApps'` on a phone, and draws what it returns there. The console's Home route passes the first-run checklist through it. `@object-ui/i18n` adds `console.firstRunChecklist.continue` to every pack. diff --git a/ui/apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx b/ui/apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx index 1efbe7c7627..c2f7aa3797e 100644 --- a/ui/apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx +++ b/ui/apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx @@ -62,7 +62,7 @@ vi.mock('@object-ui/react', async (importOriginal) => ({ })); import { useHomeItemClaimed, type HomeItem } from '@object-ui/app-shell'; -import { FirstRunChecklist } from '../FirstRunChecklist'; +import { FirstRunChecklist, type FirstRunChecklistPlacement } from '../FirstRunChecklist'; import { __resetBootPainted } from '../../../loadLocales'; import type { Specifier } from '../types'; @@ -205,12 +205,16 @@ const ADMIN = ['setup.access', 'setup.write', 'manage_platform_settings']; const MEMBER = ['setup.access']; /** No default for `systemPermissions`: "not reported" must stay apart from the admin set. */ -function renderChecklist(systemPermissions: string[] | undefined, language = 'en') { +function renderChecklist( + systemPermissions: string[] | undefined, + language = 'en', + placement?: FirstRunChecklistPlacement, +) { return render( - + , @@ -1041,3 +1045,72 @@ describe('the host profile: a managed environment adds the first-app and first-r expect(within(await screen.findByTestId('first-run-checklist-row-first_record')).getByText('添加第一条记录')).toBeTruthy(); }); }); + +describe('on a phone, after the apps, the card starts folded to one line (objectstack#34596)', () => { + const card = () => screen.getByTestId('first-run-checklist'); + const progress = () => screen.getByTestId('first-run-checklist-progress').textContent; + + it('one line: the title, the progress and Continue; no row is drawn and nothing is written', async () => { + renderChecklist(ADMIN, 'en', 'afterApps'); + await waitFor(() => expect(progress()).toBe('0 of 5 done')); + expect(card().getAttribute('data-folded')).toBe('true'); + expect(within(card()).getByText('Get your system ready')).toBeTruthy(); + expect(within(card()).queryAllByRole('listitem')).toHaveLength(0); + const go = screen.getByTestId('first-run-checklist-continue'); + expect(go.textContent).toBe('Continue'); + expect(go.getAttribute('aria-expanded')).toBe('false'); + expect(screen.queryByTestId('first-run-checklist-dismiss')).toBeNull(); + expect(puts()).toHaveLength(0); + }); + + it('Continue opens the card in place with every row; the fold control closes it to one line again', async () => { + renderChecklist(ADMIN, 'en', 'afterApps'); + fireEvent.click(await screen.findByTestId('first-run-checklist-continue')); + expect(card().getAttribute('data-folded')).toBe('false'); + expect(await screen.findByTestId('first-run-checklist-row-invite')).toBeTruthy(); + const fold = screen.getByTestId('first-run-checklist-fold'); + expect(fold.getAttribute('aria-expanded')).toBe('true'); + expect(fold.getAttribute('aria-controls')).toBe(screen.getByRole('list').id); + expect(screen.getByTestId('first-run-checklist-dismiss')).toBeTruthy(); + expect(progress()).toBe('0 of 5 done'); + + fireEvent.click(fold); + expect(card().getAttribute('data-folded')).toBe('true'); + expect(screen.queryByTestId('first-run-checklist-row-invite')).toBeNull(); + expect(progress()).toBe('0 of 5 done'); + }); + + it('folding changes no completion rule: the folded line counts what the card counts, and a set workspace draws nothing', async () => { + localizationValues = { + locale: resolved('zh-CN', 'tenant'), + default_country: resolved('CN', 'tenant'), + timezone: resolved('Asia/Shanghai', 'tenant'), + currency: resolved('CNY', 'tenant'), + }; + renderChecklist(ADMIN, 'en', 'afterApps'); + await waitFor(() => expect(progress()).toBe('3 of 5 done')); + cleanup(); + + AUTH.activeOrganization = { id: 'org_1', name: 'Acme' }; + AUTH.getMembers.mockResolvedValue([{ id: 'm_1' }, { id: 'm_2' }]); + mailValues = { provider: resolved('smtp', 'global'), smtp_host: resolved('mx', 'global'), from_email: resolved('a@b.co', 'global') }; + renderChecklist(ADMIN, 'en', 'afterApps'); + await settle(); + await waitFor(() => expect(AUTH.getMembers).toHaveBeenCalled()); + await settle(); + expect(screen.queryByTestId('first-run-checklist')).toBeNull(); + }); + + it('zh: Continue reads in the reader language', async () => { + renderChecklist(ADMIN, 'zh', 'afterApps'); + expect((await screen.findByTestId('first-run-checklist-continue')).textContent).toBe('继续'); + }); + + it('CONTROL: above the page the card is drawn whole, with no Continue and no fold control', async () => { + renderChecklist(ADMIN, 'en', 'top'); + expect(await screen.findByTestId('first-run-checklist-row-invite')).toBeTruthy(); + expect(card().getAttribute('data-folded')).toBeNull(); + expect(screen.queryByTestId('first-run-checklist-continue')).toBeNull(); + expect(screen.queryByTestId('first-run-checklist-fold')).toBeNull(); + }); +}); diff --git a/ui/packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx b/ui/packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx index 69d3c2c6814..d450403b940 100644 --- a/ui/packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx +++ b/ui/packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx @@ -251,3 +251,62 @@ describe('"Recently accessed" and the activity feed (objectstack#29147)', () => expectPhoneTarget(screen.getByTestId('home-activity-view-all'), ['inline-flex', 'items-center'], ['max-sm:min-h-11']); }); }); + +describe('the host checklist slot: above the page on a desktop, after the apps on a phone (objectstack#34596)', () => { + const realWidth = window.innerWidth; + function atWidth(width: number) { + Object.defineProperty(window, 'innerWidth', { value: width, configurable: true, writable: true }); + } + afterEach(() => atWidth(realWidth)); + + /** Records each placement Home asks for and draws a marker there. */ + function slot() { + const placements: string[] = []; + const checklist = (placement: string) => { + placements.push(placement); + return
; + }; + return { placements, checklist }; + } + const follows = (a: HTMLElement, b: HTMLElement) => + Boolean(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_FOLLOWING); + + it('1024 px: drawn once, above the greeting and the apps; never after them', () => { + atWidth(1024); + const { placements, checklist } = slot(); + render(); + const marker = screen.getByTestId('checklist-slot-top'); + expect(screen.queryByTestId('checklist-slot-afterApps')).toBeNull(); + expect(new Set(placements)).toEqual(new Set(['top'])); + expect(follows(screen.getByTestId('home-work-summary'), marker)).toBe(true); + expect(follows(screen.getByTestId('home-apps-count'), marker)).toBe(true); + }); + + it('375 px: drawn once, after the apps and before "My work"; never above them', () => { + atWidth(375); + const { placements, checklist } = slot(); + render(); + const marker = screen.getByTestId('checklist-slot-afterApps'); + expect(screen.queryByTestId('checklist-slot-top')).toBeNull(); + expect(new Set(placements)).toEqual(new Set(['afterApps'])); + expect(follows(marker, screen.getByTestId('app-tile-app_0'))).toBe(true); + expect(follows(screen.getByTestId('home-my-work-open-inbox'), marker)).toBe(true); + }); + + it('375 px with no app yet: there are no apps to keep, so it is drawn above the empty state', () => { + atWidth(375); + state.apps = []; + const { placements, checklist } = slot(); + render(); + expect(screen.getByTestId('checklist-slot-top')).toBeInTheDocument(); + expect(new Set(placements)).toEqual(new Set(['top'])); + }); + + it('CONTROL: with no slot given the page draws as it did', () => { + atWidth(375); + render(); + expect(screen.queryByTestId('checklist-slot-top')).toBeNull(); + expect(screen.queryByTestId('checklist-slot-afterApps')).toBeNull(); + expect(screen.getByTestId('home-apps-count')).toBeInTheDocument(); + }); +}); From d65b87609169a5be1dd944098ea6a90d08e05894 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 07:07:02 +0000 Subject: [PATCH 4/9] feat(app-shell): the phone top bar draws no group dividers, so the page title keeps the room Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz --- .../app-shell/src/layout/AppHeader.tsx | 6 ++++-- .../AppHeader.centeredSearch-12472.test.tsx | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ui/packages/app-shell/src/layout/AppHeader.tsx b/ui/packages/app-shell/src/layout/AppHeader.tsx index 58464aba442..a48fa0d5ec1 100644 --- a/ui/packages/app-shell/src/layout/AppHeader.tsx +++ b/ui/packages/app-shell/src/layout/AppHeader.tsx @@ -1015,10 +1015,12 @@ export function AppHeader({ With the search centered, the search group here holds only the icon button and leaves at 960 px; the three `min-[960px]:` rules keyed on `data-topbar-search` keep the group after it from drawing a divider - next to nothing. */} + next to nothing. Below `sm` the groups draw no divider and no gap + beyond the cluster's own: the phone bar's 44 px controls sit side by + side and the room goes to the page title (objectstack#34596). */}
*+*[data-topbar-group]]:ml-1 [&>[data-topbar-group]+[data-topbar-group]]:border-l [&>[data-topbar-group]+[data-topbar-group]]:border-border/60 [&>[data-topbar-group]+[data-topbar-group]]:pl-1 sm:[&>[data-topbar-group]+[data-topbar-group]]:pl-2 sm:[&>[data-topbar-group]+[data-topbar-group]]:ml-2', + 'flex items-center gap-0.5 sm:gap-1 shrink-0 sm:[&>*+*[data-topbar-group]]:ml-1 sm:[&>[data-topbar-group]+[data-topbar-group]]:border-l sm:[&>[data-topbar-group]+[data-topbar-group]]:border-border/60 sm:[&>[data-topbar-group]+[data-topbar-group]]:pl-2 sm:[&>[data-topbar-group]+[data-topbar-group]]:ml-2', centersSearch && 'min-[960px]:flex-1 min-[960px]:min-w-max min-[960px]:justify-end min-[960px]:[&>[data-topbar-search]+[data-topbar-group]]:ml-1 min-[960px]:[&>[data-topbar-search]+[data-topbar-group]]:border-l-0 min-[960px]:[&>[data-topbar-search]+[data-topbar-group]]:pl-0', )} diff --git a/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx b/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx index 701d37ae5ca..e2d0f8b7c9a 100644 --- a/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx +++ b/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx @@ -348,3 +348,24 @@ describe('CONTROLS (objectui#12472)', () => { expect(document.querySelector('[data-topbar-zone]')).toBeNull(); }); }); + +describe('the phone bar spends no room on group dividers (objectstack#34596)', () => { + it('below sm the cluster draws no divider and no gap between its groups; from sm each group after the first draws one', () => { + mount(); + const classes = classesOf(clusterOf()); + // Every divider rule is `sm:`-scoped, so the phone bar's 44 px controls sit + // side by side and the page title keeps the width. + const dividerRules = classes.filter((c) => /topbar-group\]\]?:(border-l|border-border|pl-|ml-)/.test(c)); + expect(dividerRules.length).toBeGreaterThan(0); + for (const c of dividerRules) { + expect(c.startsWith('sm:') || c.startsWith('min-[960px]:'), `${c} is phone-scoped`).toBe(true); + } + expect(classes).toEqual( + expect.arrayContaining([ + 'sm:[&>[data-topbar-group]+[data-topbar-group]]:border-l', + 'sm:[&>[data-topbar-group]+[data-topbar-group]]:pl-2', + 'sm:[&>[data-topbar-group]+[data-topbar-group]]:ml-2', + ]), + ); + }); +}); From f61d7e2b558c2915e36e8bc85e31c6c0875dfd84 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 07:07:44 +0000 Subject: [PATCH 5/9] feat(app-shell): the bell badge sits inside the phone bar's 44 px target Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz --- ui/packages/app-shell/src/layout/InboxPopover.tsx | 5 ++++- .../InboxPopover.phoneWidth-29076.test.tsx | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ui/packages/app-shell/src/layout/InboxPopover.tsx b/ui/packages/app-shell/src/layout/InboxPopover.tsx index f9b18dfe6dd..39653ee0526 100644 --- a/ui/packages/app-shell/src/layout/InboxPopover.tsx +++ b/ui/packages/app-shell/src/layout/InboxPopover.tsx @@ -507,7 +507,10 @@ export function InboxPopover({ {totalBadge > 9 ? '9+' : totalBadge} diff --git a/ui/packages/app-shell/src/layout/__tests__/InboxPopover.phoneWidth-29076.test.tsx b/ui/packages/app-shell/src/layout/__tests__/InboxPopover.phoneWidth-29076.test.tsx index b9bfaf1e924..10fca7732b4 100644 --- a/ui/packages/app-shell/src/layout/__tests__/InboxPopover.phoneWidth-29076.test.tsx +++ b/ui/packages/app-shell/src/layout/__tests__/InboxPopover.phoneWidth-29076.test.tsx @@ -121,3 +121,17 @@ describe('InboxPopover at phone width (objectstack#29076)', () => { expect(within(dialog).getByRole('button', { name: 'View all activity' }).className).toContain(PHONE_TAP); }); }); + +describe('the bell badge stays inside the phone bar (objectstack#34596)', () => { + it('below md the badge sits inside the 44 px trigger, at its corner; from md it keeps its desktop offset', () => { + render(bell(9)); + const badge = screen.getByTestId('inbox-bell-badge'); + // Two unread topics and nine approvals: past nine, the clamped label. + expect(badge.textContent).toBe('9+'); + const classes = badge.className.split(/\s+/); + expect(classes).toEqual(expect.arrayContaining(['max-md:top-1', 'max-md:right-1', '-top-0.5', '-right-0.5'])); + const trigger = screen.getByRole('button', { name: /^Notifications(,|$)/ }); + expect(trigger).toContainElement(badge); + expect(trigger.className.split(/\s+/)).toEqual(expect.arrayContaining(['relative', 'max-md:size-11'])); + }); +}); From b661a231cbc4b995b05fa6513e4dcc5b023b0e27 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 07:23:14 +0000 Subject: [PATCH 6/9] feat(app-shell): the phone bar's page title takes the pill-side margin as width Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz --- ui/packages/app-shell/src/layout/AppHeader.tsx | 6 ++++-- .../__tests__/AppHeader.centeredSearch-12472.test.tsx | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ui/packages/app-shell/src/layout/AppHeader.tsx b/ui/packages/app-shell/src/layout/AppHeader.tsx index 3b1e0143899..6512c4ae150 100644 --- a/ui/packages/app-shell/src/layout/AppHeader.tsx +++ b/ui/packages/app-shell/src/layout/AppHeader.tsx @@ -1016,8 +1016,10 @@ export function AppHeader({ {/* Mobile: the current page's label. A list's view switcher is the list's own title, drawn in its toolbar row on a phone - (objectstack#27058), so the bar draws no view dropdown. */} - + (objectstack#27058), so the bar draws no view dropdown. No + margin of its own: the pill's padding already parts the two, + and the width goes to the label (objectstack#34596). */} + {lastSegmentLabel} diff --git a/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx b/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx index e2d0f8b7c9a..72b05e1d3bc 100644 --- a/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx +++ b/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx @@ -368,4 +368,13 @@ describe('the phone bar spends no room on group dividers (objectstack#34596)', ( ]), ); }); + + it('the phone title takes no margin of its own beside the pill, and truncates only past the room left', () => { + mount(); + const title = screen.getByTestId('app-bar-phone-title'); + const classes = classesOf(title); + expect(classes).toEqual(expect.arrayContaining(['sm:hidden', 'truncate', 'min-w-0'])); + expect(classes.filter((c) => /^m[lrx]?-/.test(c))).toEqual([]); + expect(leftOf()).toContainElement(title); + }); }); From e000813374e27eb3b2c0fb4c09d7c7a85b3f8b20 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 07:51:30 +0000 Subject: [PATCH 7/9] test(app-shell): pay the Home harness's lint load at collection; changeset names the phone bar Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz --- .changeset/34596-phone-home-checklist-top-bar.md | 6 ++++-- .../home/__tests__/HomePage.phoneTapTargets-29147.test.tsx | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.changeset/34596-phone-home-checklist-top-bar.md b/.changeset/34596-phone-home-checklist-top-bar.md index 1cb729b2036..9988c92754d 100644 --- a/.changeset/34596-phone-home-checklist-top-bar.md +++ b/.changeset/34596-phone-home-checklist-top-bar.md @@ -4,11 +4,13 @@ '@object-ui/i18n': patch --- -feat(console): on a phone, Home keeps its first screen for the apps — the setup checklist folds to one line after them +feat(console): on a phone, Home keeps its first screen for the apps, and the top bar's badge and title fit Clause-②: no Metadata-protocol: none -Below 768 px, Home draws the administrator's first-run checklist after the apps instead of above the greeting, folded to one line: its title, its progress (「已完成 2/5」, "2 of 5 done") and **Continue**. Continue opens the whole card in place; a fold control beside the progress closes it to one line again. A fresh visit starts folded. The rows, the progress count, the done rule and the close button are unchanged, and from 768 px up the card is drawn above the page as before. With no app yet the card stays above the empty state at every width. +**Home's setup checklist.** Below 768 px, Home draws the administrator's first-run checklist after the apps instead of above the greeting, folded to one line: its title, its progress ("2 of 5 done") and **Continue**. Continue opens the whole card in place; a fold control beside the progress closes it to one line again. A fresh visit starts folded. The rows, the progress count, the done rule and the close button are unchanged, and from 768 px up the card is drawn above the page as before. With no app yet the card stays above the empty state at every width. `HomePage` (`@object-ui/app-shell`) takes an optional `checklist(placement)` slot: Home calls it with `'top'` on a desktop or with no app, and with `'afterApps'` on a phone, and draws what it returns there. The console's Home route passes the first-run checklist through it. `@object-ui/i18n` adds `console.firstRunChecklist.continue` to every pack. + +**The phone top bar.** Below 768 px the bell's unread badge ("9+") sits inside the bell's 44 px target, on the glyph's corner, instead of 2 px above it, where the bar's top edge cut it. Below 640 px the bar's control groups draw no divider and no extra gap, and the page title beside the app pill takes no margin of its own, so the title keeps that width. The controls the bar shows are unchanged: search, the bell, the AI assistant (where the server serves AI) and the account menu. diff --git a/ui/packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx b/ui/packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx index d450403b940..bed235a0bc3 100644 --- a/ui/packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx +++ b/ui/packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx @@ -139,6 +139,10 @@ vi.mock('../../../layout/ActivityObjectLabel', () => ({ ActivityObjectLabel: () // like every other source this page reads. vi.mock('../../deployment-notice/DeploymentNotice', () => ({ DeploymentNotice: () => null })); +// The page reaches `capabilityLint`'s dynamic `@objectstack/lint` import; its +// first load is paid here, at collection, never inside a case's clock +// (`check:test-source-alias`). +import '@objectstack/lint'; import { HomePage } from '../HomePage'; /** Enough apps that the strip folds the rest behind "More". */ From e78e39f488ba348801b42ed47176ecd1457cb642 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 08:07:23 +0000 Subject: [PATCH 8/9] feat(console): the folded checklist line fits its title, progress and Continue at 375 px Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz --- ui/apps/console/src/pages/settings/FirstRunChecklist.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/apps/console/src/pages/settings/FirstRunChecklist.tsx b/ui/apps/console/src/pages/settings/FirstRunChecklist.tsx index 87710f946b4..0daa27a550a 100644 --- a/ui/apps/console/src/pages/settings/FirstRunChecklist.tsx +++ b/ui/apps/console/src/pages/settings/FirstRunChecklist.tsx @@ -871,13 +871,13 @@ export function FirstRunChecklist({ placement = 'top' }: { placement?: FirstRunC if (foldable && !unfolded) { return (

- + {t('console.firstRunChecklist.title')} @@ -887,7 +887,7 @@ export function FirstRunChecklist({ placement = 'top' }: { placement?: FirstRunC