Repository navigation
Commit 138faaa
feat(app-shell): on a phone, sign-in lands in an app whose home is its whole menu, and the bottom bar is fixed to Home, Notifications, Approvals and search (#35912)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu7iKZbTviWuMAXjrAurGDA5)_
repo:objectstack#1 · os-sales · session_01L6bhgU7ah5dc72qr3aWHFu
Fixes #35881
Fixes #35882
Clause-②: no
Metadata-protocol: none
Ruling-ref: 7045309332 (maintainer, 2026-11-20 16:50:40Z, 「上次用的优先」: on a
phone the last-used app first, the declared default only when there is
no record yet) · 7045325067 (maintainer, 2026-11-20 16:50:46Z, epic
#35880 constraints: one console at narrow width, and a "Shared with
desktop" section at acceptance)
## 维护者速读
- 手机上的用户登录后直接进上次用的应用;应用首页就是这个应用的全部菜单;底部栏固定为首页、通知、审批和一个搜索按钮。电脑和平板上看到的不变。
- 属于「手机端重做」专题的前两张卡:登录去向和应用首页,以及底部固定三格。
- 出问题时影响的是手机上的导航(进错应用、菜单或底部栏不对);不动数据,撤回这个 PR 就恢复原样。
- 无
## What changes (phone width only, below 768 px)
**Where sign-in lands (#35881).** `/` on a phone opens the app the
person used last. The declared default (`isDefault`) is used only when
there is no record yet. With one app it opens that app; with several and
neither, it opens the app list. The order lives in one function,
`resolvePhoneLandingPath` in
`ui/apps/console/src/components/RootLandingRedirect.tsx`, with a test
for each order. The last app is a per-person preference row
(`ui.app.last`, `LastAppProvider`), recorded by `ConsoleLayout` whenever
an app is open. It joins the console's one shared preference read (the
budget test pins that it adds no request). `/` waits for that read for
at most 2 s, then resolves without it. Desktop landing is unchanged:
`resolveLandingPath` is not touched.
**The app's home is its whole menu (#35881).** On a phone,
`/apps/SEGMENT` renders `PhoneAppHome` instead of redirecting to the
landing entry. The menu in it is the sidebar's own: `UnifiedSidebar`
draws its navigation block (context selectors, area switcher,
`NavigationRenderer` with the same member gates, labels, icons, groups
and order) a second time, through a portal into the page's slot. So the
page cannot list an entry the sidebar hides, or order them differently.
「‹」 on a deeper page goes back to it, and the scroll position is
restored. An app that shows the member no entry still renders the
no-access state.
**App switcher (#35881).** On a phone, the app pill at the top left
opens a bottom `Sheet`: 「Current app」 checked, 「Other apps」 with Setup
last, and a search box at the bottom (`PhoneAppList`). A phone's `/home`
is the same list as a page. The desktop dropdown is unchanged.
**Bottom bar (#35882).** `PhoneAppNavBar` is rewritten in place. It has
three fixed cells and a round search button:
- **Home** opens the app's home.
- **Notifications** opens `sys_inbox_message?view=mine`, the bell's
「View all」 target.
- **Approvals** opens `system/approvals`, under the app the bell hosts
them under (`resolveHostAppSegment`).
- **Search** opens the command palette.
The badges are the bell's two addends from `useInboxBell`: unread topics
and pending approvals. The bar is mounted only on those three pages
(`isPhoneTabRoute`). A list, a record, a form, a dashboard or a page has
the screen to itself. The app bar there shows 「‹」 and the page title,
and on the three tab pages it shows the app pill with the app's name.
Removed with the old bar (#34594 and its follow-up #35020):
- menu entries in the bar, the 「More」 cell and its highlight
- the stars that pinned entries, and the drawer's phone search box and
pin hint
Pins already stored are no longer read. Nothing deletes them. The drawer
still opens with the left-edge swipe.
## Shared with desktop
| Phone part | Uses | Kept separate, and why |
|---|---|---|
| App home menu | The sidebar's own `NavigationRenderer` block in
`UnifiedSidebar` (same gates, area switcher, labels, icons), portalled
into the page | Only the container: a page instead of the drawer. Phone
rows drop the desktop row action (pin/star) and the Favorites rows, as
the drawer did. |
| App switcher | `AppSwitcher` (same trigger, same `onAppChange`, same
`appAddressSegment` address), `useLauncherApps` (same app set as the
desktop dropdown and Home tiles), `AppMark`, `Sheet side="bottom"` from
`@object-ui/components` | The list body `PhoneAppList` is new, because
the desktop dropdown's menu items are not a touch list with search. It
is shared between the sheet and the phone `/home`. The phone sheet holds
the list alone. 「Back to home」 and 「All apps」 are dropped because they
would open that same list (a phone's `/home` is it), 「Settings」 because
Setup is a row in the list, and 「Edit / Open APP in Studio」 because
Studio authoring stays a desktop entry. |
| Bottom bar | The console's existing phone bar `PhoneAppNavBar`
(#34594), rewritten in place; `useInboxBell` + `groupNotifications` (the
bell's own counts); the bell's own inbox targets; `useCommandPalette`
(the top bar's search) | `@object-ui/layout`'s `MobileBottomNav` (the
`AppSchemaRenderer` host) is not used: it draws the app's first five
menu entries, which is the app-following bar #35882 replaces. |
| Landing | `resolveLandingPath` (desktop order) is the fallback inside
`resolvePhoneLandingPath`; the last app rides the shared
`sys_user_preference` read (`UserStateBridge`) | The last-app-first rule
applies only on a phone, per ruling 7045309332. |
| Width switch | `usePhoneViewport` / `useSidebar().isMobile` (the
existing < 768 px switch) | none |
## Tests
New:
- `layout/__tests__/PhoneAppNavBar.fixedTabs-35882.test.tsx`: the three
pages, the cells and their targets, the lit cell, another app, search,
badges (9+ cap, topic count), with CONTROLs.
- `layout/__tests__/AppSwitcher.phoneSheet-35881.test.tsx`: sheet order
(current, others, Setup last), search, pick by address, name on tab
pages, desktop CONTROL.
- `console/__tests__/AppContent.phoneAppHome-35881.test.tsx`: the phone
app root renders the home and stays at `/apps/crm`, no-access still
shown, 1024 px CONTROL redirects.
- `apps/console/.../RootLandingRedirect.test.ts`:
`resolvePhoneLandingPath`, one test per order (last app wins, its
address, no record → default, single app / `/home`, gone/hidden/off
ignored, desktop CONTROL).
- `apps/console/.../RootLandingRedirect.route.test.tsx`: the real `/`
route on a phone: last app wins, default with no record, the bounded
wait, desktop CONTROL.
Migrated:
- `UnifiedSidebar.phoneNavBar-34594.test.tsx` →
`UnifiedSidebar.phoneAppHome-35881.test.tsx` (git mv, rewritten): the
app home shows the sidebar's menu in order with groups and hrefs, no
star/search/pin hint/Favorites, and CONTROLs at 1024 px and without the
page.
- `ConsoleLayout.phoneRecordOneBar-28483.test.tsx`: the bar describe now
pins the three tab routes, Home's address, eight deeper routes with no
bar, and the 768/1440 CONTROL. The inset padding is 3.5rem.
- `AppHeader.sidebarTrigger-12429.test.tsx`: 「‹」 goes to the app's home
on a deeper page; on the tab pages there is no 「‹」, the pill names the
app, and there is no search or bell up top; 768 px CONTROL.
- `consoleUserPreferenceBudget.test.tsx`: the `ui.app.last` key joins
the one shared read; one more debounced write.
- `HomePage.phoneTapTargets-29147.test.tsx`: at 375 px with apps, Home
is the app list and asks for no checklist placement. The 1024 px
checklist CONTROL is kept.
- `ui/e2e/live/phone-nav-drawer-back-29131.spec.ts`: opens the drawer by
the left-edge swipe, because 「More」 is gone.
Voided (the behaviour is removed by #35882):
- #34594: first four entries + More; pins first; a foreign or hidden pin
takes no cell; the More sheet's search and stars; star pins through the
pin store; record/form routes hide the bar (replaced by "only three
pages draw it"); `phoneNavBarEntries` (3 unit tests);
`hidesPhoneNavBar`.
- #35020: "the bar lights More / its cell for the page in view" (2
tests).
- #34596: "375 px: the checklist is drawn after the apps and before My
work" (that part of a phone Home is gone).
`docs/qa/platform-checklist`: no item names the old bar; none changed.
## Verification
- `vitest` (from `ui/`): every test file under
`ui/packages/app-shell/src` and `ui/apps/console/src` that imports a
changed module (PhoneAppNavBar, PhoneAppHome, PhoneAppList, AppSwitcher,
AppHeader, ConsoleLayout, UnifiedSidebar, AppContent, ConsoleShell,
HomePage, LastAppProvider, UserStateAdapters, RootLandingRedirect): 222
files, 1814 passed, 0 failed. The whole `app-shell` package (2354 files)
in one local run passed the container's one-hour limit and was stopped
without a result, so the full package is left to CI's sharded Test UI.
- `type-check` (`tsc --noEmit` and the test tsconfig) for
`@object-ui/app-shell`, `@object-ui/console` and `@object-ui/i18n`:
clean (turbo, 78 tasks, deps built). `eslint` on every changed file: 0
errors.
- `node scripts/pm/dispatch-gates.mjs --commands`: 41 derived families,
all run, all exit 0; `--ran` reconcile: 41 derived, 41 run, 0
NOT-MEASURED. `check:i18n-keys`, `check:i18n-drift`,
`check:i18n-dead-keys`: exit 0 (11 keys added and 2 removed in all 11
locales). `node scripts/pm/overlap-check.mjs`: VERDICT clean (merges
with `main` and with #35909 and #35910, which share the locale files).
Neither file the neighbouring list cards own
(`objectViewPageHeader.tsx`, `ui/packages/plugin-list/**`) is touched.
- Changed lines 2740 vs the 3000 threshold: under.
- **Browser, before / after**: `examples/app-showcase` (`objectstack dev
--seed-admin`) with the `ui/apps/console` Vite dev server over it,
headless Chromium. Before = the changed `ui/` sources checked out from
the merge base; after = this head. Screenshots are kept with the seat.
- Phone 375×812 (touch), after: the first sign-in with no record (two
apps, none default) lands on the app list (「Choose an app」, Showcase and
Setup, search box). The app root `/apps/com.example.showcase` stays
there and shows the menu with its groups (Workspace, Data Model…) and
icons, Home lit, badges 1 and 3. The pill opens the bottom sheet
(Current app ✓ Showcase, Other apps Setup, search). A list
(`showcase_task`) has no bottom bar, with 「‹」 and the title at the top.
Notifications and Approvals draw the bar with their cell lit. After
visiting the app, `/` lands in it.
- Phone, before: the app root redirected to the first entry (Capability
Map) with the five-cell bar (four entries + More), and the list drew the
bar too.
- Desktop 1440×900 and tablet 820×1180, before vs after, pixel diff: the
app root (redirects to the landing entry in both), the list and `/home`
are identical apart from relative timestamps and one badge's
antialiasing.
- Not measured: Safari / WebKit (no WebKit build in the container); the
edge-swipe e2e (`phone-nav-drawer-back-29131`, nightly) was edited but
not run here.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (eslint on the changed
files: 0 errors)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (two folded cards, one pull request, per the coordinator's
pairing)
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English. (the 维护者速读 block and
the maintainer's quotes are Chinese by the maintainer's standing rule)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgU7ah5dc72qr3aWHFu
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgU7ah5dc72qr3aWHFu -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2a0cd20 commit 138faaa
38 files changed
Lines changed: 1918 additions & 827 deletions
File tree
- .changeset
- ui
- apps/console/src/components
- e2e/live
- packages
- app-shell/src
- console
- __tests__
- home
- __tests__
- context
- layout
- __tests__
- i18n/src/locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| 115 | + | |
| 116 | + | |
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
| |||
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
| 197 | + | |
190 | 198 | | |
191 | 199 | | |
192 | 200 | | |
| |||
390 | 398 | | |
391 | 399 | | |
392 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
139 | 174 | | |
140 | 175 | | |
141 | 176 | | |
| |||
183 | 218 | | |
184 | 219 | | |
185 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
186 | 230 | | |
187 | 231 | | |
188 | 232 | | |
| |||
207 | 251 | | |
208 | 252 | | |
209 | 253 | | |
| 254 | + | |
210 | 255 | | |
211 | 256 | | |
212 | 257 | | |
| |||
217 | 262 | | |
218 | 263 | | |
219 | 264 | | |
220 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
221 | 268 | | |
222 | 269 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
39 | 51 | | |
40 | | - | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| |||
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
61 | | - | |
| 73 | + | |
62 | 74 | | |
63 | 75 | | |
64 | 76 | | |
| |||
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
73 | | - | |
| 85 | + | |
74 | 86 | | |
75 | 87 | | |
76 | 88 | | |
| |||
87 | 99 | | |
88 | 100 | | |
89 | 101 | | |
90 | | - | |
| 102 | + | |
91 | 103 | | |
92 | 104 | | |
93 | 105 | | |
| |||
112 | 124 | | |
113 | 125 | | |
114 | 126 | | |
115 | | - | |
| 127 | + | |
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
119 | 131 | | |
120 | | - | |
| 132 | + | |
121 | 133 | | |
122 | 134 | | |
123 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
1968 | 1969 | | |
1969 | 1970 | | |
1970 | 1971 | | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
1971 | 1977 | | |
1972 | 1978 | | |
1973 | 1979 | | |
| |||
2003 | 2009 | | |
2004 | 2010 | | |
2005 | 2011 | | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
2006 | 2021 | | |
2007 | 2022 | | |
2008 | 2023 | | |
| |||
2027 | 2042 | | |
2028 | 2043 | | |
2029 | 2044 | | |
| 2045 | + | |
2030 | 2046 | | |
2031 | 2047 | | |
2032 | 2048 | | |
| |||
0 commit comments