Skip to content

fix(studio): a customization pair's dashboard or report opens in its base app's edit state - #37348

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-37237-custom-pair-base-app
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-37237-custom-pair-base-app

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37237

Clause-②: no
Metadata-protocol: none

维护者速读

  • 在 Studio 里打开定制包(某个已安装应用的定制都存在这个配对包里)的仪表盘或报表,之前停在通用条目页,现在直接进基础包应用的编辑状态(仪表盘进编辑、报表进构建器),右上角关闭回到原来的列表。
  • 属于「Studio 重构」专题,是上一张「仪表盘和报表在所属应用里打开」改动留下的配对包缺口。
  • 出错时作者会落到通用条目页或基础包的另一个应用里,不会改动任何数据;撤回本次改动即恢复原样。
  • 无。

What changes

StudioAreaAppOpen (the area's step between a Studio list and an app page) reads the open package's published apps. When the open package is a customization pair (<base>.custom, by customizationPairBaseOf, the shipped pairing rule) and it has no published app of its own, it now reads the base's published apps (one extra read, on the pair leg only, and only for an item open) and runs the same decision-6 rule (studioAppEditSegment) over them with the base's id: the remembered app when it is one of the base's (or its menu opens the item), else the base's first app.

  • A pair's dashboard opens at /apps/BASE/dashboard/NAME in its edit state; a pair's report opens the base app's builder. ?studio= carries the pair's list, so × returns to it.
  • A pair whose base has no published app keeps the generic item page (decision 3).
  • A pair that publishes an app of its own opens there, and the base is not read.
  • A plain package is unchanged: one app read, as before.
  • The item read (does it have a published version?) is still asked of the pair.
  • The report list's New (decision 13) is unchanged on the pair leg (see Acceptance notes).

No server, spec or route change. studioAppEdit.ts only gains a doc paragraph naming the pair leg.

Tests

ui/packages/app-shell/src/views/studio-design/StudioAreaAppOpen-36906.test.tsx, a new top-level describe in the shared harness (through the real StudioMetadataArea and its routes):

  • a pair dashboard opens in the base app's edit state, × returns to the pair's list, the reads are exactly [app PAIR], [app BASE], and the item is read from the pair;
  • reached from the base's list: a pair row's ?package=PAIR link re-roots the area onto the pair and opens the base app;
  • a pair report opens the base app's builder, picked by decision 6 among several base apps (remembered app, then first app);
  • a pair whose base has no app keeps the generic item page;
  • a pair with its own app opens there, with no base read;
  • CONTROL: the existing "package with no published app" case now also pins a single app read.

The old pin "a pair row keeps the generic item page" is replaced: that is the behaviour this card changes.

Test run and ablations (4 legs, each red, each restored to HEAD)

pnpm --filter @object-ui/app-shell exec vitest run --root ../.. --maxWorkers=2 …/StudioAreaAppOpen-36906.test.tsx …/studioAppEdit.test.ts → Test Files 2 passed (2), Tests 29 passed (29).

pnpm --filter @object-ui/app-shell run type-check → exit 0.

Ablations via scripts/ablation-replace.mjs on StudioAreaAppOpen.tsx (vitest resolves the source directly; no dist leg):

leg mutation red
A1 no pair leg customizationPairBaseOf(packageId) : null → null : null 3 failed: pair dashboard, pair report, base-without-app
A2 pair id in segment packageId: appPackageId, apps → packageId, apps 1 failed: pair dashboard (/apps/PAIR/…)
A3 own app ignored && apps.length === 0 ? → && true ? 1 failed: pair with its own app
A4 CONTROL, leg on any package ?? 'com.example.hr' fallback 1 failed: plain package's single read

Each leg printed ok restored: blob == HEAD … git diff HEAD is empty. A first A3 try missed its anchor (refused, exit 3, nothing ran) and a second was refused for an ambiguous marker; the third run above is the reading.

Acceptance notes

  • Reachability (the card's confirmation): the pair-as-scope case is reachable from Studio's menu through a package's list. A pair's row links ./NAME?package=PAIR (ResourceListPage metadataRowInfo), and areaLocationRedirect re-roots any leg whose ?package= names another package onto that package, so the area mounts on the pair. The new reach pin drives that redirect. The menu's environment entry (~all with ?scope=environment) keeps rows in the environment scope and does not re-root; the plain ~all leg does. Confirmed with a pin, not in a browser.
  • The report list's New on a pair's own area still uses the area's create. It does not go to the base app's new-report page. The card names opening items only.

Verification

Two-minute check: run the test file above. Expected: 29 passed. Or in a HotCRM-shaped stack, open Studio → the base package → Dashboards → a row from .custom. Expected: the base app's dashboard opens in edit mode, and × lands back on the list.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 7e57a1c7a41cc23840df1d2896f8dd61838f4838 · 2026-11-25T22:03Z

PR #37348 → card #37237 (sub-card of #36890). Final report 7174682607. Zone head freeze 7175473312 (2026-11-25T21:43Z). Everything below was read against GitHub and a throwaway worktree at the head. None of it is taken from the report.

Checklist

  • Shape (l1-face.mjs --pr 37348: CLEAN, 13 items, none flagged). The PR is an open draft against main. Its first line is Fixes #37237, and no closing keyword binds another card. Nothing touches content/docs/releases/. There is one changeset, and it is not empty. Lint & Repo Gates and TypeScript Type Check are both success. Fixes is right: the diff delivers the whole card (dashboard and report through the base app, × back to the list, the three pinned cases, and the reachability confirmation).

  • Fix matches the card. StudioAreaAppOpen.tsx reads the open package's apps once. If the target is an item, that read is empty, and customizationPairBaseOf(packageId) names a base, it makes one read of the base's apps. It then runs the unchanged decision-6 rule (studioAppEditSegment) with packageId: appPackageId (the base). customizationPairBaseOf is the existing shipped helper. It is pure and wraps spec's customizationBasePackageId (.custom suffix plus a round-trip check), and StudioDesignSurface and StudioPermissionSetPage already use it. The diff stays inside the claim's file surface: studioAppEdit.ts (doc paragraph only), StudioAreaAppOpen.tsx, the shared test file, and a changeset. There is no server, spec or route change.

  • Extra read only in the stated case. The base read is guarded by target.kind === 'item' && apps.length === 0 && pairBase !== null.

    • A plain package with apps makes one read, as before.
    • A plain package with no app makes one read. The CONTROL pin toEqual([['app', { packageId: PKG }]]) now asserts this.
    • A pair with its own app makes one read, pinned.
    • New-report never takes the leg, because of the kind guard. Q1 A holds: New on the pair's own area is unchanged.
    • On the pair leg, the remembered-app menu read (client.get('app', …)) is now skipped when the remembered app is one of the base's. So the pair leg costs at most one extra request, and sometimes none.
    • A cancelled check comes before the second read.
  • Replacing the old pin is justified. I ran main's test file (merge-base a182fbe3) against the head source. Exactly one case went red: 「a pair row keeps the generic item page: the pair has no published app of its own」. The other 24 stayed green (Tests 1 failed | 24 passed (25)). That pin asserted the item page plus a single [app PAIR] read, which is the defect the card names. Its two assertions are still covered:

    • The generic page on a pair is covered by 「a pair whose base has no published app」.
    • The single read is covered by the plain CONTROL and by 「a pair with a published app of its own」.

    The old pin mounted /studio/PAIR/… through the same PackageArea route that the new cases use, so no route lost coverage.

  • Reachability (Q2 A). areaLocationRedirect (metadataArea.ts:291) re-roots any leg whose ?package= names another package, whether or not a customization prop is present. The reach pin mounts /studio/BASE/…?package=PAIR and lands on /apps/BASE/dashboard/headcount with ?studio= set to the pair's list. StudioDesignSurface sends pillar URLs of a pair to the base, but explicitly not the area (props.area). So the pair-scoped area is a real route.

  • Declarations. readClause2Line (scripts/pm/clause2-line.mjs) gives {kind: declared, value: no, arm: null} for the card's newest Claim: comment 7172779719, the PR body, and the changeset body, all three identically. readMetadataProtocolLine gives declared · none for all three. No Skills-docs: line is owed.

  • Changeset. The @object-ui/app-shell entry is a patch. The package is private: true, but it is versioned under privatePackages and listed in fixed, and main already has 189 changesets for it, so this follows convention. patch agrees with Metadata-protocol: none. I checked each sentence against the diff:

    • 「They now open in the base package's app」: true.
    • 「The app page's × goes back to the Studio list you left」: true. ?studio= is the pair's list.
    • 「A customization package whose base has no published app keeps the generic item page」: true.
    • 「…that does publish an app of its own opens there, as before」: true.
    • 「Every other package is unchanged. No props, exports or routes change」: true.
    • 「picked the same way as for any package: the app you came from … otherwise the base's first app」: abbreviated, see N2.
  • Pins at head and ablation. In the worktree at 7e57a1c7 I ran vitest run --root ../.. StudioAreaAppOpen-36906.test.tsx studioAppEdit.test.ts and got Test Files 2 passed (2), Tests 29 passed (29). I then ran four ablations through scripts/ablation-replace.mjs. Each landed (anchor 1 → 0, blob changed), and each was restored with blob == HEAD … git diff HEAD is empty:

    leg mutation red at head
    A1 customizationPairBaseOf(packageId) : null → null : null 4 failed: pair dashboard, reach from the base list, pair report, base without an app
    A2 packageId: appPackageId, apps → packageId, apps 2 failed: pair dashboard, reach from the base list
    A3 && apps.length === 0 ? → && true ? 1 failed: pair with its own app
    A4 CONTROL ?? 'com.example.hr' fallback on the leg 1 failed: package with no published app (single read)
  • Check-runs at head. There are 51 runs: 38 success, 13 skipped, 0 failed, 0 pending. l1-face judges all 13 skips expected (0 unexpected). Nothing is dogfood-owed: the title has no ! and there is no (narrowing) arm.

  • Merge-tree and overlap. Against current origin/main 134b71db, git merge-tree --write-tree exits 0, and no main-side commit touches the PR's files. fix(console): "customized" means overrides + extensions everywhere; Setup → Packages names arrangements apart #37351 (c9c1d9e4) and fix(studio): a permission set's review link opens the draft review on its matrix page #37347 (f781168f) share no file with this PR. Pairwise merge-tree exits 0 for each, and so does a three-way merge of main plus fix(studio): a customization pair's dashboard or report opens in its base app's edit state #37348 with each of them.

  • K = 7. That is git rev-list --count HEAD..origin/main at 134b71db. The zone's freeze read 6, and main has moved one commit since. All 7 commits are outside these files.

  • 维护者速读 accuracy. All four lines hold:

  • Contract review. None is owed. The PR declares Clause-②: no with no (narrowing) arm. It touches no packages/spec/src/** and no governed path: all four files are under ui/packages/app-shell/src/** or .changeset/.

Findings

No must-fix, no should-fix.

  • N1 — The header docblock of StudioAreaAppOpen-36906.test.tsx (lines 17–19) still says 「a read-only base: its own rows open in its app, a pair row keeps the generic page」. This PR inverts that behaviour, and the file's new objectstack#37237 describe pins the opposite. It is a test-only comment and does not affect correctness. I accept it as a deviation, to be fixed on the file's next touch.
  • N2 — The changeset's paraphrase of decision 6 (「the app you came from when it is one of the base's, otherwise the base's first app」) leaves out rule 1's menu leg. That leg is an outside app whose menu opens the item (studioAppEditSegment, rememberedMenu), and the code keeps it. Studio 重构(3-4):Studio 列表点仪表盘、报表,直接进应用里的编辑状态;× 回 Studio 列表;报表「新建」进 /apps/<应用>/reports/new #36906's changeset names it. The sentence's lead clause, 「picked the same way as for any package」, is accurate. Accepted.
  • N3 — The PR body's ablation table was taken before the reach pin landed in 7e57a1c7. At head, A1 reds 4 rather than 3 and A2 reds 2 rather than 1, and every leg is still red. Separately, the report's gates field lists Test Core and Dogfood Regression Gate as success, but both are expected skips at head on this ui-only diff. These are evidence-accuracy notes only. No action.

Landing

  • The zone lands it, Tier S: not governed, +118/−19 (well under 3,000), no L2 owed. K = 7 (< 15), so the zone does not need to merge main first. Re-read the check-runs at the landing head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

Landing · 2026-11-25T22:05Z · head 7e57a1c7 · zone a4-S (#37237)

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 25, 2026 22:05
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 903697b Nov 25, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-37237-custom-pair-base-app branch November 25, 2026 22:26
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

Development

Successfully merging this pull request may close these issues.

Studio:以 .custom 配对包打开时,仪表盘和报表经基础包的应用打开(而不是留在通用条目页)

2 participants