Skip to content

feat(ui): New Package offers 「同时创建应用」 / Also create an app, ticked by default - #37338

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-37134-create-package-also-app
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-37134-create-package-also-app

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37134
Clause-②: no
Metadata-protocol: none

维护者速读

  • 在设置的「软件包」页点「新建软件包」,或从「添加应用」菜单、首页等「新建空白应用」入口进到同一个对话框时,名称下面多了一个勾选项「同时创建应用」,默认勾上;勾上时一次确定就同时建好软件包和同名应用,进到 Studio 左上角显示应用名;取消勾选就和以前一样只建软件包。
  • 这是 Studio 重构专题的一步:去掉 Studio 首页以后,原来首页上一步建好包和应用的入口没了,这个勾选项把它补回到唯一的新建软件包对话框里。
  • 如果应用的名字已被别的应用占用,什么都不会写入,对话框直接说明是哪个应用占用了,可以到「高级」里改命名空间或取消勾选;软件包建好但应用没能上线时会弹提示。只改界面,不改服务器和数据,可以直接撤回。
  • 无。

What changes

Tests

  • PackageFormDialog.newAppStep-36748.test.tsx (the shared harness: real dialog, real newAppStep, real metadata client and StudioDesignSurface over a stateful fetch stub). New top-level describes, all mounting the real CreatePackageDialog:
  • PackagesPage.installedAppsUpdates-34722.test.tsx: the page's dialog stand-in now reports whether it was handed the step; three cases pin it for the admin face's button, the ?new=package door and the development face's button.
Ablations — each one red, then restored by hash

Mutations through scripts/ablation-replace.mjs (anchor must hit, on-disk counts printed), restored with git checkout HEAD -- PATH and checked by blob hash and an empty git diff HEAD. app-shell's tests import the dialog and the page by relative path, so no dist/ is in the resolution path.

# Mutation Red
A1 appStep always undefined (ticked creates no app) 4: both "ticked" cases and both "taken" cases
A2 appStep ignores the box 2: "unticked" and the taken-then-untick case
A3 the taken arm never fires 2: both "taken" cases
A4 the box resets to unticked on open 8: every case that reads the default
A5 CreatePackageDialog passes newApp={undefined} 9: the three PackagesPage door cases, every CreatePackageDialog case, the wrapper source pin
A6 ResourceListPage mounts PackageFormDialog mode="create" itself 2: both door source pins

A5's first attempt used an empty replacement, which the tool refused (nothing landed); it was re-run with newApp={undefined}. All six restore lines matched the HEAD blob.

Acceptance notes

Verification

Two-minute check: pnpm dev, open Setup → Packages, New Package, type a name, keep 「同时创建应用」 ticked, Create. Expected: the toast "Created package “NAME” and its app.", then Studio on the new package with 「‹ Back to app · NAME」 in the header. Repeat unticked: the package toast, and the header shows the package name.

Read first: PackageFormDialog.tsx (the appStep line in submit() and the checkbox in the Basics card), PackagesPage.tsx (CreatePackageDialog), then the new describes at the end of PackageFormDialog.newAppStep-36748.test.tsx.

Local runs (head 97fa2d8)

