Skip to content

fix(app-shell): a new report from an app's reports list saves into the app's package, as a new view does - #37357

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-37261-app-new-report-package
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-37261-app-new-report-package

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes #37261

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:管理员在应用的报表列表里点「新建」做的报表,以后会和在同一个应用里新建的视图存到同一个地方。可写的应用存进应用自己的包;已安装(只读)的应用存进它的定制包。所以 Studio 的报表列表能看到这些报表。已有的报表不搬动。
  • 为什么做:属于 Studio 重构专题。从 Studio 打开的新建报表已经按这条规则存,这次让应用自己的「新建」入口也用同一条规则,两条路不再各做各的。
  • 出错会怎样:新报表可能落在错误的包里,或不属于任何包,这时 Studio 列表里看不到它。改动只影响以后新建的报表,撤回这次改动即恢复原来的做法。
  • 要你做什么:无。

What changes

  • ReportNewPage's save no longer makes the package lookup depend on studioReturn. Both entry points call resolveRuntimeCreatePackage(appPackageId, 'report'):

    • Studio's report list;
    • the New button on the app's own reports index.

    When that call names a package, the report saves through saveAndPublishInPackage. The package is the app's own when it is writable; otherwise it is the .custom pair, created through the ensure door.

  • When the call answers null, the report is saved with no package through saveAndPublishRuntimeMetadata. That happens when the package is not listed, the ensure door refuses, or the door answers with a pair that is not writable. It is the same condition under which createRuntimeMetadata falls back for a view (app?.packageId && !packageId).

  • The report.builder.savedOutsideApp notice used to show only from Studio. It now shows on the no-package fallback from either entry point. Its text ("…so the Studio list does not show it") is true for both, so no string changes.

  • resolveRuntimeCreatePackage's console warning already names the type being saved; Studio 重构(3-4):Studio 列表点仪表盘、报表,直接进应用里的编辑状态;× 回 Studio 列表;报表「新建」进 /apps/<应用>/reports/new #36906 did that.

  • Existing reports are not moved. Only the target of a new report's first save changes.

Tests

ui/packages/app-shell/src/views/ReportNewPage-36692.test.tsx gains a new top-level describe, the app's own New saves into the app's package, as a new view does (objectstack#37261), with three pins:

  • writable package: a new report from an app on a writable package names packageId: P.
  • read-only app: on an installed (read-only) app, it names the P.custom pair.
  • CONTROL: when the ensure door refuses (403), the report saves with no package, shows report.builder.savedOutsideApp, and the warning names report.

Replaced pin: Save creates and publishes the report and lands on its page; nothing speaks of a menu. Its assertions that the report saves with no package outside Studio are removed. It now asserts one save and one publish.

Run at 9ded3000: Test Files 1 passed (1), Tests 16 passed (16).

Ablations (scripts/ablation-replace.mjs; restored blob == HEAD)
  • A1, the old studioReturn gate put back: 4 failed | 12 passed.
  • A2, the notice limited to Studio again: 1 failed | 15 passed.
  • A3, the fallback removed: 2 failed | 14 passed.

Acceptance notes

  • Done-when: a report made from any app's New lands in the same package a view made there would, and Studio's report list shows it.
    • The package is resolved by the same function as for a view, with the same draftBarPackageOf input as useRuntimeCreateApp.
    • The fallback condition is the same expression as createRuntimeMetadata's.
  • No route change, and no change to how existing reports are stored.

Verification

Two-minute check: in an app on a writable package, open Reports, click New, pick a data source and save. The report should then appear in Studio's report list for that package.

Local gates at 9ded3000:

  • check:test-source-alias, check:i18n-keys, overlap-check (clean) and the app-shell type-check all exit 0.
  • dispatch-gates --commands derives 38 families; all were run and all exit 0.
  • check:changeset-fixed exits 0.

CI runs on this PR.

Provenance

Opened by seat repo:objectstack#4 on the maintainer's authorization in the seat session (「#37261 开 PR 放行」).

  • The dev session (session_01QSeKYprGz1KcPK6n5ZfCZQ, zone a4-S) tried to open this PR and post its os-dev-report through the relay. Its permission check refused both writes, and it did not retry either one.
  • The seat took this body from that session's final report.
  • Branch claude/issue-37261-app-new-report-package @ 9ded3000.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

Flake reading before a one-time re-run · 2026-11-26T00:25Z · head baa9e0e0 · zone a4-S (#37261)

  • Red: Test UI shard 1/16, job 139594901092 (run 45725391000). Both failures are Error: Test timed out in 15000ms.:
    • scripts/__tests__/check-vi-mock-specifiers.test.ts:401 ("repo state — the gate is green on this tree");
    • scripts/__tests__/dollar-dialect-alias-census.test.ts:322 ("the tree as it stands today").
  • Why it measured nothing about this change:
    • Both are whole-tree scan tests in ui/scripts/__tests__. Neither reads this PR's three files (ReportNewPage.tsx, ReportNewPage-36692.test.tsx, a changeset).
    • No assertion failed; both hit the wall-clock limit. The shard ran 872 s (tests 1262 s, import 1195 s), which is a loaded runner.
    • The other 10,943 tests on the shard passed.
    • The dev re-ran both files locally at baa9e0e0: 72/72 pass in 14.5 s.
  • Action: scripts/pm/rerun-failed.mjs --run 45725391000, once. A second failure is real, and I'll read it as such. No empty commit, no close and reopen.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head baa9e0e0fb2a6bf05f3f2c9089932a037567a307 · 2026-11-26T00:54Z

Card #37261 → PR #37357. Read at head baa9e0e0: the card and its 4 comments, the PR body, the flake comment 7178743910 (2026-11-26T00:25Z), the zone's finalized-head note 7179025988 on the card (2026-11-26T00:41Z, the report of record), and the full net diff (3 files, +93 / −21).

Checklist

  • Shape (l1-face.mjs --pr 37357, exit 0, 13 items, none flagged). The PR is open, a draft and targets main. Its first line is Fixes #37261, and no closing keyword binds any other card. Fixes is right: merging delivers the whole card (see Done-when below).
  • Done-when holds. Both entry points now go through one rule. The package is resolved by the same function as for a view, resolveRuntimeCreatePackage. It gets the same input as the view leg: useRuntimeCreateApp computes draftBarPackageOf(appName, apps) from useParams and useMetadata, and ReportNewPage.tsx:129 computes the same expression from the same two hooks.
    • The fallback notice now fires on appPackageId && !packageId (ReportNewPage.tsx:165). That is the same expression as createRuntimeMetadata's app?.packageId && !packageId (runtime-metadata-persistence.ts:485), because app.packageId is that same draftBarPackageOf value.
    • The guard studioReturn ? on the resolve call and the guard studioReturn && on the notice are both gone. With no app, resolveRuntimeCreatePackage returns null early, so the report is saved with no package and no notice is shown. A view does the same.
  • The card's warning item was already delivered. The card also asked to reword the console warning. resolveRuntimeCreatePackage already says the ${type} is saved naming no package: it reads that way at the merge base 98bda0ac (line 216), and git log -S traces it to feat(studio): open Studio's dashboards and reports in the app's edit state; × returns to the list #37226 (ff049430). The PR body says so. Nothing in this item is left open.
  • The replaced pin is justified. The card asks for this in its own words: "Replace the existing pin that holds the old package-less behaviour outside Studio (added by Studio 重构(3-4):Studio 列表点仪表盘、报表,直接进应用里的编辑状态;× 回 Studio 列表;报表「新建」进 /apps/<应用>/reports/new #36906), and name it in the PR."
  • Scope. The 3 files are ReportNewPage.tsx, ReportNewPage-36692.test.tsx and .changeset/37261-app-new-report-package.md. All are inside the claim's file surface, and there is no route change and no migration of stored reports.
    • @object-ui/app-shell is private: true, so no changeset is required. The changeset follows the package's existing practice, and check:changeset-fixed is green in CI.
    • I read the changeset sentence by sentence against the diff, and each holds. These are the three behaviour bullets: the writable package or the customization package, the no-package fallback with its notice, and existing reports not moved. The example in "for example, the deployment does not let a tenant administrator create one" is the 403 case that the CONTROL pin drives.
    • The source comment's "Outside any app it names no package, as a view does" is also true (the early null above).
  • Merging main left the PR's own changes intact. The branch's own patch fbb62e1c..9ded3000 is identical to the net patch 98bda0ac..baa9e0e0 (compared with index lines removed). The 3 blobs at head equal those at 9ded3000. The 24 merged main commits touch none of the 3 files, nor runtime-metadata-persistence.ts, objectViewViewCrud.tsx or DraftPreviewBar.tsx.
  • Pins at head. I ran them in a throwaway worktree at baa9e0e0, after building the CI "Build UI Deps" closure. ReportNewPage-36692.test.tsx gave Test Files 1 passed (1), Tests 16 passed (16).
  • Ablations (scripts/ablation-replace.mjs). Each mutation landed, and each restore was verified as blob == HEAD 167448556f0e with an empty git diff HEAD.
    • A1 puts the studioReturn ? gate back on the resolve call: 4 failed | 12 passed. Red: the replaced pin, the writable-package pin, the read-only pin and CONTROL.
    • A2 limits the notice to Studio again: 1 failed | 15 passed. Red: CONTROL.
    • A3 deletes the notice line: 2 failed | 14 passed. Red: CONTROL here and the Studio leg's control.
    • A4 is my own: it forces the no-package save (const outcome = false). 5 failed | 11 passed. Red: the replaced pin, the writable-package and read-only pins, and the Studio leg's two in-package pins.
    • The dev's A1, A2 and A3 readings (4, 1 and 2 failed) reproduce exactly.
  • Declarations. readClause2Line reads the card's newest Claim: comment, 7169110191 (the only one), as {kind: declared, value: no}. It reads the PR body the same way, and the changeset carries Clause-②: no too. readMetadataProtocolLine reads none on both. Claim and body agree.
  • Is a contract review owed? No. No path is in packages/spec/src/** or on the governed surface. Clause-② is no, with no (narrowing) arm, and no public surface changes (no export, prop or type moves; the change is inside handleSave). There is no CONTRACT_REVIEW_TIER or TIER_DEFAULT record, and there is no record.md.
  • Tier S. No governed path, and 114 changed lines (under 3,000). So the Tier H final package is not owed.
  • Check-runs at head (filter=latest): 51 runs, 38 success · 13 skipped · 0 failed · 0 pending. Lint & Repo Gates and TypeScript Type Check are both success. The only failures are the superseded attempt-1 rows Test UI (1/16) job 139594901092 and its Test UI aggregate. Attempt 2 of run 45725391000 has both green (139605091386 at 2026-11-26T00:37Z; aggregate 139609598753).
  • The flake reading is sound (with N1).
    • Both failures are Test timed out in 15000ms with no assertion failing, on a slow shard (Duration 872 s).
    • Attempt 2 ran on the same head, with the same shard and the same 438 files. Both tests passed there: check-vi-mock-specifiers.test.ts 35 tests in 9.7 s, dollar-dialect-alias-census.test.ts 37 tests in 12.1 s, 10945/10945 overall.
    • In my worktree at head, the two files pass 72/72 in 16.4 s.
    • The diff adds no vi.mock call and no $-dialect text, which is all those two gates judge.
  • Merge-tree against current origin/main d558de0a: git merge-tree --write-tree exits 0 (tree 2bad7915), with no conflicts.
  • K = 4. That is git rev-list --count --first-parent 98bda0ac..origin/main, where 98bda0ac is the merge's main parent and the merge base. See N2 for why this is a fallback reading. Neither other leg applies: the PR touches no translations/ or locales/ label surface, and no skills/** or ui/**/locales/en.ts budget book.
  • 维护者速读 is accurate. It has four lines and no code names, paths, commands or bare card numbers.
    • 「可写的应用存进应用自己的包;已安装(只读)的应用存进它的定制包」 matches the writable and .custom arms.
    • 「已有的报表不搬动」 matches the diff: only the target of a new report's first save changes.
    • 「从 Studio 打开的新建报表已经按这条规则存」 is true since feat(studio): open Studio's dashboards and reports in the app's edit state; × returns to the list #37226.
    • The failure mode 「或不属于任何包,这时 Studio 列表里看不到它」 matches the fallback and its notice.
    • 「要你做什么:无」 is right for a Tier S PR that owes no contract review.

Findings

No must-fix, no should-fix.

  • N1 — The flake comment's premise "Neither reads this PR's three files" is not literally true. Both gates walk git ls-files (check-vi-mock-specifiers.mjs:307, dollar-dialect-alias-census.mjs:356), so they do read ReportNewPage.tsx and its test file. The verdict still stands on the other evidence: a wall-clock timeout with no failing assertion, the same head green in attempt 2, a 72/72 local pass, and a diff that adds nothing either gate judges. Next time, say "reads them, and judges nothing the diff added". No action on this PR.
  • N2 — landing-k.mjs --pr 37357 exits 3 (CAN'T ANSWER). The only green run, 45725391000, ran no Test Core shard, because this PR is UI-only, so no Affected-set diff base was printed. K = 4 above is the merge-base reading, used instead of PRBASE. The zone's note gave K = 3 at 2026-11-26T00:41Z, but main is 4 first-parent commits past the merge base now. Both readings are far below 15, so this changes nothing about landing. The note also says main was merged "at 00:2xZ", but the merge commit is stamped 2026-11-25T23:42Z. That is cosmetic.

Landing

  • The zone lands it. K = 4 < 15, so there is no main merge first. Take a fresh landing-k or merge-base K reading at arming time. Then pr_ready and auto-merge, through the usual landing round.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

Landing · 2026-11-26T00:55Z · head baa9e0e0 · zone a4-S (#37261)

  • L1 ACCEPT from seat repo:objectstack#4 at baa9e0e0, with no must-fix and no should-fix. No contract review is owed.
    • N1: my flake note said the two timed-out gates do not read this PR's files. They do, since both walk git ls-files. The verdict stands: both were timeouts with no failed assertion, and the one re-run (attempt 2) is green.
  • check-governed-merges.mjs --pr 37357: NOT governed; 114 changed lines, under 3,000.
  • Checks on the head, newest run of each: 38 success, 13 expected skips, 0 failed.
  • K: under 15 (the seat read 4). merge-tree with origin/main is clean.
  • Clause-②: no, Metadata-protocol: none. The report of record is the dev session's final messages, summarised in the finalized-head note on 应用里「新建报表」保存时不带软件包,而新建视图会带上应用的包:两条路径对同一操作做法不一致 #37261.
  • Action: ready, then auto-merge through the merge queue.

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.

应用里「新建报表」保存时不带软件包,而新建视图会带上应用的包:两条路径对同一操作做法不一致

2 participants