Skip to content

feat(console): a marketplace app's Install confirms what it adds before it installs - #30545

Closed
objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-o1qmt2
Closed

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread
domain:ui#6 · os-sales · session_01L6bhgTyZzKhzBatM6ZuVbs

Fixes #30325

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:市场应用详情页点「安装」(装进本运行时)不再立刻开装,先弹控制台自己的确认框,写明会加入几个对象、几个权限集、几条示例记录,以及装后会建议把哪个权限集授予所有已登录用户;确认框里再点「安装」照原样安装,「取消」什么都不装。示例数据仍默认加载。
  • 为什么改:Marketplace install starts on one click, with no view of what it will add #30325 实测:HotCRM 一点安装就直接 处理中…,一次加了几十个对象、权限集和 369 条示例记录,管理员事先看不到。
  • 风险与回滚:只改前端;数字取自页面原本就在读的同一份版本 manifest(install-local 实际安装的也是它),不新增请求;读不到 manifest 时确认框如实说读不到,安装照常可用。回滚即还原本 PR。
  • 先看:ui/packages/app-shell/src/console/marketplace/installPreview.ts(计数口径)、MarketplacePackagePage.tsx 的 doInstallLocal / runInstallLocal 与新 AlertDialog、marketplaceApi.ts 的 getServedPackageBody。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/console/marketplace/__tests__/MarketplacePackagePage.installPreview-30325.test.tsx packages/app-shell/src/console/marketplace/__tests__/installPreview-30325.test.ts,预期 12 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

  • The confirm. The package page's local Install (doInstallLocal) now opens an AlertDialog instead of posting at once. It names the package, then lists Objects / Permission sets / Sample records as label and number, a note that sample records load with the app and can be cleared from this page afterwards, and one line per permission set the install will suggest granting to Everyone (nothing is granted until an administrator accepts). Its Install calls runInstallLocal, the unchanged install body (modes, result notes, refusals all as before); Cancel installs nothing. Reinstall gets the same confirm with a reinstall title. One click on the confirm's Install continues as today.
  • Where the counts come from (installPreview.ts, a pure reader). The page already read GET /api/v1/marketplace/packages/:id/versions/latest/manifest for installModes; that body is what install-local fetches and installs. marketplaceApi.ts now exposes the body read (getServedPackageBody) and the mode reader as a pure function (declaredInstallModesOf), and the page derives both the modes and the preview from the ONE read. The counts follow the door's own reading of that body:
    • package bodies: nested manifest: flattened beside the collections, plus each packages[] entry's body;
    • objects: objects as a list or a name-keyed map;
    • permission sets: permissions only when it is a LIST of named sets (the manifest-stage capability grant is an object and is not counted);
    • sample records: top-level data[] entries with an object and a records list, summed (the server's seedDatasetsOf filter, the datasets the install's seed step loads). A dataset scoped by env (not all three) or locale may not load here, so the value then reads "up to N";
    • suggested grants: permission sets declaring isDefault: true (ADR-0090 D5).
  • Sample-record count, read one way with After installing an app, say how much sample data was loaded and offer clearing it right there #30323. Before install: the declared seed records above. After install: After installing an app, say how much sample data was loaded and offer clearing it right there #30323's sampleRecordsLoaded reads the install answer's seeded. Agreed with that card's thread; this PR does not touch its files.
  • Unreadable manifest. The confirm says what the package adds could not be read and the install result will say what loaded; its Install still installs.
  • Strings. marketplace.install.preview.* (11 keys) in all 10 packs; no existing key changes. atMost is named on the count-neutral list of count-families-11445.test.ts (the number stands after "up to", the noun is the row label). The de pack uses no „…“ span, so de-quote-pairing-3876.test.ts is unchanged.
  • Changeset. .changeset/30325-install-confirm-what-it-adds.md, @object-ui/app-shell and @object-ui/i18n patch.

Branch: the harness-assigned claude/project-thread-o1qmt2, not claude/issue-30325-*; the card is #30325.

Tests

  • New MarketplacePackagePage.installPreview-30325.test.tsx (6 cases, real marketplaceApi over a stubbed fetch): Install opens the confirm with 3 objects / 2 sets / 9 records and the crm_user suggestion, with zero install POSTs and ONE manifest GET; its Install posts once and the success note is drawn; Cancel posts nothing; a locale-scoped dataset reads "up to 6"; no records and no default set draw no note and no suggestion line; a 404 manifest says unreadable and Install still posts.
  • New installPreview-30325.test.ts (6 cases): flattened bundle, capability-grant permissions not counted, multi-package artifact, env/locale upper bound, skipped seed entries, non-body null.
  • Existing local-install tests click the confirm after Install: credentialStep-27238, dependencyMissing-25792, installMode-12288, protocolCheckSkipped-30326, servedTruth-12098, walledCatalogPackageRefusal-7611. No assertion changed.
  • Positive control: MarketplacePackagePage.tsx restored to the base (fa9c0aa2) with the new tests kept: 6 failed / 6; restored with git checkout HEAD --, blob hash matches HEAD, git diff HEAD empty.

Acceptance notes

  • Live, real stack. Showcase objectstack dev --seed-admin --fresh with OS_CLOUD_URL pointed at a local stand-in control plane serving one catalog package and its flattened bundle (3 objects, 2 permission sets with one isDefault, 3 datasets of 8 + 3 + 2 records), console via vite. On the base: clicking 安装 went straight to 处理中…, no dialog, POST at once. On this head: the confirm read 对象 3 / 权限集 2 / 示例记录 13 and the acme_deals_user suggestion with zero POSTs; after its 安装, the install answer's seeded was inline, inserted: 13. The manifest GET count was the same on both runs (2, the dev build's double effect), so the confirm adds no request. Screenshots and network logs: project files issue-30325/.
  • HotCRM itself was not installed here (no cloud reachable from the container); its published bundle is flattened by its publish-marketplace.mjs (flattenArtifact), the shape covered by the first case.
  • Same class, not in this PR: the catalog page's organization-package Install (MarketplacePage.tsx doOrgInstall) also posts install-local on one click with no confirm (read in code, not run). Reported to the seat.
  • The cloud install dialog is unchanged: it keeps its own environment picker and sample-data checkbox.

Verification

All on head b94b041e unless noted.

  • pnpm --dir ui exec vitest run packages/app-shell/src/console/marketplace/__tests__/: 52 files, 442 tests passed (head afbb486; the later commit only touches an i18n test).
  • pnpm --dir ui exec vitest run packages/i18n/: 95 files, 1443 passed, 13 skipped.
  • pnpm --filter @object-ui/app-shell run type-check and pnpm --filter @object-ui/i18n run type-check: exit 0 (head afbb486; the i18n suite above ran the later test edit).
  • pnpm --dir ui run check:spec-symbols, check:i18n-keys, check:i18n-drift, check:i18n-dead-keys, check:control-bytes, check:new-line-citations: exit 0 each.
  • eslint on the changed source and new test files: 0 errors.
  • dispatch-gates --commands derived 35 families; all 35 exit 0 on b94b041 (also on afbb486), --ran: 35 derived, 35 run, 0 NOT-MEASURED.

Generated by Claude Code

…re it installs

The package page's local Install now opens a confirm in the console's own
dialog: how many objects, permission sets and sample records the package
adds, and which permission sets it will suggest granting to Everyone. The
counts are read from the version manifest the page already reads for the
install modes (the body install-local installs), so one read serves both.
The confirm's Install runs the install exactly as the button did.

Claude-Session: https://claude.ai/code/session_01L6bhgTyZzKhzBatM6ZuVbs
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l 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 5, 2026
Keeps both import lines in MarketplacePackagePage.tsx (the install confirm and
the sample-data notice), and the sample-data notice test clicks the confirm.

Claude-Session: https://claude.ai/code/session_01L6bhgTyZzKhzBatM6ZuVbs
Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Nov 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-tesla · session_01L9qibw7DekEe3wx5f3zphf

Superseded by PR #30840 (claude/project-thread-7yy8nl, head 5d7d5c34), which carries this diff from 816df850 merged with origin/main after PR #30640, with the install-preview keys moved into the lazy marketplace namespace. Closed by domain:ui#2 (claim 6677784267 on #30325) so the PR-body guard on #30840 clears; the branch is kept.

@objectstack-fleet objectstack-fleet Bot closed this Nov 6, 2026
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/l 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.

Marketplace install starts on one click, with no view of what it will add

1 participant