All at head 97fa2d83 unless noted; exit codes captured before any pipe.

  • vitest, PackageFormDialog.newAppStep-36748: Test Files 1 passed (1), Tests 11 passed (11); lock VERDICT command-exit 0.
  • vitest, PackageFormDialog*, PackagesPage.installedAppsUpdates-34722, CreatePackageDialog* (at 4179e152, test-only rename since): Test Files 17 passed (17), Tests 195 passed; then PackagesPage*, ResourceListPage*, EditPackageDialog*, StudioDesignSurface.createApp*: Test Files 36 passed (36), Tests 313 passed (313).
  • pnpm --filter @object-ui/app-shell type-check (src + tsconfig.test.json), after building the @object-ui/app-shell^... closure: lock VERDICT command-exit 0, 0 TS errors.
  • eslint --no-inline-config on the six touched source files: exit 0 (warnings only, all pre-existing lines).
  • pnpm --dir ui exec vitest run scripts/: Test Files 172 passed, 2 skipped (174); Tests 5130 passed. The first run on 28a9d57a failed check-test-path-roots on the new test (a local named path read as the fetch stub's URL path); fixed by the rename in 97fa2d83.
  • check:test-source-alias exit 0 · check:i18n-keys exit 0 · scripts/pm/overlap-check.mjs VERDICT clean exit 0 (merges cleanly with main and feat(studio): author context packs (ai_context) in Studio — a form, and a related-lists block scoped to each child #37315, which shares the two studio catalogues).
  • dispatch-gates.mjs --commands: 39 derived families, all run at 97fa2d83, all exit 0; --ran reconciliation: 39 derived, 39 run, 0 NOT-MEASURED (a derived zero: every row carries its exit code).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 97fa2d8386f3e440910b6eb357e8d93876e2f2fd · 2026-11-25T19:59Z

Reviewed against GitHub and the committed tree at this head, not against report 7171588755.

Shape. l1-face.mjs --pr 37338 reads CLEAN: 13 items, none flagged. The PR is open, draft, and based on main. The first line is Fixes #37134, and no closing keyword sits near another card. There is no content/docs/releases/ path and no +0/-0 file. The size is +365/−80 over 7 files. No path is governed (.changeset/**, ui/packages/app-shell/src/**, ui/packages/i18n/src/**), so this is Tier S. Fixes is right: the diff delivers all of Expected 1, 2 and 4. Expected 3 was overtaken when #36908 landed first and removed the landing door.

Card fit and reach. In create mode with a step, PackageFormDialog draws 「同时创建应用」 / "Also create an app". useState(true) sets it, and so does setAlsoApp(true) in the open effect, so it is ticked on every opening. Submitting runs appStep = offersApp && alsoApp ? newApp : undefined. Ticked, that is the #36748 reserve → package POST → app draft → publish path, unchanged. Unticked, it sends the package POST alone. CreatePackageDialog now passes newAppStep(client, locale).

  • At head, git grep CreatePackageDialog (non-test) finds two mounts, PackagesPage.tsx:2463 and ResourceListPage.tsx:1243.
  • Every other PackageFormDialog mount is mode="edit" or mode="view": PackagesPage.tsx:705, PackagesPage.tsx:1559 and inspectors/ObjectPicker.tsx:712.
  • Outside the dialog, ui/** has no other package-create path.
  • The console's 「新建空白应用」 doors reach the dialog through useNewPackageDoorPath → Setup ?new=package.

So the default-on box reaches every create-mode door that remains.

Premise drift. Confirmed at head. studio-design/PackageSwitcher.tsx now exports only PACKAGE_LIST_TOAST_ID, and its header names #36501 as the commit that removed the top-bar switcher. The card's 「Studio package switcher」 call site no longer exists.

Declarations and changeset. I ran readClause2Line and readMetadataProtocolLine (scripts/pm/clause2-line.mjs) on three texts:

Text Clause-② Metadata-protocol
The card's newest Claim: (7169203072) declared no, arm null declared none
The PR body declared no, arm null declared none
.changeset/37134-create-package-also-app.md declared no, arm null declared none

All three read the same.

no is right. The three new keys go into the studio namespace, which is typed Record<string, string> and exported as StudioCatalogue = Readonly<Record<string, string>>. No published type gains a member, which is the card's own Expected 4 criterion. PackageFormDialog's prop types are unchanged; the removed withAppDoorWording and APP_DOOR_HELP_ROWS were module-private. @object-ui/app-shell is private: true.

none is right: nothing a metadata author writes changes. So patch for @object-ui/app-shell and @object-ui/i18n is the right level.

I read the changeset sentence by sentence against the diff:

  • The three doors.
  • "ticked each time the dialog opens".
  • The en and zh toast strings, which match createdWithApp byte for byte.
  • The taken-identifier refusal, which matches newApp.nameTaken and writes nothing.
  • The appFailed toast.
  • "Unticked: only the package is created".
  • "Where the dialog takes you afterwards is unchanged".
  • The three key names, and "No key is removed".
  • "no other props or exports change".

All hold.

Translation keys. node ui/packages/i18n/scripts/released-keys-removed.mjs --tag @object-ui/i18n@18.6.0 lists 77 keys at --ref 97fa2d83, 77 at the merge-base fbb62e1c and 77 at origin/main a182fbe3. A sorted diff of head against the merge-base is empty, so this PR removes no released key. The 77 are pre-existing.

The three new keys (engine.packages.create.alsoApp, alsoAppHint, createdWithApp) are in both studio catalogues, en and zh. "All 11 packs" does not apply here. studio is a two-catalogue key space by ruling (#25922): every other language falls back to en, and its index.ts puts it outside the 11-pack parity suite "by construction … ⛔ must never be given" an exemption. The merged tree from git merge-tree against a182fbe3, which includes #37315's edits to the same two catalogues, has no duplicate key lines in either catalogue.

Pins and ablations. I ran these in a throwaway worktree at head, with the @objectstack/* closure built (OS_SKIP_DTS=1). The worktree has since been removed.

  • pnpm exec vitest run on PackageFormDialog.newAppStep-36748.test.tsx and PackagesPage.installedAppsUpdates-34722.test.tsx: Test Files 2 passed, Tests 54 passed, exit 0. The first file has 11 cases, matching the body.
  • A5 re-run: CreatePackageDialog passes newApp={undefined}. Result: 9 failed, 45 passed. The red cases are both "ticked on every opening" cases, the three ticked/unticked/taken cases, the wrapper source pin, and the three PackagesPage door cases (New Package button, ?new=package, development face). That matches the report's 9.
  • A2 re-run: appStep = offersApp ? newApp : undefined, which ignores the box. Result: 2 failed, "unticked: only the package…" and "ticked, an app name already taken…; unticked, the package goes through". That matches the report's 2.
  • Both restores were checked by blob hash (eca3c854…, 4ff26da7…) against the HEAD blob, with an empty git diff HEAD.

Gates. The check-runs at 97fa2d83 are 58: 45 success, 13 skipped, 0 failed, 0 pending. l1-face counts the 13 as expected skips, with 0 unexpected. Lint & Repo Gates and TypeScript Type Check are both success. Test Core is skipped by design on a ui-only head.

git merge-tree --write-tree origin/main(a182fbe3) 97fa2d83 merges cleanly (tree 4fc1d786). mergeable_state is clean.

K = 10. landing-k.mjs --pr 37338 cannot answer: green run 45676342084 ran no Test Core shard, so it printed no Affected-set diff base. K is therefore read as the first-parent count from the merge-base fbb62e1c to origin/main a182fbe3, which is 10. The legs:

  • Locale leg: since the base, main has added no locale pack. Every translations/ and locales/ change on main is a modification, not an addition.
  • Label leg: this PR changes no translations/ bundle.
  • Shared-budget leg: this PR does not touch ui/**/locales/en.ts.

Accepted deviations. These are the zone's rulings in 7172708246 (2026-11-25T19:44Z):

  • Q1 A: the unread engine.studio.newApp.* rows stay, and one retirement card follows after landing.
  • Q2 A: the submit label stays "Create package" / 「创建软件包」.

Card Expected 3 was overtaken by #36908's earlier landing.

Out of scope. A Studio-only author who cannot open Setup → Packages still has no New Package door. That goes to #37139, as the body's Acceptance notes and 7172708246 record. useNewPackageDoorPath confirms this: such an author's doors lead to Studio's "All metadata", not to the dialog.

Skills-docs: is not owed (kind none, no narrowing arm). No contract review is owed. The diff touches none of the four faces: the declaration is Clause-②: no with no narrowing arm, there is no packages/spec/src/** path, and there is no governed path. reviewFace reports empty hits.schema and empty hits.rules.

维护者速读. It is accurate and follows the four-line form:

  1. Who and where: Setup's 「软件包」 page and the 「新建空白应用」 doors that reach the same dialog.
  2. The Studio redesign topic.
  3. A taken name writes nothing, and the PR is UI-only and can be reverted.
  4. 「无」.

It contains no code names, paths, commands, ruling letters or bare card numbers.

Findings

  • N1 — This diff also leaves engine.studio.newApp.created with no reader. Its only reader was the success toast at the base's PackageFormDialog.tsx:690, and head replaces it with engine.packages.create.createdWithApp; a grep at head finds 0 non-catalogue readers. Neither the PR body's Acceptance notes list nor the Q1 list in 7172708246 names it. The en catalogue comment is accurate ("the app-worded rows have no reader since"). Seat-side: the retirement card the zone files after landing should list created beside title, description, advancedHint, id, help.*, nsDerived, exists and failed. No change to this PR is needed.
  • N2 — The door source pin matches <PackageFormDialog\b[^>]*>, which stops at the first >, including the one inside an arrow =>. It only classifies a mount by mode="edit|view" when mode comes before any arrow-function prop. At head, every mount puts mode first, so the pin reads correctly. This is a fragility to keep in mind if a mount is reordered, not a defect.

No must-fix, no should-fix.

  • Landing: the zone lands it as Tier S. K = 10 (< 15, every leg clear), so there is no merge of main first. Re-read the checks and mergeable_state at 97fa2d83 right before arming.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

Landing · 2026-11-25T20:00Z · head 97fa2d83 · zone a4-S (#37134)

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 25, 2026 20:01
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit f339060 Nov 25, 2026
59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-37134-create-package-also-app branch November 25, 2026 20:31
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…etup → Packages names arrangements apart (objectstack-ai#37351)

Fixes objectstack-ai#37236

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 管理员在 设置 > 软件包 打开一个应用的详情时,「已定制」只数改过和新增的条目;只调整了排列的应用现在显示「已定制 0 项,调整排列 2
处,已停用 0 项」,不再显示「已定制 2 项」,排列明细照常列出。
- 属于 Studio 改版:按维护者裁定,「已定制」在设置详情、全部元数据页头和列表筛选里只有一个意思(覆盖 + 扩展)。
- 出错时管理员只会看到这一行数字或措辞不对,不碰任何数据,可直接撤回。
- 无。

## What changes

- **Setup → Packages detail** (`PackageCustomizationsPanel.tsx`): the
「已定制」 / "customized" count is now `customizationTotal` (overrides +
extensions), the one number the All metadata header and both lists'
「customized」 filter already read. Arrangements are named in their own
segment, `engine.packages.customizations.arranged` (en `{count}
rearranged`, zh-CN `调整排列 {count} 处`), drawn only when the count is above
0. The "No changes" line now needs all three counts at 0, so an
arrangement-only app never reads "No changes".
- Arrangement-only app: `0 customized, 2 rearranged, 0 switched off` /
`已定制 0 项,调整排列 2 处,已停用 0 项`.
  - No arrangement: unchanged, `1 customized, 0 switched off`.
- The rows (`customizationRowsOf`) and the 「布局」 tab are unchanged;
arrangements are still listed.
- **`customizedCountOf` is retired**, not fixed to delegate. Its only
job was the second meaning of 「已定制」. Keeping a second name for
`customizationTotal` would leave two doors to the same number, and the
drift this card fixes came in through that second door. Its one caller
and its one test go with it.
- **`customizationTotal` is unchanged**, and so are the header
(`DirectoryPage.tsx`) and both filters (`ResourceListPage.tsx`,
`useListOrderedNames.ts`). They gain pins, not code.
- **i18n:** one additive key in en and zh-CN. No key is removed and no
released key changes meaning
(`engine.packages.customizations.customized` keeps its text, and it has
not been released yet: it arrived with objectstack-ai#37166's unreleased changeset).
- **DELIBERATE CORRECTION of an existing changeset**,
`.changeset/36908-remove-studio-home.md` (unreleased). Its sentence "The
count now includes tab, field-group and action-layout arrangements, so
an app whose only change is a tab arrangement shows as customized."
would ship false after this change. It now reads: "Tab, field-group and
action-layout arrangements are named on their own in that line, not
counted as customized."
- No server, spec or route change.

## Tests

One pin per surface, each on an arrangement-only base fixture (two
arrangements, no override, no extension):

| Surface | Pin |
|:--|:--|
| Setup detail, en | `PackageCustomizationsPanel.test.tsx`:
arrangement-only app reads exactly `0 customized, 2 rearranged, 0
switched off`, both rows listed |
| Setup detail, zh-CN | same file: exactly `已定制 0 项,调整排列 1 处,已停用 0 项` |
| All metadata header |
`metadataAreaHost.customizations-28568.test.tsx`: no
`directory-customizations-total`, no tile, no failure line |
| ResourceListPage filter | same file: no `metadata-only-customizations`
on the arrangement-only base's list |
| useListOrderedNames filter | same file: with `?customized=1`, the ‹ ›
names keep the row (the filter is not offered), with a HotCRM control
that keeps only its customized row |

Also: no arrangement means no arrangement segment, and the mixed fixture
now reads `2 customized, 1 rearranged, 1 switched off`.

<details><summary>Targeted run (head c9c1d9e)</summary>

```
$ cd ui && pnpm exec vitest run PackagesPage.installedAppsUpdates-34722 PackageCustomizationsPanel metadataAreaHost.customizations-28568 customizationMarks
 Test Files  4 passed (4)
      Tests  77 passed (77)
os-verify-lock: VERDICT command-exit 0

# every app-shell test that reads the changed code (45 files, grep of the panel, rows, marks, header, both filters and the detail sheet), on 08fe4e46, the same diff before the last rebase over objectstack-ai#37338
 Test Files  45 passed (45)
      Tests  661 passed (661)
```
</details>

<details><summary>Ablations: each pin red alone when its own surface
counts arrangements</summary>

Each mutation adds `+ counts.arrangements` at one call site through
`scripts/ablation-replace.mjs` (anchor x1 → x0, blob changed, restored
to the HEAD blob with an empty `git diff HEAD`). The tests import
source, so there is no `dist/` leg.

```
A1 PackageCustomizationsPanel.tsx   customized: customizationTotal(read) + read.counts.arrangements
   × lists one row per change ... counts them
   × objectstack#37236: an arrangement-only app reads 0 customized beside its arrangement count ...
   × zh-CN: ... an arrangement-only app is 已定制 0 项 beside 调整排列
   Tests  3 failed | 10 passed (13)
A2 DirectoryPage.tsx header   customizationTotal(...) + counts.arrangements > 0
   × the directory header draws no total for a base whose only change is an arrangement
   Tests  1 failed | 12 passed (13)
A3 ResourceListPage.tsx showCustomizedFilter   same mutation
   × the list offers no "customized" filter to a base whose only change is an arrangement
   Tests  1 failed | 12 passed (13)
A4 useListOrderedNames.ts customizedOffered   same mutation
   × the detail ‹ › names: "only customizations" is not offered to it, so it filters nothing out
   Tests  1 failed | 12 passed (13)
each: "ok restored: blob == HEAD and `git diff HEAD` is empty"
```
</details>

<details><summary>Package suite and type-check</summary>

```
pnpm --filter @object-ui/app-shell type-check     VERDICT command-exit 0
pnpm check:type-check-debt                        re-measure: OK, 0 raw tsc errors

NARROWED, declared: the package's full `pnpm test` (2430 test files) was stopped after 70 minutes on the shared box,
26 files in. The 45-file scoped set above replaces it locally; CI's `Test UI` runs the whole package.
```
</details>

## Acceptance notes

- Wording choice: en reads `{count} rearranged`, matching the line's
other participles ("customized", "switched off") and avoiding "1
arrangements". zh-CN reads the ruling's own `调整排列 {count} 处`. The new
segment uses the line's existing separator (`, ` / `,`), not the ruling
example's ` · `, so the line has one separator.
- "Don't show a 0-count segment" is applied to the new segment only. The
customized and switched-off segments keep objectstack-ai#37166's behaviour (both
always drawn once anything is non-zero), so an arrangement-only app
still shows `0 customized`, as the card asks.

## Verification

Read first: `PackageCustomizationsPanel.tsx` (the summary line), then
the new `describe` at the end of
`metadataAreaHost.customizations-28568.test.tsx`.

Two-minute check: from `ui/`, `pnpm exec vitest run
packages/app-shell/src/views/studio-design/PackageCustomizationsPanel.test.tsx`.
Expect 13 passed, including "an arrangement-only app reads 0 customized
beside its arrangement count".

## Gates

Derived union (`dispatch-gates.mjs --commands`), run on the final head
c9c1d9e: 38 derived, 38 run, 0 NOT-MEASURED (`--ran` reconciliation
exit 0).

- 37 exit 0, plus `check:changeset-fixed` (outside the derivation, run
because `.changeset` holds its roster) exit 0.
- 1 exit 1, expected: `check-empty-changeset.mjs --base origin/main`
refuses the edit to `.changeset/36908-remove-studio-home.md`. This is
the DELIBERATE CORRECTION declared above, not a collision. The gate
stays red until the dispatching seat confirms the correction by its own
record.
- Push gates: `check:test-source-alias` exit 0, `check:i18n-keys` exit
0, `overlap-check.mjs` VERDICT clean exit 0, `check:nul-bytes` exit 0.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYngAThmzrAhkac86ye)_

<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYkkwuF6UuFtu85Yd5H -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants