Repository navigation
Commit cd51dbb
feat(studio): the top bar reads ‹ Back to app · APP · Studio; home icon, package switcher and Open app removed (#36519)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JpRoUZGqtwqMU5k7b4C58D)_
Fixes #36501
Clause-②: no
Metadata-protocol: none
## 维护者速读
- Studio 的设计人员会看到:左上角从「首页图标 + 应用切换」变成「‹ 返回应用 · 应用名 ·
Studio」,右上角的「打开应用」没有了,点返回会回到进 Studio 之前那一页。
- 为什么做:外壳专题(去掉顶栏和平台首页)第 12 项,按设计板图 47 让 Studio 的出口只剩一个、回到原来的应用。
- 出错会怎样:设计人员点返回可能到错页面或回到默认首页;改动只在界面层,直接撤回这次合并即可恢复原样。
- 要你做什么:这次改动行数超过三千行(大部分是删掉随切换器一起退场的旧测试),按规则需要你本人批准后才能合并。
## What changes
- `StudioBackToApp` (new) draws the top bar's left end: 「‹ Back to app」,
the app's name, and the "Studio" mark. Where it goes, first match wins:
1. **Came from an app** — `ConsoleLayout` records the app page in view
on every app route (`utils/appReturnPage.ts`, module memory, never
browser storage); the link names that app and returns to that exact
page, query and hash kept.
2. **Opened directly** (a Studio URL in a new tab, a reload — module
memory starts empty) — the package's first **published** app, on its
first screen (`/apps/PACKAGE` for a one-app package, `/apps/APPNAME` for
the first of several, the same addressing the removed Open app used).
3. **No published app** (none, or a draft-only app, which has no running
front-end) and the organization-flows scope — 「‹ Back to app」 with **no
name**, to the console's default landing (`useHomePath()`: the declared
default app, else the single app, else the launcher — the same policy
`/` resolves).
Leaving asks first when a pillar holds unsaved work
(`confirmLeavePillar`, the header's existing guard).
- Removed from the top bar: the Studio-home button, the package switcher
(`PackageSwitcher` component), and the top-right Open app
(`StudioOpenApp.tsx`, deleted). `PackageSwitcher.tsx` keeps only the
three helpers other code still imports (`PACKAGE_LIST_TOAST_ID`,
`STUDIO_LANDING_PATH`, `fetchInstalledPackageRow`); `offeredPackages`
and `STUDIO_PKG_READONLY_WORD` had no other reader and went with it.
- i18n (studio catalogue, en + zh): `engine.studio.backToApp` (Back to
app / 返回应用), `engine.studio.backToAppTitle`,
`engine.studio.backToAppTitleNoApp`, `engine.studio.mark`; the three
Open app keys are removed; `engine.studio.app.willOpenAfterPublish`
names 「Back to app」 instead of Open app.
- Untouched: the pillar switcher, the rails, the right slot / AI panel,
Changes and Publish. The report/widget publish region (#36420's) is not
touched.
## Tests
- New `StudioDesignSurface.backToApp-36501.test.tsx` (real surface +
real metadata client over a fetch stub): came-from-app names that app
and returns to its page with the query; an app other than the package's
own is the one named; opened directly names the published app and lands
on its home; several apps → the first, by name; no app → no name, to the
landing; draft-only app counts as none; the home icon, the switcher and
Open app are absent; narrow-bar classes (the name truncates, the link
and the mark do not); `studioBackTarget` order unit cases.
- `pillarNavGuard`: the Studio-home guard case became 「Back to app」 —
dirty → confirm, cancel keeps the matrix edit, confirm leaves; clean →
no prompt.
- New `fetchInstalledPackageRow-7881.test.ts`: the objectui#7881 /
objectui#7938 wire cases, asserted at the helper the Studio landing's
Manage still reads.
- Updated (each asserted on a removed control): `homeLoop-12513`,
`narrowHeader-12509`, `desktopHint-11795`, `entryReadsOnce-11797`,
`noAppPackageLabel-12718`, `notFound-26708`, `readOnlyPosture-12453`,
`kernelReadOnly-29567`, `packageLessFlows-11553`, `oneSurface-28572`,
`autosaveSwitch-11232`, `packageListErrorPosture`; e2e live
`studio-customize-journey` (read-only chip line) and
`studio-object-designer` (F1, the switcher's create-package refresh,
removed).
- Deleted (their subject code is deleted): `openApp-34593` (its
kernel-row list CONTROL moved into the new file), `narrowChip-12611`,
`packageDeletionInference`, `manageSnapshotRefresh` (the switcher's own
`onManageChanged`), `packageLookupFailure`, `packageUserMessage` (their
wire cases moved to `fetchInstalledPackageRow-7881`).
- `homeRecoveryRedirectsFollowDeclaration-7373`: the Studio site now
reads `StudioBackToApp.tsx` (where the header's no-app landing reads
`useHomePath()`); its behavioural pointer moves from the deleted
`packageDeletionInference` to the new back-link test.
- Six edited surface tests gained the module-top `import
'@objectstack/lint'` that `check:test-source-alias` asks of an edited
file reaching the surface.
<details><summary>Local gate readings (derived by
<code>dispatch-gates.mjs --commands</code>, HEAD a07beaa)</summary>
37 derived `check:*` / self-test commands ran outside the lock: 35 at
EXIT=0; `check:test-source-alias` was red (EXIT=1, the six files above)
and is green after the fix (`check-test-source-alias OK — ... the source
reach judged 36 test file(s) changed since 9abc732`);
`check:type-check-debt` exited 3 (its closure build waits on the shared
verification lock and did not get it): NOT MEASURED locally, CI runs it.
`check:nul-bytes` OK (27026 files, no raw control bytes).
</details>
- **NOT MEASURED locally: the vitest run of `views/studio-design/`, the
7373 scan, `layout/`, and the app-shell `type-check`.** The shared
verification lock was held by a full dogfood battery for over 75
minutes, then by a ten-deep build queue; every acquisition this round
timed out. The readings land in the `os-dev-report` comment on #36501 if
a later acquisition succeeds; CI's Test UI and type-check runs are the
verdict otherwise.
## Acceptance notes
- **Size**: +/- lines exceed 3,000 (mostly deletions of the switcher and
its pins), so this lands the Tier H way (an authorized approval).
- **Lost from the Studio top bar with the switcher** (all still
reachable on the Studio landing, which the app sidebar's "Build with AI"
opens): New package, Package info and settings, the organization flows
entry, and the chip's read-only lock (the item header's read-only mark
stays in every pillar) and package-list failure marker (the failure
still toasts on the shared id).
- Opened directly, the old Open app landed on the surface in focus
(`?surface=`, e.g. that object's list); 「Back to app」 lands on the app's
first screen, as the card asks. The `app-shell` README paragraph on the
way back is rewritten to match.
- The package name is no longer printed in the top bar; for a package
with no app nothing names it there.
- Now-unreferenced switcher catalogue keys
(`engine.studio.pkg.switchTitle`, `pkg.heading`, `pkg.none`, `pkg.new`,
`pkg.withPair`, `org.hint`, `pkg.manage`) are left in place for a
dead-key sweep; `packageApp`'s `icon` / `branding` (read only by the
removed chip) are left as well.
- **NOT MEASURED: browser before/after screenshots and the 1280 / 1440
no-wrap reading** the card asks for — no browser run in this container
this round (the shared verification lock was held by a full dogfood
run). The no-wrap contract is pinned by class in the new test.
## Verification
Read first: `StudioBackToApp.tsx` (`studioBackTarget`, the three-way
order), `ConsoleLayout.tsx` (the one recording effect), the header block
in `StudioDesignSurface.tsx`.
Two-minute check: open an object's list in an app, enter Studio from it,
click 「‹ Back to app」 — you land on the same list; reload Studio and
click again — you land on the package app's first screen.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRY38EZf38Yy3zthbY -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0d4f190 commit cd51dbb
37 files changed
Lines changed: 925 additions & 3418 deletions
File tree
- .changeset
- ui
- e2e/live
- packages
- app-shell
- src
- __tests__
- layout
- utils
- views/studio-design
- i18n/src/namespaces/studio
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
169 | 171 | | |
170 | 172 | | |
171 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
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 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
205 | 216 | | |
206 | 217 | | |
207 | 218 | | |
| |||
| 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 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments