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..116d9ebed45 --- /dev/null +++ b/.changeset/34596-phone-home-checklist-top-bar.md @@ -0,0 +1,16 @@ +--- +'@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, and the top bar's badge and title fit + +Clause-②: yes (widening) +Metadata-protocol: none + +**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/apps/console/src/App.tsx b/ui/apps/console/src/App.tsx index a2e2f16f628..91e775e87cf 100644 --- a/ui/apps/console/src/App.tsx +++ b/ui/apps/console/src/App.tsx @@ -44,7 +44,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'; @@ -191,19 +191,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..0daa27a550a 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/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/HomePage.tsx b/ui/packages/app-shell/src/console/home/HomePage.tsx index 51382b130a5..3f7245562ca 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 */ @@ -41,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, @@ -347,10 +354,25 @@ 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() { +export function HomePage({ checklist }: HomePageProps = {}) { const navigate = useNavigate(); // objectstack#34608 — the Home AI buttons open the same right-side drawer // every console page has (in place, no navigation). @@ -360,6 +382,8 @@ export function HomePage() { 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(); @@ -580,6 +604,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')} @@ -667,6 +692,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. */} @@ -843,6 +870,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. */} ({ 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". */ @@ -251,3 +255,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(); + }); +}); diff --git a/ui/packages/app-shell/src/layout/AppHeader.tsx b/ui/packages/app-shell/src/layout/AppHeader.tsx index 7ae1e2b915c..699412eb12f 100644 --- a/ui/packages/app-shell/src/layout/AppHeader.tsx +++ b/ui/packages/app-shell/src/layout/AppHeader.tsx @@ -1017,8 +1017,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} @@ -1036,10 +1038,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/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__/AppHeader.centeredSearch-12472.test.tsx b/ui/packages/app-shell/src/layout/__tests__/AppHeader.centeredSearch-12472.test.tsx index 701d37ae5ca..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 @@ -348,3 +348,33 @@ 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', + ]), + ); + }); + + 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); + }); +}); 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'])); + }); +}); diff --git a/ui/packages/i18n/src/locales/ar.ts b/ui/packages/i18n/src/locales/ar.ts index 14e8264378e..470a903bd6e 100644 --- a/ui/packages/i18n/src/locales/ar.ts +++ b/ui/packages/i18n/src/locales/ar.ts @@ -2576,6 +2576,7 @@ const ar = { view: "عرض", confirm: "تأكيد", cancel: "إلغاء", + continue: "متابعة", prefilled: "القيم التي لم تُعيَّن بعد مقترحة من متصفحك. لن يُحفظ شيء حتى تؤكد.", organizationName: { title: "سمِّ مؤسستك", diff --git a/ui/packages/i18n/src/locales/de.ts b/ui/packages/i18n/src/locales/de.ts index f604a8fac6b..fd1be053525 100644 --- a/ui/packages/i18n/src/locales/de.ts +++ b/ui/packages/i18n/src/locales/de.ts @@ -2321,6 +2321,7 @@ const de = { view: "Anzeigen", confirm: "Bestätigen", cancel: "Abbrechen", + continue: "Fortsetzen", prefilled: "Noch nicht festgelegte Werte sind aus Ihrem Browser vorgeschlagen. Gespeichert wird erst, wenn Sie bestätigen.", organizationName: { title: "Organisation benennen", diff --git a/ui/packages/i18n/src/locales/en.ts b/ui/packages/i18n/src/locales/en.ts index 25e05c549c3..6801cd0d2e7 100644 --- a/ui/packages/i18n/src/locales/en.ts +++ b/ui/packages/i18n/src/locales/en.ts @@ -2499,6 +2499,8 @@ const en = { view: 'View', confirm: 'Confirm', cancel: 'Cancel', + // The folded card's way back in, on a phone (objectstack#34596). + continue: 'Continue', prefilled: 'Values not set yet are suggested from your browser. Nothing is saved until you confirm.', organizationName: { title: 'Name your organization', diff --git a/ui/packages/i18n/src/locales/es.ts b/ui/packages/i18n/src/locales/es.ts index fa44edef6ef..d0080c13fea 100644 --- a/ui/packages/i18n/src/locales/es.ts +++ b/ui/packages/i18n/src/locales/es.ts @@ -2387,6 +2387,7 @@ const es = { view: "Ver", confirm: "Confirmar", cancel: "Cancelar", + continue: "Continuar", prefilled: "Los valores aún sin configurar se sugieren a partir de su navegador. No se guarda nada hasta que confirme.", organizationName: { title: "Asigne un nombre a su organización", diff --git a/ui/packages/i18n/src/locales/fr.ts b/ui/packages/i18n/src/locales/fr.ts index 22e19d2fb38..7cd1a254ddb 100644 --- a/ui/packages/i18n/src/locales/fr.ts +++ b/ui/packages/i18n/src/locales/fr.ts @@ -2383,6 +2383,7 @@ const fr = { view: "Voir", confirm: "Confirmer", cancel: "Annuler", + continue: "Continuer", prefilled: "Les valeurs non encore définies sont suggérées d’après votre navigateur. Rien n’est enregistré avant votre confirmation.", organizationName: { title: "Nommez votre organisation", diff --git a/ui/packages/i18n/src/locales/ja.ts b/ui/packages/i18n/src/locales/ja.ts index 2026abe91c1..4a13615af61 100644 --- a/ui/packages/i18n/src/locales/ja.ts +++ b/ui/packages/i18n/src/locales/ja.ts @@ -2323,6 +2323,7 @@ const ja = { view: "表示", confirm: "確定", cancel: "キャンセル", + continue: "続ける", prefilled: "未設定の項目にはブラウザーから推測した値が入っています。確定するまで何も保存されません。", organizationName: { title: "組織に名前を付ける", diff --git a/ui/packages/i18n/src/locales/ko.ts b/ui/packages/i18n/src/locales/ko.ts index c758663835d..873c95f25bf 100644 --- a/ui/packages/i18n/src/locales/ko.ts +++ b/ui/packages/i18n/src/locales/ko.ts @@ -2321,6 +2321,7 @@ const ko = { view: "보기", confirm: "확인", cancel: "취소", + continue: "계속", prefilled: "아직 설정되지 않은 값은 브라우저를 기준으로 제안되었습니다. 확인하기 전에는 아무것도 저장되지 않습니다.", organizationName: { title: "조직 이름 정하기", diff --git a/ui/packages/i18n/src/locales/pt-BR.ts b/ui/packages/i18n/src/locales/pt-BR.ts index eafacbd05da..06487b53c28 100644 --- a/ui/packages/i18n/src/locales/pt-BR.ts +++ b/ui/packages/i18n/src/locales/pt-BR.ts @@ -2382,6 +2382,7 @@ const pt = { view: "Ver", confirm: "Confirmar", cancel: "Cancelar", + continue: "Continuar", prefilled: "Os valores ainda não definidos foram sugeridos com base no seu navegador. Nada é salvo até você confirmar.", organizationName: { title: "Dê um nome à sua organização", diff --git a/ui/packages/i18n/src/locales/ru.ts b/ui/packages/i18n/src/locales/ru.ts index 1ccda1f28c8..38f51e5f9d4 100644 --- a/ui/packages/i18n/src/locales/ru.ts +++ b/ui/packages/i18n/src/locales/ru.ts @@ -2455,6 +2455,7 @@ const ru = { view: "Открыть", confirm: "Подтвердить", cancel: "Отмена", + continue: "Продолжить", prefilled: "Для ещё не заданных значений предложены значения из вашего браузера. Ничего не сохраняется, пока вы не подтвердите.", organizationName: { title: "Назовите организацию", diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts index 17b0587c397..1235a5d9cb4 100644 --- a/ui/packages/i18n/src/locales/zh-Hans.ts +++ b/ui/packages/i18n/src/locales/zh-Hans.ts @@ -2071,6 +2071,7 @@ const zh = { view: '查看', confirm: '确认', cancel: '取消', + continue: '继续', prefilled: '尚未设置的项已按你的浏览器给出建议。确认之前不会保存任何内容。', organizationName: { title: '为组织命名', diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts index cad3eb9f6cc..742c5dfa4d6 100644 --- a/ui/packages/i18n/src/locales/zh-Hant.ts +++ b/ui/packages/i18n/src/locales/zh-Hant.ts @@ -2071,6 +2071,7 @@ const zhHant = { view: '檢視', confirm: '確認', cancel: '取消', + continue: '繼續', prefilled: '尚未設定的項已按你的瀏覽器給出建議。確認之前不會儲存任何內容。', organizationName: { title: '為組織命名',