Repository navigation
Commit 6161010
fix(console): on a desktop the ⌘⇧H row names the app start page it opens, not the retired home (#37159)
Fixes #37149
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:桌面端快捷键说明和应用切换菜单里,⌘⇧H
那一行从「返回首页」改为「返回应用起始页」;手机端不变,快捷键本身的行为也不变。
- 为什么做:属于「首页退役」收尾工作的最后一项,平台首页已经下线,这一行还在承诺一个不存在的首页。
- 出错会怎样:最坏只是这一行文案读起来别扭,不影响跳转;改动只涉及文案与一行显示逻辑,可直接撤回。
- 要你做什么:无。
## What changes
Measured first (code read at `origin/main` 1f3e9f6): `ConsoleLayout`
installs `useGoHomeShortcut(true, useHomePath())`. From 768 px up
`useHomePath()` answers `resolveDesktopHomePath(served, lastApp)` — the
last-used app, else the declared default, else the first product app —
the same answer `/` redirects a desktop to after #36732. Inside an app
the last-used app is the app itself (`ConsoleLayout` calls
`rememberApp(activeAppName)`), so on a desktop `⌘⇧H` opens the current
app's start page; from Studio or the AI pages it opens the last-used
app's start page. On a phone it still opens the declared landing or the
app list at `/home`.
So the chord has a real, working destination on a desktop; only its NAME
was stale. I kept the shortcut and retargeted the wording rather than
retiring it — retiring would remove a working key users may rely on,
which the dispatch reserved as a product decision; renaming changes no
behaviour.
- `chrome/advertisedShortcuts.ts`: `GO_HOME_SHORTCUT` stays the phone
row (「Back to home」, `console.shortcuts.goHome`); new
`GO_TO_APP_START_SHORTCUT`, the same id and chord, labelled with
`layout.appSwitcher.backToHome` — the key the app pill's row already
draws — so the dialog and the pill name one destination. Stale doc (it
said `AppHeader` owns the listener) corrected.
- `chrome/goHomeShortcut.ts`: the handler is unchanged; it advertises
the phone row below 768 px and the desktop row from 768 px up
(`usePhoneViewport`).
- `layout/AppSwitcher.tsx`: module doc and the row's English default
updated. The dropdown is desktop-only (a phone opens the app-list sheet,
which has no such row); keycaps unchanged.
- `@object-ui/i18n`: value change only, no new key —
`layout.appSwitcher.backToHome` in all eleven locales now reads 「Back to
app start page」 (zh-Hans 返回应用起始页). That key has one reader, the desktop
dropdown row (plus now the desktop dialog row).
`console.shortcuts.goHome` is unchanged.
Read first, by risk:
1. `ui/packages/app-shell/src/chrome/goHomeShortcut.ts` — the viewport
choice of which row to advertise (the only logic change).
2. `ui/packages/app-shell/src/chrome/advertisedShortcuts.ts` — the
second advertised constant, same id and chord.
3.
`ui/packages/app-shell/src/layout/__tests__/AppHeader.homeMark-12605.test.tsx`
— the new describe at the end.
Two-minute check: run the console at a desktop width inside any app,
press `?` to open the keyboard-shortcuts dialog — the Navigation section
lists 「Back to app start page ⌘⇧H」; open the app pill — the row reads
the same with the same keycaps; press ⌘⇧H — you land on the app's start
page. Narrow the window under 768 px and the dialog row reads 「Back to
home」.
## Tests
Head `7c591386d`. Pins added as a top-level describe in the existing
harness `AppHeader.homeMark-12605.test.tsx`, read through the real
English catalogue:
- desktop (1280 px): the advertised ⌘⇧H row equals
`layout.appSwitcher.backToHome` (the pill's words), equals 「Back to app
start page」 and does not contain "home";
- CONTROL, phone (375 px): the row stays `console.shortcuts.goHome`
「Back to home」.
The switcher pins (`AppSwitcher.homeMenu-12605`,
`AppSwitcher.hostSingleApp-12913`) now expect the new row text; the
row's href and `⌘⇧H` keycaps assertions are unchanged.
<details><summary>Affected tests + i18n package (vitest, from
ui/)</summary>
```
pnpm exec vitest run --maxWorkers=2 AppHeader.homeMark-12605 AppSwitcher.homeMenu-12605 AppSwitcher.hostSingleApp-12913 KeyboardShortcutsDialog.wiredOnly-11674 AppHeader.unsavedEditsLeave-13231 SidebarAppMenu-36112 AppHeader.phoneTargets-29075 packages/i18n/
Test Files 117 passed (117)
Tests 2106 passed | 13 skipped (2119)
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 with
`GO_HOME_SHORTCUT` (anchor hit, grep count 1 on disk) and ran the
harness:
```
× on a desktop the row names the app start page, in the app pill's words, not a home page
Expected: "Back to app start page"
Received: "Back to home"
Tests 1 failed | 12 passed (13)
ablation-replace: ok restored: blob == HEAD (4cfbcce) and `git diff HEAD` is empty
```
The phone CONTROL stayed green under the mutation. No build/dist step:
the harness imports app-shell source relatively.
</details>
<details><summary>Type-check and lint</summary>
```
pnpm --filter @object-ui/i18n run type-check && pnpm --filter @object-ui/app-shell run type-check
os-verify-lock: VERDICT command-exit 0
eslint (touched app-shell files): 0 errors, 2 pre-existing no-explicit-any warnings in AppSwitcher.tsx lines 130 and 236 (not in this diff)
```
</details>
## Acceptance notes
- Desktop: the dialog row and the pill row both read 「Back to app start
page」 with ⌘⇧H, and ⌘⇧H opens that page. Phone: unchanged (dialog row
「Back to home」, no dropdown row, same handler).
- Not changed here, outside this card: the pill's 「All apps」 row links
to the same `useHomePath()` target as the row above it, so on a desktop
it also opens the last-used app's start page rather than any list of
apps; other 「Back to home」 surfaces (the not-found and access-denied
states, the AI-unavailable page, the product mark's 「PRODUCT home」 name)
likewise lead to that start page on a desktop. Reported to the seat as
one family; not touched.
- Browser check: NOT MEASURED, reason: the destination was established
by code read of `useHomePath` / `resolveDesktopHomePath` and is pinned
in jsdom; no dev server was started.
## Verification
- Derived local gates (`node scripts/pm/dispatch-gates.mjs --commands`,
41 commands): all 41 exited 0; `--ran` reconciliation: 41 derived, 41
run, 0 UNRUN.
- `node scripts/pm/overlap-check.mjs`: VERDICT clean (merges cleanly
with origin/main and the three open PRs sharing locale files).
- E2E collection under CI's config (`cd ui && pnpm exec playwright test
--project=chromium --list`): exit 0, 202 tests in 35 files; no spec
names the changed row.
- CI families: in progress at open; the PR's check-runs are the verdict.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 06c1f54 commit 6161010
18 files changed
Lines changed: 121 additions & 31 deletions
File tree
- .changeset
- ui/packages
- app-shell/src
- chrome
- 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
86 | 100 | | |
87 | 101 | | |
88 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
| |||
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
63 | | - | |
| 73 | + | |
| 74 | + | |
64 | 75 | | |
65 | 76 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
257 | | - | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
138 | 143 | | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| |||
335 | 341 | | |
336 | 342 | | |
337 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
111 | | - | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | | - | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
147 | | - | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4195 | 4195 | | |
4196 | 4196 | | |
4197 | 4197 | | |
4198 | | - | |
| 4198 | + | |
4199 | 4199 | | |
4200 | 4200 | | |
4201 | 4201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3864 | 3864 | | |
3865 | 3865 | | |
3866 | 3866 | | |
3867 | | - | |
| 3867 | + | |
3868 | 3868 | | |
3869 | 3869 | | |
3870 | 3870 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4624 | 4624 | | |
4625 | 4625 | | |
4626 | 4626 | | |
4627 | | - | |
| 4627 | + | |
4628 | 4628 | | |
4629 | 4629 | | |
4630 | 4630 | | |
| |||
0 commit comments