Repository navigation
Commit 6cc6177
fix(console): on a desktop the Studio refusal and the AI-unreachable sentence name the app start page (#37340)
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes #37207
Clause-②: yes (widening) — one new published language-pack key,
console.ai.unavailableErrorDesktop, in all eleven packs
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:桌面端无权进入 Studio 时的「返回首页」按钮改为「返回应用起始页」;AI
服务连不上时的提示句末尾也从「返回首页」改为「返回应用起始页」,与下方按钮一致;手机端不变。
- 为什么做:属于「去掉顶栏和平台首页那一层」专题的收尾,补上上一轮同类改动没覆盖到的两处文字。
- 出错会怎样:最坏是某种语言的提示句读起来不顺,跳转目标没有任何改动;可直接撤回。
- 要你做什么:无。
## What changes
Measured first, at `origin/main` fbb62e1 (after #37166 landed):
`StudioRoute.tsx` `StudioAccessRequired` read
`empty.appAccessDeniedHome` 「Back to home」, and
`console.ai.unavailableError` ended "or head back home." on every width.
This follows #37204's desktop/phone split (`usePhoneViewport`, under 768
px is a phone).
- `ui/apps/console/src/components/StudioRoute.tsx`: the Studio refusal's
way-home link reads `layout.appSwitcher.backToHome` 「Back to app start
page」 from 768 px up, and `empty.appAccessDeniedHome` 「Back to home」 on
a phone. `usePhoneViewport` comes from the `@object-ui/app-shell`
barrel, which already exports it. The link target (`useHomePath()`) is
unchanged.
- `ui/packages/app-shell/src/console/ai/AiUnavailable.tsx`: with
`hasError`, the sentence reads the new
`console.ai.unavailableErrorDesktop` from 768 px up ("Couldn't reach the
AI service. It may be temporarily offline — try again, or go back to the
app start page."). A phone keeps `console.ai.unavailableError`. It now
names the same place as the button under it.
- `@object-ui/i18n`: `console.ai.unavailableErrorDesktop` added once in
each of the 11 packs. Each translation reuses that pack's own
`layout.appSwitcher.backToHome` wording for "app start page" (zh-Hans
返回应用起始页). No key removed or renamed.
Clause-② measured: leaf keys per pack, base fbb62e1 → head, read by
importing each pack file: en 5040→5041, zh-Hans 5040→5041,
zh-Hant/ja/ko/de 5034→5035, fr/es/pt-BR 5191→5192, ru 5348→5349, ar
5662→5663. The new key is present in 11 of 11 packs and absent from all
11 at base. Only this one key is added. Props, exports and targets are
unchanged.
Read first, by risk:
1. `ui/packages/app-shell/src/console/ai/AiUnavailable.tsx`: the nested
`phone` ternary inside `hasError`.
2. `ui/apps/console/src/components/StudioRoute.tsx`: the link label
ternary.
3. `ui/packages/i18n/src/locales/de.ts` (and the other non-en packs):
the translated sentence.
Two-minute check: at a desktop width, sign in as a user without
`studio.access` and open `/studio`. The button reads 「Back to app start
page」. Narrow the window under 768 px and it reads 「Back to home」.
## Tests
One pin each, at desktop width, with the phone as the CONTROL. Each is a
new top-level `describe` in the surface's existing harness:
- Studio refusal: `StudioRoute.test.tsx` "/studio refused: the way home
names where it goes, by viewport". At 1280 px the link is 「Back to app
start page」 and no 「Back to home」 link exists. CONTROL at 375 px: 「Back
to home」.
- AI unreachable: `RequireAiSurface.test.tsx` "the unreachable-service
sentence names where its way home goes, by viewport". It renders
`AiUnavailable` with `hasError`. Desktop:
`console.ai.unavailableErrorDesktop`, not `console.ai.unavailableError`.
CONTROL on a phone: the reverse.
Existing pins moved to the desktop wording, because jsdom's window is
1024 px: `StudioRoute.test.tsx` `WAY_HOME`, and
`StudioRoute.accessNotice-12035.test.tsx` `wayHomeIn` (now reads
`layout.appSwitcher.backToHome` from each pack).
<details><summary>Affected suites (vitest, from ui/), head
51f74e6</summary>
```
pnpm exec vitest run --maxWorkers=2 RequireAiSurface StudioRoute console-namespace-3546 all-locales-key-parity en-zh-key-parity AiChatPage
Test Files 44 passed (44)
Tests 386 passed (386)
os-verify-lock: VERDICT command-exit 0
```
</details>
<details><summary>Ablations (one-shot, restored to the HEAD
blob)</summary>
Studio refusal. In `StudioRoute.tsx`, `node
scripts/ablation-replace.mjs` swapped the desktop arm's
`layout.appSwitcher.backToHome` for `empty.appAccessDeniedHome` (anchor
x1 -> x0, blob eb1f535 -> 95423fd7baec):
```
× on a desktop, where home is an app's start page, it reads as the app pill's row does
(+ 7 existing desktop refusal cases that read WAY_HOME)
Tests 8 failed | 12 passed (20)
ablation-replace: ok restored: blob == HEAD (eb1f535) and `git diff HEAD` is empty
```
The phone CONTROL stayed green.
AI unreachable. In `AiUnavailable.tsx`, the swap was
`console.ai.unavailableErrorDesktop` → `console.ai.unavailableError`
(anchor x1 -> x0, blob be89670 -> dada400011a4):
```
× on a desktop, where the button opens an app's start page, the sentence says so
Tests 1 failed | 13 passed (14)
ablation-replace: ok restored: blob == HEAD (be89670) and `git diff HEAD` is empty
```
Neither ablation needed a build step: both test files import the mutated
source directly (console's own file; app-shell by relative path).
</details>
<details><summary>Type-check, i18n gates, derived gates</summary>
```
pnpm --filter '@object-ui/console^...' build VERDICT command-exit 0
pnpm --filter @object-ui/app-shell --filter @object-ui/console --filter @object-ui/i18n run type-check VERDICT command-exit 0
ui: check:i18n-keys EXIT=0 (5898/5898 literal keys resolve) · check:i18n-drift EXIT=0 (1 key added, 0 en values changed) · check:i18n-dead-keys EXIT=0
node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (origin/main; #37249 shares the 11 locale packs and merges cleanly)
dispatch-gates --commands (after the changeset): 41 derived families; 40 run locally, all 40 exit 0
NOT MEASURED: pnpm --dir ui exec vitest run scripts/ (the ui scripts/ suite). The first run was SIGKILLed by the
shared box's OOM killer; two lock retries got queue-timeout (exit 99) behind another session's full dogfood run.
This diff edits no ui/scripts file. CI runs the suite.
dispatch-gates --ran: 41 derived, 40 run, 1 UNRUN (the line above)
```
</details>
## Acceptance notes
- `RequireAiSurface`'s `redirectTo` prop can still send the button
somewhere other than `useHomePath()`. #37204 already accepted this for
the button label, and the new sentence takes the same assumption.
- Stale prose that the card lists as not in scope (`runtime-config.ts`
`hideSingleAppSwitcher`, `approvals.json`, `studio-authoring.json:35`):
none of those files is in this diff, so none is touched.
## Verification
Local: affected suites, both ablations, type-check of the three touched
packages, the ui i18n gates, 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 7f62348 commit 6cc6177
17 files changed
Lines changed: 123 additions & 11 deletions
File tree
- .changeset
- ui
- apps/console/src/components
- packages
- app-shell/src/console
- __tests__
- ai
- 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 | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
111 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2785 | 2785 | | |
2786 | 2786 | | |
2787 | 2787 | | |
| 2788 | + | |
2788 | 2789 | | |
2789 | 2790 | | |
2790 | 2791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2505 | 2505 | | |
2506 | 2506 | | |
2507 | 2507 | | |
| 2508 | + | |
2508 | 2509 | | |
2509 | 2510 | | |
2510 | 2511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3372 | 3372 | | |
3373 | 3373 | | |
3374 | 3374 | | |
| 3375 | + | |
3375 | 3376 | | |
3376 | 3377 | | |
3377 | 3378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2577 | 2577 | | |
2578 | 2578 | | |
2579 | 2579 | | |
| 2580 | + | |
2580 | 2581 | | |
2581 | 2582 | | |
2582 | 2583 | | |
| |||
0 commit comments