You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4db3750
Browse filesBrowse the repository at this point in the historyBrowse files
feat(console): phone Home folds the setup checklist to one line after the apps; the phone bar's badge and title fit (#34723)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBXim82sEGBUBXqH4hkWyBJX)_Fixes#34596
Clause-②: yes (widening)
Metadata-protocol: none
repo:objectstack#3 · os-support-ai · session_01WGufzi3ezPzTysQPDEjmVz
(claim 6937591453, surface amended by the seat to add
`InboxPopover.tsx`) · part of epic #34571
**Item 2 of the card (no floating AI button on a phone) is handed to
#34608**, which removes the in-app AI button at every width under the
ruling on #34608 (comment 6937495221: "the in-app bottom-right AI button
is removed (one entry: the top-bar robot)"); it lands in PR #34665. This
PR does not touch `ConsoleChatbotFab.tsx`.
**Deviation from card item 3's wording.** Item 3 asks for a phone bar
with "search, notifications, avatar" only. The phone bar keeps the
top-bar AI robot (where the server serves AI) under the #34608 ruling
(comment 6937495221: "one entry: the top-bar robot"), which postdates
the card's wording; with the in-app AI button gone (#34665, now on
`main`), hiding the robot on a phone would leave a phone with no AI
entry. Live reading with the robot's 44 px slot in the bar: the phone
title gets 89 px and "Opportunities" needs 89 px, so it fits (89/89 px,
not truncated; 74/89 px and truncated on the old `main`).
## 维护者速读
- 改了什么:手机宽度(768 px
以下)首页的「初始化清单」挪到应用宫格之后,默认折叠成一行(标题、进度、「继续」),点「继续」原地展开,展开后可再收起;手机顶栏的通知角标「9+」移进铃铛的
44 px 点击区内,不再被顶栏上沿裁掉;640 px 以下顶栏三组按钮之间去掉分隔线和额外间距、标题去掉左边距,把宽度让给页面标题。
- 为什么改:375 宽实测改前清单占首屏 90%(375×667)、首屏一行应用图标都看不到;角标顶边在 y = -0.5
px,露在顶栏之外。
- 风险与回滚:只动控制台前端(`HomePage`
新增一个可选的清单插槽、清单组件新增摆放参数、铃铛角标两个手机类名、顶栏手机端间距、每种语言一个「继续」键);清单的行、完成判定、进度计数、关闭按钮都不变;768
px 及以上首页不变。回滚即 revert 本 PR。
- 先看:① `ui/packages/app-shell/src/console/home/HomePage.tsx` 的
`checklist?.('top')` / `checklist?.('afterApps')` 两处摆放;②
`ui/apps/console/src/pages/settings/FirstRunChecklist.tsx` 的 `foldable
&& !unfolded` 折叠分支;③ `ui/packages/app-shell/src/layout/AppHeader.tsx`
右侧按钮簇的 `sm:` 分隔线类名。
- 两分钟验证:在仓根执行 `pnpm --dir ui exec vitest run
apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx
packages/app-shell/src/console/home/__tests__/HomePage.phoneTapTargets-29147.test.tsx`,预期
2 个文件全部通过(含「375 px: drawn once, after the apps」与「one line: the title,
the progress and Continue」)。
- 需要你做的:无,席位落地。
## What changes
**Home's checklist slot** (`HomePage.tsx`, `@object-ui/app-shell`):
`HomePage` takes an optional `checklist(placement)` render slot. Home
calls it with `'top'` above the page's sections on a desktop, with
`'afterApps'` in the content column right after the apps strip on a
phone (`usePhoneViewport`, below 768 px, the hook the list and record
pages already use), and with `'top'` above the empty state when there is
no app yet. While the page is loading the slot is not drawn, so the
checklist mounts once, where it stays. The console's Home route
(`App.tsx`) passes the first-run checklist through the slot instead of
mounting it above `DefaultHomePage`.
**The folded card** (`FirstRunChecklist.tsx`): a `placement` prop
(`'top'` default). `'afterApps'` starts folded to one line: the title,
the progress line the card already draws ("3 of 6 done", same count,
same key) and a **Continue** button (`aria-expanded=false`). Continue
unfolds the whole card in place; the unfolded phone card adds a fold
control (chevron, `aria-expanded`, `aria-controls` = the rows list,
named by `common.collapse`) beside the progress and the close button.
Folding is the mount's own state, like the done-rows fold: a fresh visit
starts folded. No row, completion rule, progress count, write or dismiss
record changes; with every required row done the card still draws
nothing.
**The phone top bar** (`AppHeader.tsx`, phone bar only;
`InboxPopover.tsx`, the badge line only):
- The bell's badge takes `max-md:top-1 max-md:right-1`: below 768 px it
sits inside the 44 px trigger on the glyph's corner, instead of 2 px
above the trigger, which put its top edge at y = -0.5 px, outside the 48
px bar.
- Below 640 px the utility cluster's group dividers and their margins
are `sm:`-scoped, so the 44 px controls sit side by side, and the page
title beside the app pill takes no margin of its own (the pill's padding
parts them). Both give the width to the title.
- **Which controls the phone bar keeps is unchanged.** On `main` the
phone bar already shows only search, the bell and the account menu, plus
the AI robot where the server serves AI. The card asks for "search,
notifications, avatar" only; the robot stays because the #34608 ruling
makes it the one AI entry ("one entry: the top-bar robot"), and with the
in-app AI button removed there, hiding it on a phone would leave a phone
with no AI entry at all. The card's item 2 also routes the phone AI
entry to the top-bar icon.
**i18n**: `console.firstRunChecklist.continue` in all eleven packs
(zh-Hant regenerated with `gen-zh-hant.mjs`).
**Why the key is in the eager `locales/en.ts`, not a lazy namespace.**
The eager pack is for keys the eager shell draws; a key only lazily
loaded surfaces read belongs in the namespace that surface already uses.
This key does not qualify for a namespace: `FirstRunChecklist` is a
static import of the console entry (`App.tsx`), drawn by the `/home`
route, which is where `RootLandingRedirect` lands a workspace by
default, and it renders behind no namespace frame. Measured in the built
console at `860300c36`: the call site
`console.firstRunChecklist.continue` sits in the entry chunk
`assets/index-DAb5a3hk.js`, the one chunk `eager-closure.json` lists in
`entryChunks`; the rest of the `console.firstRunChecklist` group already
lives in `en.ts`. The two pack-shaped namespaces (`marketplace`,
`developer`) hold groups their own surfaces read, and `check:i18n-keys`
refuses a namespace-only key read outside its frame, so moving this one
key there would need a second loader for one string. Cost:
`i18n-locale-en` reads **60.2 KB / 60.5 KB** ceiling (headroom 0.4 KB)
after merging `main` (see Verification); the ceiling is not touched.
## Tests
- `FirstRunChecklist.test.tsx` (new top-level describe in the existing
harness, real settings client on a stubbed `fetch`): the folded line
(title, "0 of 5 done", Continue, no rows, no write); Continue unfolds
with every row, the fold control's `aria-expanded` / `aria-controls`,
folding back; folding changes no completion rule (the folded line counts
"3 of 5 done", a set workspace draws nothing); zh 「继续」; CONTROL: `'top'`
draws the whole card with neither control.
- `HomePage.phoneTapTargets-29147.test.tsx` (new top-level describe): at
1024 px the slot is asked once for `'top'`, drawn before the greeting
and the apps, never `'afterApps'`; at 375 px once for `'afterApps'`,
after the last app tile and before "My work"; 375 px with no app:
`'top'`; CONTROL: no slot, page as before. The harness also gains the
module-top `import '@objectstack/lint'` that `check:test-source-alias`
asks of an edited file reaching `capabilityLint`.
- `AppHeader.centeredSearch-12472.test.tsx` (new top-level describe):
every divider rule on the cluster is `sm:`- or `min-[960px]:`-scoped;
the phone title carries no margin class and sits in the left group.
- `InboxPopover.phoneWidth-29076.test.tsx` (new top-level describe): the
"9+" badge carries `max-md:top-1 max-md:right-1` beside its desktop
offsets, inside the `relative max-md:size-11` trigger.
No ablation: happy-dom computes no media query, so these pins read the
classes and the slot calls; the pixel proof is the live reading below.
## Acceptance notes
- **Robot vs. card wording** (the deviation stated above): kept by
ruling. Measured on a phone app route with a 44 px robot slot in the
bar: the title has 89 px, "Opportunities" needs 89 px, so it fits with
no headroom; on the old `main` the same title had 74 px and truncated. A
longer page name still truncates while the robot is in the bar.
- **The bell's pulse.** When the unread count rises the trigger bounces
for 1.2 s (`motion-safe:animate-bounce`, 25 % of its height); during
that bounce the badge rides above the bar's edge again. Unchanged here.
- **640–767 px.** The badge moves inside from 768 px down; the dividers
and the title margin change only below 640 px (the title is drawn only
below `sm`).
- **Desktop first screen.** At 1280 × 800 the card is still above the
page (48 % of the first screen, one row of app icons): unchanged, out of
this card's scope.
- **Clause-②: yes (widening)**, by the seat's ruling in the restated
claim on #34596: a new locale key (`console.firstRunChecklist.continue`)
and an optional `checklist` prop on the workspace-private app-shell
`HomePage` export. L1 at TIER_DEFAULT is the review of record, no L2.
`Metadata-protocol: none` and the `patch` level are unchanged; the
changeset carries the same two lines.
## Verification
**Fix round at `860300c36`** (merge of `origin/main` at `004513829`,
which brought #34665 and #34642 into the locales, `App.tsx`,
`HomePage.tsx` and `AppHeader.tsx`; clean text merge, then the Clause-②
changeset line):
| Reading at `860300c36` | result |
|:---|:---|
| `turbo run build --filter=@object-ui/console` (locked) | 75/75 tasks,
VERDICT command-exit 0 |
| `pnpm --dir ui run check:eager-closure` | exit 0; **`i18n-locale-en`
60.2 KB / 60.5 KB ceiling (headroom 0.4 KB)**; closure 1894.3 / 2431.6
KB |
| `check:eager-locale-catalogues` | exit 0; `en` 60.2 KB EAGER
(resident) |
| `check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys` | exit 0
each |
| scoped vitest (locked; list in the Tests block) | Test Files 272
passed (272), Tests 3654 passed, 13 skipped |
| `type-check` of `@object-ui/app-shell`, `@object-ui/console`,
`@object-ui/i18n` (locked) | exit 0 |
Live, on this branch at `e78e39f48`, my own stack: showcase backend
`objectstack dev --fresh -p 4796` from this worktree, Console Vite on
:5196 against it, Chromium at `/opt/pw-browsers/chromium`, signed in as
the seeded admin; 11 launcher apps (the showcase's own plus apps
authored through `PUT /api/v1/meta/app` on that throwaway database) and
12 in-app messages sent to the admin through `POST
/api/v1/messaging/in-app-messages`, so the bell reads "9+". "Before" is
the same stack with the five source files restored from `origin/main`
(then restored to `HEAD`, each file's hash equal to its `HEAD` blob).
| Reading | before (`origin/main`) | after |
|:---|:---|:---|
| 375 × 667 Home: full rows of app icons on the first screen | 0
(checklist 677 px tall, 90.4 % of the screen) | **3** (checklist folded,
54 px, after the apps) |
| 375 × 812 Home: full rows of app icons on the first screen | 0
(checklist 83.3 % of the screen) | **4** |
| Folded line at 375 px (title / needs) | n/a | en 135/135, zh-CN 76/76,
de 108/108: no truncation, 54 px tall |
| Bell badge "9+" at 375 px (Home and app routes) | rect y = -0.5 px,
96.9 % visible, outside the bar | y = 5.5 px, **100 % visible, inside
the bar**, text not overflowing |
| Phone app-route title room, 44 px robot slot added, "Opportunities" |
74 px for 89 needed: truncated | **89 px for 89**: not truncated |
| Phone app-route titles as served ("Expense Reports", "Business Units")
| 110/110, 96/96 | 110/110, 96/96 |
| 1280 × 800 Home | card above the page | unchanged |
Screenshots (seat project files):
`/mnt/project-files/objectstack-seat3/34596-live/` —
`before-home-375x667.png`, `after-home-375x667.png`,
`after-home-375x812.png`, `after-home-375x812-continued.png`,
`after-folded-line-{en,zh-CN,de}.png`, `before-bar-375x812.png`,
`after-bar-375x812.png`,
`before-app-bar-showcase_expense_report-375x812.png`,
`after-app-bar-showcase_expense_report-375x812.png`,
`after-home-1280x800.png`.
<details><summary>Tests (locked runs)</summary>
- At `f61d7e2b5` (after merging `origin/main`, closure rebuilt): `pnpm
--dir ui exec vitest run --maxWorkers=2
packages/app-shell/src/console/home/
packages/app-shell/src/layout/__tests__/AppHeader.
packages/app-shell/src/layout/__tests__/InboxPopover.
apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx
apps/console/src/__tests__/ packages/i18n/` → Test Files 263 passed
(263), Tests 3609 passed, 13 skipped.
- At `b661a231c`: `@object-ui/console^...` built; `pnpm --filter
@object-ui/app-shell --filter @object-ui/console --filter
@object-ui/i18n run type-check` → exit 0 (both tsconfigs each);
`AppHeader.` tests → 34 files, 285 tests passed.
- At `e78e39f48`: the four edited harnesses plus `ui/scripts/` (derived
family) → Test Files 175 passed, 2 skipped; Tests 5162 passed, 2
skipped; lock VERDICT command-exit 0.
- At `860300c36` (head, after merging `origin/main`; console closure
rebuilt): `pnpm --dir ui exec vitest run --maxWorkers=2
packages/app-shell/src/console/home/
packages/app-shell/src/layout/__tests__/AppHeader.
packages/app-shell/src/layout/__tests__/InboxPopover.
packages/app-shell/src/layout/__tests__/ConsoleLayout.
apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx
apps/console/src/__tests__/ packages/i18n/` → Test Files 272 passed
(272), Tests 3654 passed, 13 skipped, VERDICT command-exit 0;
`type-check` of the three packages → exit 0.
</details>
<details><summary>Gates (local subset, derived by dispatch-gates
--commands at b661a23, re-run after later commits where they read the
new edits)</summary>
40 derived families: the 39 non-vitest commands exit 0 except
`check:test-source-alias` (exit 1 on the edited Home harness, fixed by
the module-top import, then exit 0 at `e00081337`); `vitest run
scripts/` ran in the locked head run above. `dispatch-gates --ran` → 40
derived, 40 run, 0 NOT-MEASURED, 0 UNRUN. Re-run after the last edits:
`check:undeclared-dep-imports`, `check-changeset-no-major`,
`check-empty-changeset`, `check-adr-0087-registration`,
`check:test-source-alias`, `check:nul-bytes`,
`check:cross-package-test-inputs` → exit 0. `overlap-check
--branch=HEAD` at `e78e39f48` → VERDICT clean exit 0. Everything else is
CI's.
Fix round, at `860300c36`: `dispatch-gates --commands` (tree
objectstack-ai/objectstack at `860300c36`) → the same 40 families; all
39 non-vitest commands exit 0 (each captured before any pipe), `vitest
run scripts/` (locked) → Test Files 171 passed, 2 skipped; Tests 5077
passed, 2 skipped, VERDICT command-exit 0; `dispatch-gates --ran` → 40
derived, 40 run, 0 NOT-MEASURED, 0 UNRUN. Also
`check:new-line-citations` → 0 new, exit 0. `overlap-check
--branch=HEAD` at `860300c36` → VERDICT clean exit 0 (origin/main and PR
heads #34713, #34697, #34677, #34674 merge cleanly).
</details>
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzi3ezPzTysQPDEjmVz -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
feat(console): on a phone, Home keeps its first screen for the apps, and the top bar's badge and title fit
8
+
9
+
Clause-②: yes (widening)
10
+
Metadata-protocol: none
11
+
12
+
**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.
13
+
14
+
`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.
15
+
16
+
**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.
0 commit comments