Repository navigation
Commit bd98dd1
fix(console): on a desktop the way-home controls name the app start page, and the pill drops its duplicate All apps row (#37204)
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes #37163
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:桌面端应用切换菜单去掉了多余的「全部应用」一行;找不到页面、无权访问、AI
不可用等页面上的「返回首页」按钮,以及左上角产品标志的读屏名称,改为「返回应用起始页」;手机端完全不变。
- 为什么做:属于「去掉顶栏和平台首页那一层」专题的收尾,桌面端平台首页已下线,这几处还在承诺一个不存在的首页或应用列表。
- 出错会怎样:最坏是某处文案读起来不顺,跳转目标没有任何改动;可直接撤回。
- 要你做什么:无。
## What changes
Measured first, at `origin/main` a10345a. From 768 px up
`useHomePath()` answers `resolveDesktopHomePath` (the last-used app,
else the declared default, else the first product app). Desktop `/home`
redirects into that app (`HomeRoute` → `RootLandingRedirect`) and draws
only the no-apps empty state for a viewer with no product app. So no
desktop page lists the apps. The pill's 「Switch Application」 group lists
every app the launcher serves (`useLauncherApps`, Setup as the
「Settings」 row). It has no cap.
- `layout/AppSwitcher.tsx`: the 「All apps」 row (`app-switcher-all-apps`)
is removed. It linked to `homePath`, the same target as the 「Back to app
start page」 row above it, and the switch group is the list it promised.
This dropdown is desktop-only: a phone opens the app-list sheet, which
never had the row. The `LayoutGrid` import and the stale comments go
with it.
- `components/NotFoundState.tsx` `BackToHomeButton` (access denied,
verdict screens and route-not-found in `AppContent.tsx`, plus
`RecordDetailView.tsx`): reads `layout.appSwitcher.backToHome` 「Back to
app start page」 from 768 px up and `empty.appAccessDeniedHome` 「Back to
home」 on a phone (`usePhoneViewport`, imported directly so the component
still does not load the `useHomePath` module graph).
- `console/ai/AiUnavailable.tsx`: same split for its way-home button.
- `layout/AppHeader.tsx`: the product mark's `aria-label` is
`layout.appSwitcher.backToHome` on a desktop and
`layout.appSwitcher.productHome` 「PRODUCT home」 on a phone. `title`
stays the product name.
- `@object-ui/i18n`: untouched. No key added or removed (`backToHome`
already reads 「Back to app start page」 / 返回应用起始页 in all eleven locales
since #37159; `allApps`, `productHome`, `appAccessDeniedHome` and
`unavailableHome` keep their phone readers). Hence `Clause-②: no`.
- Targets: unchanged everywhere.
Serial constraint with #37166 (zone a4-S; it also edits
`AiUnavailable.tsx` and three StudioRoute console tests). Round 1's
one-line import overlap in `AiUnavailable.tsx` was removed by moving the
import one line up. Round 2 (head `156171ded`) updates three console
tests to the desktop wording. They are `StudioRoute.test.tsx:387` and
`StudioRoute.lazyBuilder-11798.test.tsx:187`, which looked the mark up
by its phone name at jsdom's 1024 px, and
`StudioRoute.metadataArea-28561.test.tsx:150`, whose old-name absence
check could no longer fail; it now checks
`data-testid="app-bar-product-home"`. Those three files conflict
textually with #37166. By the seat's ruling this PR lands first, and
#37166 resolves them as follows: it keeps its own deletion of the two
front-door tests, and on `metadataArea-28561` keeps its comment line
plus this PR's test-id assertion (posted on #37166 as 7153261562).
`overlap-check` at `156171ded`: `origin/main`, #37215 and #37185 merge
cleanly; the only overlap is #37166 in those three files.
Read first, by risk:
1. `ui/packages/app-shell/src/layout/AppSwitcher.tsx`: the removed row
(the only behaviour change besides labels).
2. `ui/packages/app-shell/src/components/NotFoundState.tsx`: the
viewport choice shared by four screens.
3. `ui/packages/app-shell/src/layout/AppHeader.tsx`: the mark's `label`
ternary.
Two-minute check: at a desktop width, open any app's pill. The menu
lists the apps, then 「Back to app start page ⌘⇧H」 and 「Settings」, with
no 「All apps」. Open `/apps/APP/no-such-page`: the button reads 「Back to
app start page」. Narrow the window under 768 px and the same page reads
「Back to home」.
## Tests
Pins per surface at desktop width, with the phone as the CONTROL. Each
new pin is a top-level `describe` in the surface's existing harness:
- App pill: `AppSwitcher.homeMenu-12605`. The outline has no
`app-switcher-all-apps`, exactly one link to the app start page, and
every app in the switch group. Phone control: the drawer's 「All apps」
still pinned, unchanged, in `UnifiedSidebar.mobileAppHeader-12201`.
- `BackToHomeButton`: `NotFoundState.test`. At 1280 px it reads 「Back to
app start page」 with no "home" in it. CONTROL at 375 px: 「Back to home」,
opens `/home`.
- `AiUnavailable`: `RequireAiSurface.test`. Desktop reads
`layout.appSwitcher.backToHome`. CONTROL on a phone:
`console.ai.unavailableHome`.
- Product mark: `AppHeader.homeMark-12605`. At 1280 px its accessible
name is 「Back to app start page」 and `title` the product name. CONTROL
at 375 px on `/home`: 「PRODUCT home」, href `/home`.
Existing pins re-pointed to the desktop wording, or to
`app-switcher-home` in place of the removed row:
`AppSwitcher.appIdentity-12201`, `AppSwitcher.hostSingleApp-12913`,
`AppHeader.pageRouteNoAuthoringHandles-12198`,
`RecordDetailView.recordReadFailure-11902`,
`AppContent.deniedVsUnpublished`, `AppContent.noAppComponentRoutes`.
<details><summary>Affected suites (vitest, from ui/), head
646cd3e</summary>
```
pnpm exec vitest run --maxWorkers=2 NotFoundState RecordDetailView.recordReadFailure-11902 AppContent.deniedVsUnpublished AppContent.noAppComponentRoutes RequireAiSurface AiChatPage AiUnavailable AppHeader. AppSwitcher. SidebarAppMenu-36112 UnifiedSidebar. usePhoneNavDrawerHistory-29131 KeyboardShortcutsDialog StudioDesignSurface.homeLoop-12513 StudioDesignSurface.backToApp ConsoleLayout. AppContent.packageless setupRedirectTarget
Test Files 127 passed (127)
Tests 974 passed (974)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>Reverse verification (one-shot, restored)</summary>
`node scripts/ablation-replace.mjs` replaced the desktop arm of
`BackToHomeButton` with the old `empty.appAccessDeniedHome` key (anchor
x1 -> x0, replacement x0 -> x1, blob da89f6f -> 07b506144a86) and
ran `NotFoundState.test`:
```
× names the object and its cause, and the way back opens Home
× a deployment that declares its landing app returns there
× zh: the way back reads in the reader language
× on a desktop it names the app start page Home now is, not a home page
Tests 4 failed | 1 passed (5)
ablation-replace: ok restored: blob == HEAD (da89f6f) and `git diff HEAD` is empty
```
The phone CONTROL stayed green under the mutation. There was no build
step, because the harness imports app-shell source relatively.
</details>
<details><summary>Type-check, lint, gates</summary>
```
pnpm --filter '@object-ui/app-shell^...' build && pnpm --filter @object-ui/app-shell run type-check
TYPECHECK_EXIT=0
eslint --no-inline-config (14 touched ui files): 0 errors, 23 warnings (pre-existing no-explicit-any)
node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (origin/main, #37166)
dispatch-gates --commands: 38 derived families, all 38 exit 0 (ui scripts/ suite: Test Files 172 passed | 2 skipped); --ran: 0 UNRUN
```
</details>
## Acceptance notes
- `RequireAiSurface`'s published `redirectTo` prop can send the
no-assistant screen's button somewhere other than `useHomePath()`. No
in-repo caller passes it. The desktop label assumes the default target.
- On a desktop the way home briefly names `/home` until the `/me/apps`
answer is held, or for a viewer with no product app, where `/home` draws
the no-apps empty state. That is the same caveat #37159 accepted for the
⌘⇧H row.
- The `console.ai.unavailableError` sentence still says "head back home"
on a desktop. Fixing it needs a new locale key, so it stays outside this
diff (see report).
- Same family, outside this card's file surface:
`ui/apps/console/src/components/StudioRoute.tsx` `StudioAccessRequired`
「Back to home」 links to `useHomePath()`. It is in #37166's diff, so it
is reported rather than touched. Also stale prose only:
`runtime-config.ts` (the `hideSingleAppSwitcher` doc mentions the 「All
apps」 row) and `docs/qa/platform-checklist/areas/approvals.json` (the
switcher offers "Showcase, Back to home and All apps").
## Verification
Round 2, head `156171ded`: the 3 StudioRoute files `Tests 34 passed
(34)`; the red leg (the two files at their old content) gave `Tests 2
failed | 20 passed (22)`; a broad sweep of 872 test files `Tests 8296
passed (8296)`; the derived gate families, 38 of 38 exit 0. CI at this
head: 38 success, 13 expected skip, 0 failed.
Round 1, head 646cd3e. Local: affected suites, ablation, app-shell
type-check, touched-file eslint, the derived gate families. CI owns the
full farm.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a386a1d commit bd98dd1
19 files changed
Lines changed: 217 additions & 71 deletions
File tree
- .changeset
- ui
- apps/console/src/components
- packages/app-shell/src
- components
- __tests__
- console
- __tests__
- ai
- layout
- __tests__
- views
| 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 | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
386 | | - | |
387 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
388 | 389 | | |
389 | 390 | | |
390 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
66 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
67 | 78 | | |
68 | 79 | | |
69 | 80 | | |
| |||
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| 92 | + | |
81 | 93 | | |
82 | 94 | | |
83 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
84 | 98 | | |
85 | 99 | | |
86 | 100 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| |||
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
50 | | - | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
58 | | - | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
65 | | - | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
71 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
72 | 101 | | |
73 | 102 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
| 615 | + | |
| 616 | + | |
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
| 439 | + | |
| 440 | + | |
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
444 | | - | |
| 445 | + | |
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
76 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
| |||
0 commit comments