Skip to content

feat(app-shell): select loose items on Studio's cross-package list and move them into a package; the Packages page counts them (#38150 PR-A2) - #38389

Draft
objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/project-thread-j4n4b0
Draft

objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/project-thread-j4n4b0

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

repo:objectstack#3 · os-tesla · session_01L9qibyHmxFV4bTFZ5BKnUz

Requested by Tesla · project thread

Part of #38150. This is PR-A2, the console's half of the move door, by the seat's claim (comment 7234216673) and its branch ruling of 16:02Z: PR-A1 (#38185, the server door) is merged, and #38149 (#38204, the package ask this PR reuses) merged at 16:01Z. PR-B1 (the retirement of adopt-orphans and its two console entries, parked as #38364 at head 1852bb898) lands after this PR, so no prerelease ships a console with no way to move loose items. PR-B2 (Studio ~org, the redirects to ?source=loose, the Q-f E classifier #38061, the ADR marks) follows.

Clause-②: yes (widening)
Metadata-protocol: none
Skills-docs: none — no skill under skills/** or .claude/skills/** teaches the console's lists or loose items; the objectstack-platform passage on package-less Setup rows is about overlays of shipped items, which are not loose (searched at this head)

Size: 1,380 lines (additions + deletions, generated files included: 1,369 added, 11 deleted, 15 files; git diff --numstat eef1cbfe4 be8e0d5dc, base main eef1cbfe4). With A1's 1,947 and B1's 3,123 the card is past 3,000 (#38280's per-card line), so this PR is Tier H.

维护者速读

  • 用户能看到什么变化:在应用工作室的跨软件包列表(/studio/~all/metadata/<类型>)里,来源下拉多了「散落项」。选它后,有编辑权限的人可以逐行勾选或全选,点「移入软件包…」,选好软件包后先看一次试运行:每一项移入后地址怎么变,或者为什么被拒。确认后整批移入。设置的「软件包」页上会提示「有 N 个散落项,不属于任何软件包」,按类型列出,点进去就是那种类型的散落项列表。
  • 为什么做:App Studio 改版专题(App Studio 改版(4-2):散落项按勾选「移入软件包」——新入口逐项过保存检查、整批判引用;收编散落项接口和 Studio「组织的流程」同时下线(关 #37468) #38150)。你裁定散落项原地保留,由一个按勾选移动的入口负责移入。服务端接口已在 A1 合并,这个 PR 做控制台入口。
  • 出错会怎样:只改控制台。移入整批进行,要么全部移入,要么一项不动;被拒时逐项给出服务端原话。最坏情况是横幅计数不准,或某个入口不显示,可以直接撤回。
  • 要你做什么:这张卡总行数超过 3000 行,属于 Tier H,需要你经 os-zhuang 批准。

What changes

The "Loose" source value (metadataListState.ts, ResourceListPage.tsx, useListOrderedNames.ts).

  • ?source=loose joins the list's address state. On the cross-package leg (allLeg: an area host with no package, outside the environment scope) the list offers it, as "Loose (N)" in both the Studio and the Setup toolbars.
  • A row is loose by isPackageLessItem on its served _packageId (absent, '', or the sys_metadata sentinel), the card's "never classifyProvenance": that classifier also files a .custom pair item and a served overlay as runtime, so "Modified and new" holds them and "Loose" does not.
  • The row reader gains an optional loose member. Absent, as on a package's own leg, source=loose reads as every source, the way an unoffered filter does. The detail's ‹ › order reads the same member, so prev and next agree with the list.

Select and move (ResourceListPage.tsx, looseMove.ts, LooseMoveDialog.tsx).

  • Under "Loose", a person who may author (useCanAuthorMetadata, and not walled) gets a select column first in the table and a selection bar above it: "Select all (N)" over the rows the filter shows, the count selected, and "Move into package…". A reader who may not author sees the loose rows with no select box and no bar.
  • "Move into package…" opens App Studio 改版(4-1):没有软件包的新建先问——选一个或新建一个;设置的权限集和岗位也先问;系统应用里的共享视图和报表拒绝并指路 #38149's ask with nothing pre-selected, with the move's own question and explanation (PackageCreateAsk takes an optional title and description; the create's are unchanged). "New package…" in the ask works as it does for a create.
  • The confirm step asks the door's dry run (POST /api/v1/packages/:id/move-in with dryRun: true) and draws its answer:
    • would_move: each item, (draft only) where only a draft moves, the address change (_env/NAME → NAMESPACE/NAME) and the AI face name change where the door reports them. Two notes follow. The first is the dry-run caveat: some save checks run only on the real move, and if one refuses, nothing moves. The second is L2's N4 (record 7236830081): reverting the move's package commit takes the items out of the package and does not make them loose again.
    • refused: each refused item with the door's own code and sentence. For REFERENCE_LEFT_BEHIND, "Add the loose items they use and check again" adds the references to the selection, which may be of other types, and asks the dry run again.
    • Move makes the real call. A refusal there is drawn as "The move was refused, and nothing moved". moved closes the dialog, says "Moved into PACKAGE: N." and re-reads the list.
  • The door's 422 arrives as a thrown envelope. moveLooseItems resolves it as the door's answer (error.details with outcome: 'refused'), and every other failure throws with the server's sentence, which the dialog draws with Try again.

The Packages page banner (LooseItemsBanner.tsx, PackagesPage.tsx).

  • "N items belong to no package", drawn on both faces for a person who may author, while N is above zero. Each type with loose items is listed as a link to its "Loose" list, /studio/~all/metadata/TYPE?source=loose. That is the acceptance's "from the Setup → Packages banner, a person reaches a flow's Loose list in the UI, with no typed address".
  • The count's cost, measured. No new server read. One GET /meta/:type per type that takes a runtime write (allowRuntimeCreate or allowEnvironmentOverlay; a type that takes none holds no loose item), with the type's own hide hook applied, the same rows its list counts. On the showcase boot that is 30 of the 40 served types, and the 30 reads in parallel took 366 ms. A type whose read fails is named as not counted, never folded into a smaller total.
  • The count is keyed on the types it reads and reaches the client through a ref. A first version keyed it on the client's identity, and the PackagesPage tests' per-call mock client then looped the effect and hung the app-shell suite.

i18n. 31 keys in @object-ui/i18n's studio namespace, en and zh: engine.list.sourceFilter.loose, engine.looseMove.*, engine.looseItems.*. No other locale carries the studio namespace.

Changeset. 38150-move-loose-items-console.md: @object-ui/app-shell and @object-ui/i18n patch, Clause-②: yes (widening), Metadata-protocol: none, as #38204 declared for the same kind of console widening.

Tests

New, each with its control:

file pins
ResourceListPage.looseMove-38150.test.tsx (7) ?source=loose on ~all lists exactly the package-less rows (none, '', sys_metadata), never a .custom pair item or an overlay; with no filter every row is listed. The select column and bar appear for an author, not for a reader who may not author. Select all → the ask opens with nothing picked and the move's question → the dry run carries the three items, dryRun: true → the confirm names the package by its name and shows the address change → Move resends the same items without dryRun. One row selected moves that row alone. A package's own leg ignores ?source=loose and draws no selection.
LooseMoveDialog-38150.test.tsx (5) The address change, the caveat and the undo note, then Move. REFERENCE_LEFT_BEHIND offers to add the dataset, the next check carries it, and Move moves both. A refusal with no references offers nothing to add. A refusal on the real move reads as nothing moved, and onMoved is not called. A failure that is not an answer shows its sentence and Try again.
looseMove-38150.test.ts (8) The source=loose codec round-trips, and an unknown value reads as all. loose keeps package-less rows where runtime also keeps the .custom row. With no loose member every row is kept. The 422 resolves as the answer; a 403 throws the server's sentence; the body carries dryRun only on a dry run. References are added once each.
LooseItemsBanner-38150.test.tsx (5) Per-type counts and links (/studio/~all/metadata/flow?source=loose). A type with no runtime write, and package, are not read. A failed read is named. Nothing is drawn or read for a non-author, and nothing is drawn at zero.

Ablation. With the list's loose reader set to row.source === 'runtime' (the classifier the card forbids), two cases of ResourceListPage.looseMove-38150 go red: the exact-rows case and the select-all move (its dry run then carried the pair item and the overlay). Restored, 7 of 7 pass.

Verification

Local, on this branch, after a declaration build of ./packages/** and @object-ui/app-shell's dependencies:

  • @object-ui/app-shell and @object-ui/i18n (pnpm --dir ui exec vitest run packages/app-shell packages/i18n), before the merge of main: 2,570 files, 2,569 passed and 1 skipped; 25,917 tests passed and 22 skipped. After the two display fixes, the touched files (every ResourceListPage*, the four new files, PackageCreateAsk*, all of packages/i18n) passed: 132 files, 2,048 tests passed and 13 skipped. After the merge of main and the collection imports, the four new files pass 25 of 25.
  • @object-ui/app-shell type-check (tsc --noEmit and tsc -p tsconfig.test.json) passes after the merge of main. The first run failed on looseMove-38150.test.ts's untyped vi.fn tuple, and that was fixed.
  • Derived gates. node scripts/pm/dispatch-gates.mjs --commands derives 39 families for this tree, the same 39 before and after the merge of main. 38 passed on the first run. check:test-source-alias failed on three of the new test files, which reached celAuthoring's dynamic @objectstack/lint import through packageActions.tsx. Each now has the module-top import, and the gate passes. After the merge, the four gates that read the diff against origin/main (check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check:test-source-alias) and check:undeclared-dep-imports and check:type-check-coverage were run again and pass. dispatch-gates --ran: 39 derived, 39 run, 0 NOT-MEASURED.
  • overlap-check.mjs before the first push: origin/main conflicted in ResourceListPage.tsx (the lucide import, beside feat(plugin-grid,app-shell): save the import wizard's column mapping as a shared mapping, and Manage it in Studio #38357's X) and metadataListState.ts (beside feat(plugin-grid,app-shell): save the import wizard's column mapping as a shared mapping, and Manage it in Studio #38357's targetObject filter). Both are resolved in the merge, keeping both sides. feat(studio): App Studio's package overview gets Export as a button, a Publish history tab with the revert, and is where opening a package lands #38318 shares the two i18n files and merges cleanly.

Walkthrough (a real stack)

At c27f9ab24 (the two display fixes in; the merge of main after it touches neither surface), pnpm console:build, then the showcase booted with objectstack dev --ui --seed-admin on a fresh database. Through the API: an installed writable package com.probe.zeta (name Zeta, namespace zeta), two loose flows (probe_loose_flow, probe_loose_flow2) and a loose object probe_widget, each saved with no package. Then, in the browser (Playwright, 1400×900):

  1. Setup → Packages (?face=admin) draws "4 items belong to no package" with Flow (2), Object (1), Datasource (1). The datasource is the showcase's own loose row.
  2. Flow (2) opens /_console/studio/~all/metadata/flow?source=loose: two rows, the select column, "Select all (2)".
  3. Select all, then Move into package…: the ask, Zeta picked by hand.
  4. The confirm, "Move into Zeta": each flow _env/probe_loose_flow → zeta/probe_loose_flow, the caveat and the undo note.
  5. Move: the dialog closes and the list is re-read. The API then reads both flows _packageId: com.probe.zeta, GET /meta/flow/zeta/probe_loose_flow answers 200 and GET /meta/flow/_env/probe_loose_flow 409, with no restart.
  6. The object list's Loose value, probe_widget into Zeta: refused NAMESPACE_PREFIX, "Object 'probe_widget' is missing the package namespace prefix. Rename it to 'zeta_probe_widget' (namespace = 'zeta').", Move disabled.
  7. Back on Setup → Packages: "2 items belong to no package", Object (1) and Datasource (1).

Screenshots, at device scale 2: in the project files under card-38150/a2-walkthrough/, 1-packages-banner.png … 7-banner-after.png.

Owed before landing

  • One CONTRACT_REVIEW_TIER review (the seat's).
  • Tier H: Tesla's approval via os-zhuang.
  • PR-B1 lands after this PR, restarted on a new PR from 1852bb898's commits.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz

…d move them into a package; the Packages page counts them (#38150 PR-A2)

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
… the select column has a header (#38150 PR-A2)

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
…-j4n4b0

# Conflicts:
#	ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx
#	ui/packages/app-shell/src/views/metadata-admin/metadataListState.ts
…nt load at collection (#38150 PR-A2)

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
…t a clickable span

The click-without-keyboard census counts a span with an onClick as a new
clickable non-control. The guard now sits on the checkbox, a real button.

Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-29T04:08Z

L1-a: ACCEPT for PR #38389 (Part of #38150, PR-A2) at be8e0d5dc2168c88a975d9760787db6489fdbb85. The contract-review record at TIER_DEFAULT follows in the next comment.

Scope. 15 files, +1369 −11, all under ui/packages/app-shell/src/views/metadata-admin/ plus the two studio catalogues and the changeset. All of it is inside claim 7234216673 and amendment 4 7239673373. Under that amendment A2 lands before B1, and #38364 stays parked. Part of is right, because B1 and B2 still follow.

Declarations.

  • Clause-②: yes (widening) is right:
    • @object-ui/i18n, which is published, gains 30 studio keys in en and the same 30 in zh, with key parity checked.
    • The Studio list accepts a new ?source=loose value.
    • PackageAskRequest gains optional title and description, inside the private app-shell.
  • Metadata-protocol: none is right, because nothing an author writes changes.
  • Skills-docs: none is true. No skill teaches the console lists or loose items.
  • The changeset is patch for @object-ui/app-shell and @object-ui/i18n, which Post-Task 3 gives a non-protocol widening. App-shell changesets on main do not name @objectstack/console, and this one follows them.

Code read against the A1 door.

  • What counts as loose is isPackageLessItem alone, through isLooseRow, in the list filter, the counts, the ordered-names reader and the banner. It is never classifyProvenance.
  • Where "Loose" is offered: on the cross-package leg only (allLeg, and the same predicate in useListOrderedNames). Elsewhere source=loose reads as every source, as an unoffered filter does.
  • Selecting: only for canAuthor && !walled, and the selection resets on a change of type or mode.
  • moveLooseItems posts to POST /api/v1/packages/:id/move-in. It returns a 422 whose details is a refused answer as that answer, unreworded, and throws on anything else.
  • The confirm step runs the dry run at once, a stale run is dropped by runRef, and Move is enabled only on would_move.
  • The real move: a refusal is drawn as "refused, and nothing moved". "Add the loose items they use and check again" adds only the REFERENCE_LEFT_BEHIND references the selection does not already hold.
  • The two notes (dry run, and undo through a commit revert, A1's N4) show only when the check passes. They match the door's whole-or-nothing answer.
  • The banner counts with the list's own reading: per type, its listFilter, then isLooseRow. A type whose read fails is named as not counted rather than shrinking the total. It is drawn only for an author and only above zero.
  • The ask's override: title and description fall back to the create's own text when absent, so App Studio 改版(4-1):没有软件包的新建先问——选一个或新建一个;设置的权限集和岗位也先问;系统应用里的共享视图和报表拒绝并指路 #38149's create ask is unchanged.

Nits (non-blocking):

  • N1: the success toast fills {package} with answer.targetPackageId, the id, while the confirm title uses the name. Pass looseMove.target.label for the same words.
  • N2: the banner issues one GET /meta/:type per runtime-writable type on every Packages page visit by an author. That is in line with "no new server read", and noted as a cost only.

Evidence (/mnt/project-files/card-38150/a2-report.md):

  • 25 new tests, each with a control. The ablation reds two list tests, and the full UI suite passes.
  • Derived gates 39/39, 0 NOT MEASURED.
  • The showcase walkthrough has 7 screenshots: the flows move to com.probe.zeta, the new address answers 200 and the old one 409, the object is refused with NAMESPACE_PREFIX, and the banner goes from 4 to 2.

CI at this head: 46 success, 15 expected skips, 0 failed, 1 pending (Check Changeset). Run 46201771204, attempt 2. Attempt 1's Live E2E UI master-detail timeout is outside the diff and cleared on its one re-run.

K = 35, over the hold of 15. Landing waits on a merge of main. The merge base is eef1cbfe, and main is at 16f132fb, 35 single-parent commits on. The landing-k reader answers CAN'T ANSWER, because a ui-only PR runs no Test Core shard, so this count was read from the compare. After the merge, CI re-runs and K is re-read, which resets it to about 0. The verdict carries to the merge head when that merge is clean and adds no file of its own to the PR's diff.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-29T04:09Z

Contract review

Served-tier: TIER_DEFAULT
Head-sha: be8e0d5dc2168c88a975d9760787db6489fdbb85
Local-runs: none

PR #38389, card #38150 PR-A2. Claim 7234216673, amendment 4 7239673373, and the dev report at /mnt/project-files/card-38150/a2-report.md. My L1-a ACCEPT at this head is the comment just before this one.

Why TIER_DEFAULT. The only face is the declaration. The 15 files hold no packages/spec/src/** path and no governed path, and record-recognisers --paths reads the declaration face, TIER_DEFAULT. There is no narrowing. The review is owed by Clause-②: yes (widening) alone. Under pm-dispatch execution-duties.md:157, the lane seat writes a declaration-face L2 as a TIER_DEFAULT record, so it is run in the seat's L1 thread with no second agent. The PR lands the Tier H way, because the card total passes 3000 lines.

① Derived judgments

  • D1 What widens. The published @object-ui/i18n studio namespace gains 30 keys in en and the same 30 in zh (parity checked). They cover engine.looseMove.*, engine.looseItems.* and engine.list.sourceFilter.loose. No key is removed or re-worded. Inside the private @object-ui/app-shell, the list's source filter accepts loose, and PackageAskRequest takes optional title and description, which fall back to the create's own text when absent.
  • D2 The door it calls is unchanged. POST /api/v1/packages/:id/move-in and its MoveIntoPackage* types come from A1 (feat(runtime): POST /packages/:id/move-in moves a selection of loose items into a package, each through the save door #38185, merged) through @objectstack/spec/api. This PR adds no server path, field or code. A refusal is shown with the door's own code and sentence.
  • D3 One reading of loose. isPackageLessItem, through isLooseRow, feeds the filter, the counts, the ordered names and the banner. A .custom pair item or a served overlay is never counted as loose.
  • D4 Who sees it. Selecting needs canAuthor && !walled, and the banner needs useCanAuthorMetadata. The server door keeps its own gates, so the console grants nothing.

② Semver level

patch for @object-ui/app-shell and @object-ui/i18n. Under AGENTS.md Post-Task 3, a non-protocol widening ships patch. Metadata-protocol: none is right, because nothing an author writes moves. Clause-②: yes (widening) is right by D1.

③ Boundary flags

  • Evidence: 25 new tests, each with a control, and the ablation reds two list tests. The full UI suite passes. Derived gates 39/39, 0 NOT MEASURED. The showcase walkthrough has 7 screenshots.
  • CI at this head: 46 success, 15 expected skips, 0 failed, 1 pending. Attempt 1's Live E2E timeout is outside the diff.
  • open_questions: none open at this head. Order: B1 follows A2, per amendment 4.
  • security_findings: none. The move is gated by the server door, and the console only reads its answers.
  • SQL push-down: not applicable, since no server read is added. N2 of the L1 notes that the banner makes one list read per type, by design.
  • Landing: K = 35 against a hold of 15, so a merge of main is owed before the queue, then K is re-read.
  • Nits N1 and N2 are in the L1 comment.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-j4n4b0
Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Recorded 2026-11-29T04:10Z.

维护者速读

席位意见:可以合。

席位核对 — ACCEPT · repo:objectstack#3 · head be8e0d5dc2168c88a975d9760787db6489fdbb85

  1. 形态:Part of #38150(A2,卡还有 B1、B2,所以不关卡);15 个文件,+1,369 / −11;@object-ui/app-shell 和 @object-ui/i18n 两个 patch changeset;Clause-②: yes (widening),Metadata-protocol: none,Skills-docs: none。
  2. 审查:L1-a ACCEPT 7250478433(本 head);合同审查 PASS 7250482456(TIER_DEFAULT,只有申报面,record-recognisers --paths 不命中 spec、受管路径或收窄面,本 head)。两条 nit 接受为偏差:N1 成功提示显示软件包 id 而不是名称,放进 B1;N2 横幅按类型的列表读取只是成本说明(实测 30 个类型并行 366 ms)。
  3. Tier:按单卡超过 3000 行判 Tier H;check-governed-merges 不命中受管路径。
  4. 证据:新增 25 条测试,各带对照;把散落判定换成 source==='runtime' 的消融让两条列表测试变红;UI 全量 25,917 条通过;派生门 39/39,0 条未测。showcase 实走 7 张截图:flow 移入 com.probe.zeta 后新地址 200、旧地址 409,对象被 NAMESPACE_PREFIX 拒绝并逐项显示,横幅从 4 变 2。CI:45 成功、13 跳过、0 失败(run 46201771204 第 2 次;第 1 次的 master-detail live-e2e 超时不在本 diff 范围内,重跑一次即过)。
  5. K:35,超过 15。批准后先合 main、等重跑转绿再落地;干净合并不改变 PR 的 diff,本记录照旧有效。
  6. 落地条款:Tier H ⇒ GOVERNED_APPROVERS(os-zhuang)批准后,本席照落地前检落地;head 除合 main 外再动就重新判。

This branch has not been deployed

No deployments
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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants