Skip to content

Commit 3bbda33

Browse files
feat(console): the Studio landing is ordered by what the author came to do (#34747)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBSqEJfSXXrgRvGw4hppNUc2)_ Fixes #34715 repo:objectstack#3 · os-support-ai · session_01WGufzivEnnozveqZfr4fDx Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 改了什么:Studio 首页改成按「要做什么」排:已安装的应用在最前,每张卡有「定制」按钮、不再显示「只读」和包 ID,没改动时写「还没有改动」;接着是「自己的应用」和「新建自己的应用」;最后是「不属于某个应用」:「岗位与权限」(原「环境目录」)和「未归属的流程 N」(为 0 时不显示)。说明缩成一句。托管环境里的系统包(`sys.` 开头)不再出现在「已安装的应用」里。 - 为什么改:最常做的事(改已安装的应用)原来排在最下面还标着「只读」;「可写基座」「.custom 定制包」「组织流程」「环境目录」是架构叫法。 - 风险与回滚:只改首页的顺序、文案和一个按钮,不改路由、权限、存储;新增 14 个界面文案键(en/zh)。回滚即还原本 PR。 - 先看:`ui/packages/app-shell/src/views/studio-design/BuilderLanding.tsx`(未归属流程计数与 0 时隐藏那段 effect、已安装卡片);`ui/packages/i18n/src/namespaces/studio/zh.ts`(新文案)。 - 两分钟验证:中文界面打开 `/_console/studio`,应看到第一块「已安装的应用」,卡片上有「定制」按钮,页面正文里没有「.custom」「基座」「只读」。 - 需要你做的:无,席位落地。 ## What changes The Studio landing (`BuilderLanding.tsx`) is ordered by what the author came to do, and its copy says what they can do instead of naming the package mechanism. - **A system package is not an installed app** (card comment 6943119575). A kernel package the server lists flat with a `system` / `cloud` scope stays in the package list tagged `kernel` (`parsePackages`); the landing drops it by that tag, the same predicate #34677's `offeredPackages` applies to the switcher (#34593). A manifest-scoped kernel package was already left out of the list. - **Installed apps lead the page**, also when there are recent visits ("Recently viewed" now follows the author's own apps, among the other entries). One hint line under the heading: the app is upgraded by its vendor, the author's changes are kept separately. Each card carries a **Customize** button that opens the app in Studio exactly as clicking the card does (`/studio/<id>/data`). The Read-only badge is gone; the package id is no longer on the card's face (it is the card's `title`). Zero changes read "No changes yet" instead of "0 customized, 0 switched off". The marketplace link sits beside the heading. - **Your own apps** follow, with the create card renamed **New app of your own** (was "New package (writable base)") and a one-line description; the old empty state "No writable packages yet" is replaced by that card. - **Outside any app** comes last: **Positions and permissions** (was "Environment catalog"; still opens `/studio/~all/metadata`, ADR-0146 D1, name and description only) and **Flows in no app N** (was "Organization flows"). The count comes from `loadPackageLessSurfaces(client, 'flow', locale)`, the same read the `/studio/~org/automations` scope uses; the card is hidden when the count is 0, and shows without a number if the read fails. - The lead is one sentence. - 14 new keys in the studio namespace (en + zh, `ui/packages/i18n/src/namespaces/studio/`); no edit to the eager `locales/en.ts`, no second loader. Superseded keys stay in the catalogue (listed in the changeset); `engine.studio.org.name` and `engine.studio.pkg.new` are still read by `PackageSwitcher`. - Checklist item `studio-authoring.org-scope-flows` (revision 4) now opens the org scope directly when no package-less flow exists, since the landing draws no entry then. A CLI integration test's comment names the new heading key. No route, permission or storage change. ## Tests <details><summary>New and updated tests (11 landing files, 63 tests pass)</summary> - New `BuilderLanding.taskOrder-34715.test.tsx` (7): two flat `sys.*` rows parsed by the real `parsePackages` (control: both tagged `kernel`) draw no card, no Customize and no name (fails with the filter removed); heading order; Customize opens `/studio/app.objectstack.hotcrm/data`; no id on the card face, id in `title`, lines `6 customized, 1 switched off` / `No changes yet`; Positions and permissions → `/studio/~all/metadata`; en body has no `.custom` / `read-only` / `writable base`; zh body has none of `.custom` / `基座` / `只读` and shows `未归属的流程2`. - `BuilderLanding.orgScope-11553`: count 2 + navigation, hidden at 0, no number when the read fails. - `BuilderLanding.recentPackages-11863`: new case, with a recent visit the h2 order is Installed apps, Your own apps, Recently viewed, Outside any app. - `customizationCounts-28566`, `customizeCopy-29489`, `environmentOverlayCopy-12171`, `accessibleNames-12510`, `newPackageDeepLink-26614`, `setupExit-12513`: pins moved to the new copy and test ids; each file doubles the package-less flow read so no request leaves it. </details> ## Acceptance notes Premise lines of #34715 measured on `origin/main` f6f5b50 before this PR: the lead (`engine.studio.landing.description`, zh :3005), 「我的软件包(可写)」/「还没有可写软件包」/「新建软件包(可写基座)」, the org-scope card (`BuilderLanding.tsx:438`) and env-catalog card (:457) under 「不属于软件包」, and the installed section last (:485) with the read-only badge (:518) and the id on the card face (:515) all hold as written. `check-prior-rulings --card 34715`: thread none; ADR-0146 D1 (positions and permissions stay in Studio) is honoured by renaming only. Live readings (real showcase backend `objectstack dev --fresh`, console from this branch's source, zh-CN and en). Scripts, readings and screenshots: `/mnt/project-files/objectstack-seat3/34715-live/` (project share). 1. zh-CN body has no 「.custom」「基座」「只读」; first block 已安装的应用; the card shows 定制 and 还没有改动, no id. With a recent visit the h2 order is 已安装的应用 / 自己的应用 / 最近访问 / 不属于某个应用 (en: Installed apps / Your own apps / Recently viewed / Outside any app). 2. No package-less flow: no 未归属的流程 card. After two package-less flows were written through `PUT /api/v1/meta/flow/<name>` (200): 未归属的流程 2 / Flows in no app 2, clicking opens `/studio/~org/automations`. 3. Hosted-environment system packages: the real `GET /api/v1/packages` answer with two flat rows appended (`sys.package-state` scope `system`, `sys.env-artifact-cache` scope `cloud`): installed cards `["com.example.showcase"]`, no `sys.*` card, no system package name in the body, en and zh. Before-leg with the filter removed, same stand-in: the two `sys.*` cards draw. 4. Customize → `/studio/com.example.showcase/data`; 岗位与权限 / Positions and permissions → `/studio/~all/metadata`. At 375 px the page has no horizontal scroll and Customize is 48×44 px. Scope note: the card's step 1 names a "customizations in this environment" block between installed apps and the rest; that is #34714, which builds on this PR. ## Verification <details><summary>Gates (on d247d94; the delta to 19bfd59 re-ran landing tests, app-shell type-check, ESLint, test-source-alias, changeset-fixed, overlap-check, all exit 0)</summary> - `pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/BuilderLanding`: 11 files, 63 tests pass on 19bfd59. - studio-design directory: 334/335 files pass in the full run; `DataPillar.validationVerdictHold-27644` (e) timed out at 15 s under shared-box load and passes alone (9/9); the file is untouched here. - metadata-admin 4 files 156 pass; `@object-ui/i18n` 102 files, 1894 pass, 13 skipped. - `pnpm --filter @object-ui/app-shell run type-check` and i18n type-check: exit 0. ESLint on changed files: exit 0. - Derived gates (`dispatch-gates --commands`, 70): all exit 0. Three were first red for environment reasons and re-run green: `check-plugin-teardown-shape --self-test` (shallow clone, 48 cases pass after fetch), `vitest run scripts/` in ui (SIGKILL under memory; 171 files / 5077 tests pass at `--maxWorkers=2`), `check:dual-build-cjs-loads` (needed spec+lint+rest+cli dist; 124 entries load after a serial build). `check:test-source-alias` red on two edited tests, fixed by a module-top `import '@objectstack/lint'`. - Console build exit 0; `pnpm check:eager-closure` exit 0. **i18n-locale-en: 60.2 KB of the 60.5 KB ceiling** (0.4 KB headroom; this PR does not touch `locales/en.ts`). Aggregate 1892.9 KB / 2431.6 KB. - `pnpm check:changeset-fixed` exit 0; `check:new-line-citations`: 0 new citations; platform-checklist and type-check-debt OK. - `scripts/pm/overlap-check.mjs --branch=HEAD`: VERDICT clean (#34677 shares the studio en/zh files and merges cleanly). </details> Deviations: the branch is this thread's pinned branch `claude/project-thread-eqwj27`, not `claude/issue-34715-*`. The author's own (writable) cards keep their id and Writable badge; the card's hide-the-id item names installed cards only. ## 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; ESLint passes on every changed file. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [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. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzivEnnozveqZfr4fDx --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1ee3bb8 commit 3bbda33

15 files changed

Lines changed: 615 additions & 199 deletions
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/i18n': patch
3+
---
4+
5+
feat(console): the Studio landing is ordered by what the author came to do, and its copy says what they can do
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
The Studio landing (`/studio`, the App Builder) used to open with a paragraph about writable packages and `.custom` customization packages, list the author's writable packages, then two entries named for the architecture ("Organization flows", "Environment catalog"), and put the installed apps, the likeliest thing to change, last, each with a Read-only badge and its package id. Now:
11+
12+
- **Installed apps come first**, even when there are recent packages: "Recently viewed" now follows the author's own apps. The section says in one line that each app is upgraded by its vendor and the author's changes are kept separately. Each card carries a **Customize** button that opens the app in Studio, as clicking the card does; it no longer shows a Read-only badge or the package id (the id is the card's title). A card whose app has nothing changed says "No changes yet" instead of "0 customized, 0 switched off". The marketplace link sits beside the section heading as "Install from the marketplace".
13+
- **A system package is not an installed app.** A kernel package the server lists flat with a `system` or `cloud` scope (a hosted environment's `sys.*` packages) no longer draws a card under Installed apps, by the same `kernel` tag the Studio package switcher reads.
14+
- **The author's own apps follow**, with the create card renamed "New app of your own" (was "New package (writable base)").
15+
- **Entries outside any app come last.** "Environment catalog" is now **"Positions and permissions"** ("Positions, permission sets and sharing rules, shared by every app."); it still opens the same Studio area (ADR-0146 D1 keeps these editors in Studio). "Organization flows" is now **"Flows in no app"**, shows how many there are, and is drawn only when there is at least one; when the count cannot be read the entry is drawn with no number.
16+
- The page's lead is one sentence about what the author can do. In Chinese the landing body no longer carries 「.custom」「基座」「只读」.
17+
18+
No route, permission or storage changes. The widening is new keys in the `studio` namespace (`en`, `zh`): `engine.studio.landing.lead`, `.appsHeading`, `.appsHint`, `.marketplaceInstall`, `.customizeTitle`, `.customizations.none`, `.ownHeading`, `.newApp`, `.newAppDescription`, `.outsideHeading`, `.rolesPermissions.name`, `.rolesPermissions.description`, `.unassignedFlows.name`, `.unassignedFlows.description`; no key is removed or renamed. The landing no longer reads `engine.studio.landing.description`, `.mineHeading`, `.noneWritable`, `.installedHeading`, `.readonlyHint`, `.marketplace`, `.orgHeading`, `.envCatalog.name`, `.envCatalog.description` and `engine.studio.org.description`; they stay in the namespace. `engine.studio.org.name` and `engine.studio.pkg.new` are still read by the package switcher, unchanged.

‎docs/qa/platform-checklist/areas/studio-authoring.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2697,7 +2697,7 @@
26972697
"title": "Flows outside any package have their own Studio scope: /studio/~org offers only the Automations pillar, lists only package-less flows, opens them editable, saves drafts bound to no package and publishes each by reference",
26982698
"since": "v18",
26992699
"status": "active",
2700-
"revision": 3,
2700+
"revision": 4,
27012701
"priority": "P2",
27022702
"surface": "mixed",
27032703
"personas": [
@@ -2711,7 +2711,7 @@
27112711
]
27122712
},
27132713
"steps": [
2714-
"with no package-less flow yet, open the Studio landing's 'Organization flows' entry: it lands on /_console/studio/~org/automations, offers one pillar only, no Create app, and an empty state that names the way to change a packaged flow ('No flows outside a package. To change a packaged flow, open its package and use New similar.', engine.studio.org.none) with no action and no link out of Studio (StudioDesignSurface.tsx, the auto-empty state: since ADR-0146 D11 no Setup page copies into this scope)",
2714+
"with no package-less flow yet, open /_console/studio: the landing draws no 'Flows in no app' entry (it is drawn only when there is at least one such flow, with the count); open /_console/studio/~org/automations directly: it offers one pillar only, no Create app, and an empty state that names the way to change a packaged flow ('No flows outside a package. To change a packaged flow, open its package and use New similar.', engine.studio.org.none) with no action and no link out of Studio (StudioDesignSurface.tsx, the auto-empty state: since ADR-0146 D11 no Setup page copies into this scope)",
27152715
"write the package-less flow (fixtures.requires[1]); reload: the rail lists qa_org_raw and none of the showcase's packaged flows; GET /api/v1/meta/flow?package=com.example.showcase omits it, the unscoped list includes it",
27162716
"open it: the canvas and the Enabled switch are editable; change a node label; let the autosave land; read GET /api/v1/meta/_drafts?type=flow — the draft row carries no package",
27172717
"Publish → the review sheet lists only package-less flow drafts → Publish all; capture the network trace",
@@ -2768,7 +2768,8 @@
27682768
"change": "negative[1] moved to source[3]: it was a scope note naming the items that own the neighbouring surfaces, which no run can decide, so it could only score skipped. Its text is unchanged except the SCOPE: label, which now reads cross-ref:, the spelling the sibling source rows use. Ruling 6545938831 item ① on #28345 (scope notes leave negative[], which keeps only decidable entries; the #27651 precedent). No clause changed. Wave anchor #27377",
27692769
"ref": "#28345"
27702770
},
2771-
{ "revision": 3, "date": "2026-11-03", "change": "fixtures.requires[1] names a fixture that still makes a package-less flow, and steps[0], steps[1], steps[4], acceptance[0].verify and source[1] follow it. Since #28149 (ADR-0146 D4) the clone door lands its copy in the source's pair <base>.custom, so QA run #29672's clone of showcase_urgent_task_alert answered packageId com.example.showcase.custom and made no package-less flow; the run substituted PUT /api/v1/meta/flow/qa_org_raw naming no package (200) and passed every clause on it. Read at base 339f63da30: ADR-0146 D11 closes a package-less write only onto an item a code package ships (packagelessOverlayWriteRefusal), so a fresh name stays writable, and a PUT with no ?mode= is an active save (meta-save-request.ts). The same run found steps[0]'s empty state stale: it now reads engine.studio.org.none with no Open in Setup link (StudioDesignSurface.tsx). The clauses are unchanged. Card #29679, from QA run #29672", "ref": "#29679" }
2771+
{ "revision": 3, "date": "2026-11-03", "change": "fixtures.requires[1] names a fixture that still makes a package-less flow, and steps[0], steps[1], steps[4], acceptance[0].verify and source[1] follow it. Since #28149 (ADR-0146 D4) the clone door lands its copy in the source's pair <base>.custom, so QA run #29672's clone of showcase_urgent_task_alert answered packageId com.example.showcase.custom and made no package-less flow; the run substituted PUT /api/v1/meta/flow/qa_org_raw naming no package (200) and passed every clause on it. Read at base 339f63da30: ADR-0146 D11 closes a package-less write only onto an item a code package ships (packagelessOverlayWriteRefusal), so a fresh name stays writable, and a PUT with no ?mode= is an active save (meta-save-request.ts). The same run found steps[0]'s empty state stale: it now reads engine.studio.org.none with no Open in Setup link (StudioDesignSurface.tsx). The clauses are unchanged. Card #29679, from QA run #29672", "ref": "#29679" },
2772+
{ "revision": 4, "date": "2026-11-17", "change": "steps[0] no longer opens a landing entry when there is no package-less flow: since #34715 the Studio landing draws its 'Flows in no app' entry (formerly 'Organization flows') only when at least one such flow exists, with the count, so the step reads the entry's absence and opens the scope by its URL. The clauses are unchanged. Card #34715", "ref": "#34715" }
27722773
]
27732774
},
27742775
{

‎packages/cli/test/package-restart-acceptance.integration.test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
*
2020
* 1. Studio writable list — Studio's builder landing (objectui
2121
* `packages/app-shell/src/views/studio-design/BuilderLanding.tsx`, heading
22-
* `engine.studio.landing.mineHeading` = "My packages (writable)", empty
23-
* state "No writable packages yet") lists `fetchPackages()` filtered to
24-
* `writable`. `fetchPackages()` (`studio-design/packages-io.ts`) is ONE
22+
* `engine.studio.landing.ownHeading` = "Your own apps") lists
23+
* `fetchPackages()` filtered to `writable`. `fetchPackages()` (`studio-design/packages-io.ts`) is ONE
2524
* read: `GET /api/v1/packages`, no query parameters; `parsePackages` drops
2625
* `scope: system | cloud` rows and takes the row's top-level `writable`
2726
* boolean — the server's verdict (`withWritableVerdict` in

‎ui/packages/app-shell/src/views/studio-design/BuilderLanding.accessibleNames-12510.test.tsx‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* author sees on it (objectui#11862: label first).
66
*
77
* The 2026-10-15 test pass read the recent-package links, the writable and
8-
* installed package cards, and the "Organization flows" card as controls with
9-
* no name. The browser's computed tree names each one from its visible text;
8+
* installed package cards, and the package-less flows card (now "Flows in no
9+
* app", objectstack#34715) as controls with no name. The browser's computed tree names each one from its visible text;
1010
* these cases pin that by querying each card by role and name, so a later
1111
* restyle that hides the text from the tree (an `aria-hidden` on the label, an
1212
* icon-only card) turns them red.
@@ -40,6 +40,11 @@ vi.mock('../metadata-admin/PackageFormDialog', () => ({ PackageFormDialog: () =>
4040
vi.mock('./packageCustomizations-io', () => ({
4141
fetchPackageCustomizationCounts: vi.fn(() => new Promise<never>(() => {})),
4242
}));
43+
// One flow belongs to no package, so the landing draws that entry (objectstack#34715).
44+
vi.mock('./packageSurfaces', async (importOriginal) => {
45+
const mod = await importOriginal<typeof import('./packageSurfaces')>();
46+
return { ...mod, loadPackageLessSurfaces: vi.fn(async () => [{ type: 'flow', name: 'org_flow', label: 'Org flow' }]) };
47+
});
4348

4449
import { BuilderLanding } from './BuilderLanding';
4550
import { RecentItemsProvider } from '../../context/RecentItemsProvider';
@@ -90,11 +95,12 @@ describe('Studio home cards carry their visible label as their name (objectui#12
9095

9196
// The writable card: its label leads the name; the api name follows it.
9297
expect(screen.getByRole('button', { name: /^Acme CRM\b/ })).toBeInTheDocument();
93-
// The installed (read-only) card.
94-
expect(screen.getByRole('button', { name: /^HotCRM\b.*Read-only/ })).toBeInTheDocument();
95-
// The organization's flows.
96-
expect(screen.getByTestId('studio-landing-org-scope')).toHaveAccessibleName(/^Organization flows/);
97-
expect(screen.getByRole('button', { name: /^New package/ })).toBeInTheDocument();
98+
// The installed (read-only) card: its label, and its Customize button named for it.
99+
expect(screen.getByRole('button', { name: 'HotCRM' })).toBeInTheDocument();
100+
expect(screen.getByRole('button', { name: 'Customize HotCRM' })).toBeInTheDocument();
101+
// The flows that belong to no package.
102+
expect(await screen.findByTestId('studio-landing-org-scope')).toHaveAccessibleName(/^Flows in no app/);
103+
expect(screen.getByRole('button', { name: /^New app of your own/ })).toBeInTheDocument();
98104

99105
// No button or link on the page is left without a name.
100106
const unnamed = [...screen.getAllByRole('button'), ...screen.getAllByRole('link')].filter(

‎ui/packages/app-shell/src/views/studio-design/BuilderLanding.customizationCounts-28566.test.tsx‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*/
1313

1414
import '@testing-library/jest-dom/vitest';
15+
// The source under test reaches `import('@objectstack/lint')`: paid here, at collection, never inside a test's clock.
16+
import '@objectstack/lint';
1517
import * as React from 'react';
1618
import { afterEach, describe, expect, it, vi } from 'vitest';
1719
import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
@@ -138,14 +140,27 @@ describe('Studio landing: a read-only base says "n customized, m switched off" (
138140
expect(customizationRequests(requested)).toEqual(['/api/v1/packages/hotcrm/customizations']);
139141
});
140142

141-
it('reads a base with no pair as "0 customized, 0 switched off", with no pair link', async () => {
143+
it('reads a base with nothing changed as "No changes yet", with no number and no link (objectstack#34715)', async () => {
142144
packages.list = [SHOWCASE];
143145
stubWire({ 'com.example.showcase': served('com.example.showcase', 0, 0, 0) });
144146
renderLanding();
145147

146148
const line = await within(await waitFor(() => cardOf('Showcase'))).findByTestId('studio-landing-customizations');
147149
await waitFor(() => expect(line).toHaveAttribute('data-state', 'read'));
148-
expect(line).toHaveTextContent('0 customized, 0 switched off');
150+
expect(line).toHaveAttribute('data-changes', 'none');
151+
expect(line).toHaveTextContent(t('engine.studio.landing.customizations.none', 'en-US'));
152+
expect(line.textContent).not.toMatch(/\d/);
153+
expect(within(line).queryByRole('link')).not.toBeInTheDocument();
154+
});
155+
156+
it('reads a base with no pair and one switched-off item as "0 customized, 1 switched off", with no pair link', async () => {
157+
packages.list = [SHOWCASE];
158+
stubWire({ 'com.example.showcase': served('com.example.showcase', 0, 0, 1) });
159+
renderLanding();
160+
161+
const line = await within(await waitFor(() => cardOf('Showcase'))).findByTestId('studio-landing-customizations');
162+
await waitFor(() => expect(line).toHaveAttribute('data-state', 'read'));
163+
expect(line).toHaveTextContent('0 customized, 1 switched off');
149164
expect(within(line).queryByTestId('studio-landing-customizations-pair')).not.toBeInTheDocument();
150165
expect(within(line).getByText(customizedText(0))).not.toHaveAttribute('href');
151166
expect(within(line).getByTestId('studio-landing-customizations-switched-off')).toHaveAttribute(
@@ -220,9 +235,9 @@ describe('Studio landing: a read-only base says "n customized, m switched off" (
220235
* line and link. The pair's export and delete stay on the Packages page.
221236
*/
222237
describe('Studio landing: a base’s .custom pair has no card of its own (ADR-0146 D3)', () => {
223-
/** Every package card the landing draws, by the id line each card shows. */
238+
/** Every package card the landing draws, by the package id each card carries. */
224239
const cardIds = () =>
225-
Array.from(document.querySelectorAll('.rounded-lg.border .font-mono')).map((el) => el.textContent);
240+
Array.from(document.querySelectorAll('[data-package-id]')).map((el) => el.getAttribute('data-package-id'));
226241

227242
it('draws one card for a base and its writable pair: the base’s, with its customized count and the pair link', async () => {
228243
packages.list = [HOTCRM, HOTCRM_PAIR, WRITABLE];
@@ -238,7 +253,7 @@ describe('Studio landing: a base’s .custom pair has no card of its own (ADR-01
238253
expect(screen.queryByText('HotCRM customizations')).not.toBeInTheDocument();
239254
expect(cardIds()).not.toContain('hotcrm.custom');
240255
// CONTROL: a writable package that is no pair keeps its card.
241-
expect(cardIds()).toEqual(['com.acme.app', 'hotcrm']);
256+
expect(cardIds()).toEqual(['hotcrm', 'com.acme.app']);
242257
});
243258

244259
it('folds a read-only pair under its listed base too', async () => {

‎ui/packages/app-shell/src/views/studio-design/BuilderLanding.customizeCopy-29489.test.tsx‎

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
* A package-less write onto an item a read-only package ships answers 403
88
* NOT_OVERRIDABLE and names the base's `.custom` pair. The landing's page
99
* description and its read-only section hint used to send the user there
10-
* ("customize them with an environment overlay"). They now name Customize and
11-
* New similar, saved in the package's `.custom` customization package.
10+
* ("customize them with an environment overlay"). objectstack#34715 then
11+
* reworded both to say what the author can do, naming no mechanism: the open
12+
* route is the Customize button each installed app's card carries.
1213
*
1314
* Read off the real `BuilderLanding`, rendered in English and in Chinese with a
1415
* read-only package listed, so both strings are on the page. The expected
15-
* words are the tables' own: the Customize and New similar action labels.
16+
* words are the tables' own: the Customize action label.
1617
*/
1718

1819
import '@testing-library/jest-dom/vitest';
20+
// The source under test reaches `import('@objectstack/lint')`: paid here, at collection, never inside a test's clock.
21+
import '@objectstack/lint';
1922
import * as React from 'react';
2023
import { afterEach, describe, expect, it, vi } from 'vitest';
2124
import { cleanup, render, screen } from '@testing-library/react';
@@ -96,30 +99,20 @@ function descriptionElement(): HTMLElement {
9699
return description;
97100
}
98101

99-
describe('Studio landing: a read-only package is customized in its .custom package (objectstack#29489)', () => {
102+
describe('Studio landing: a read-only package is customized through its Customize button, never an overlay (objectstack#29489)', () => {
100103
for (const [locale, lang] of LOCALES) {
101-
it(`${locale}: the description and the read-only hint name Customize, New similar and the .custom package, never an overlay`, async () => {
104+
it(`${locale}: the description and the installed-apps hint offer no overlay, and the card carries Customize`, async () => {
102105
await renderLanding(lang);
103106
await screen.findByText('Showcase');
104107

105-
const customize = row('engine.studio.customize.action', locale);
106-
const newSimilar = row('engine.studio.auto.newSimilar.action', locale);
107108
const shown = [
108109
descriptionElement().textContent ?? '',
109110
screen.getByTestId('studio-landing-readonly-hint').textContent ?? '',
110111
];
112+
expect(shown).toEqual([row('engine.studio.landing.lead', locale), row('engine.studio.landing.appsHint', locale)]);
113+
for (const text of shown) expect(text).not.toMatch(ENVIRONMENT_OVERLAY);
111114

112-
// The rendered text is the table's row, so the landing reads these keys.
113-
expect(shown).toEqual([
114-
row('engine.studio.landing.description', locale),
115-
row('engine.studio.landing.readonlyHint', locale),
116-
]);
117-
for (const text of shown) {
118-
expect(text).not.toMatch(ENVIRONMENT_OVERLAY);
119-
expect(text).toContain('.custom');
120-
expect(text).toContain(customize);
121-
expect(text).toContain(newSimilar);
122-
}
115+
expect(screen.getByTestId('studio-landing-customize')).toHaveTextContent(row('engine.studio.customize.action', locale));
123116
});
124117
}
125118
});

0 commit comments

Comments
 (0)