Skip to content

feat(console): the install note says how many sample records an install loaded, and clears them in place - #30537

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-6nrbkq
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-6nrbkq

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Part of #30323

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:在应用市场详情页把应用安装到本运行时后,安装结果里会写明「本次安装载入了 N 条示例记录」,旁边直接有「清除示例数据」按钮;清除改用控制台自己的确认框(不再是浏览器原生弹窗),本次会话装过的应用会写明「最多删除 N 条」;离开详情页进入应用后,页面顶部有一条横幅提示该应用有示例数据,点「清除示例数据」会回到详情页并直接打开确认框;重装时说明示例数据会重新载入;「应该已经出现在应用切换器中」改成确定的说法。10 种语言。
  • 为什么改:示例数据默认保留(维护者裁决),但客户不知道去哪里清,假客户、假收入会一直留在仪表盘上。
  • 风险与回滚:只读安装应答里已有的 seeded 计数,不改服务端、不改清除规则(只删带示例记录键的行,用户新增和改过键的记录保留);横幅只在本次浏览器会话内有效;回滚即还原本 PR。
  • 先看:ui/packages/app-shell/src/console/marketplace/MarketplacePackagePage.tsx 的 doInstallLocal 与 purgeConfirmDialog;SampleDataLeaveBanner.tsx(离页时发横幅);sampleDataNotice.ts(计数读取与会话记录)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/console/marketplace/__tests__/MarketplacePackagePage.sampleDataNotice-30323.test.tsx,预期 12 个用例全绿(需先建 @object-ui/app-shell 的依赖闭包)。
  • 需要你做的:无,席位落地。

What changes

Card #30323, the console half that the install answer already supports. Maintainer ruling on the card, verbatim: 「我觉得安装应用市场应用的时候是需要有初始数据的,这样客户才能看得到效果,但是呢,应该有界面功能能够帮助他清理数据」. Sample data stays on by default; this PR makes the cleanup easy to find.

  • Premise, measured. POST /api/v1/marketplace/install-local answers data.seeded with the seed run's counts (mode: 'inline', inserted, updated, skipped, errors), so the claim's stop condition does not apply. Read live on base 70981e63: a fresh install answered inserted: 3, a reinstall over live sample data skipped: 3, the purge deleted: 3, and a reinstall after the purge inserted: 3 again (the card's "reinstalling reseeds").
  • The install note (doInstallLocal). After a managed install, the result note says how many sample records the install left in place (inserted + updated + skipped of an inline run; skipped there means the row was already in the database), with a "Purge sample data" button in place. An install over an existing one adds that installing again loads the sample data again, including any that was cleared. No line for skipped / refused / replayer runs, an unmanaged copy, or an answer without seeded.
  • Definite success sentence. marketplace.install.localSuccess (shown only when the answer says hotLoaded: true) now reads "… is now in the app switcher." instead of "should now appear", in all 10 packs.
  • The console's own confirm. Both purge paths (local and cloud, from the note or the ⋯ menu) open an AlertDialog in place of window.confirm. When this session knows the install's count, the dialog says at most that many sample records go (the purge deletes only rows carrying a seed record's key, so the install's count is an upper bound). The purge rule and its doors are unchanged.
  • A reach from the app's own pages, through an existing generic block: the console's banner notification (NotificationBanners, drawn by ConsoleLayout above every page). SampleDataLeaveBanner raises it when the installer leaves the package page, for a package this session recorded loading sample data into. Its "Purge sample data" action navigates back to the package page, which opens the confirm once the listing says the sample data is still there. Clearing withdraws the banner; coming back to the page withdraws it while the page's own note speaks.
  • Session record (sampleDataNotice.ts): the reader sampleRecordsLoaded() and an in-memory map from manifest id to the count, name and page path, used by the confirm and the banner. A reseed from the ⋯ menu records its own count the same way.
  • Types. LocalManagedInstallResult and LocalUnmanagedInstallResult gain the optional seeded (LocalInstallSeeded) in marketplaceApi.ts.
  • i18n. New in all 10 packs under marketplace.detail: sampleDataLoaded and purgeConfirmAtMost (count families with each language's CLDR slots, as purgeSuccess), sampleDataReloaded, sampleDataBannerTitle, sampleDataBannerMessage. The banner and the note's button reuse purgeSampleData.
  • Changeset. .changeset/30323-install-note-sample-data.md, @object-ui/app-shell and @object-ui/i18n patch.

Branch: the harness-assigned claude/project-thread-6nrbkq, not claude/issue-30323-*; the card is #30323.

Tests

  • New MarketplacePackagePage.sampleDataNotice-30323.test.tsx (12 cases, the real marketplaceApi over one stubbed fetch, window.confirm stubbed to throw): the 369-record note with the definite sentence and the clear; inserted + updated + skipped over live data with the reinstall line; reinstall after clearing; CONTROL: skipped, refused, an inline run that left nothing, and no seeded draw no line; the note's clear opens the dialog with the count and its confirm purges and drops the clear; Cancel purges nothing; the ⋯ menu's purge on a visit with no install this session shows the dialog without a count; the banner is absent on the page, raised on leaving, its action navigates back and the page opens the confirm, clearing leaves no banner; CONTROL: no banner when nothing was loaded.
  • Moved pins: MarketplacePackagePage.offlineLocalMenu-11627.test.tsx and MarketplacePackagePage.sampleDataRefusal-10432.test.tsx click the dialog's confirm after the menu item (the purge now asks in the console's dialog). ui/packages/i18n/src/__tests__/de-quote-pairing-3876.test.ts counts one more matched „…“ span (104 to 105) for sampleDataBannerTitle.

Acceptance notes

  • Left open on the card (why Part of). "The confirm says how many records will go" holds only for an install made in this console session. After a reload nothing serves a count: the purge door has no dry run and the install-local listing's withSampleData is presence only (sampleDataInScope reads firstOnly). A count after the fact needs the server to answer it, in packages/cloud-connection, outside this claim's surface. For the same reason the banner lasts for the console session, not across reloads; a standing per-app reach would need a mount outside console/marketplace/**.
  • The cloud install path (installPackage) answers no sample-data count, so its install note is unchanged; its purge confirm is the new dialog without a count.
  • Live UI screenshots: NOT MEASURED. This rig has no cloud marketplace (cloudUrl empty), so the package page cannot install from a catalog here; the page is covered by the tests above, on the answer shape the live server returned.

Verification

Live install-local readings (examples/app-showcase, objectstack dev --fresh, base 70981e6)

Manifest com.acme.rig with one object rig_note and one dataset of three records keyed by title:

  • install: seeded: {mode: "inline", inserted: 3, updated: 0, skipped: 0, errors: 0}, upgradedFrom: null, hotLoaded: true
  • install again: seeded: {mode: "inline", inserted: 0, updated: 0, skipped: 3, errors: 0}, upgradedFrom: "previous-marketplace-version"
  • purge: {deleted: 3, skipped: 0, errors: 0, withSampleData: false}; the listing then answers withSampleData: false
  • install after the purge: seeded: {mode: "inline", inserted: 3, ...}
Tests, type-check, lint
  • pnpm --dir ui exec vitest run packages/app-shell/src/console/marketplace packages/i18n packages/app-shell/src/views/metadata-admin/PackagesPage: Test Files 164 passed (164), Tests 2028 passed, 13 skipped.
  • pnpm --filter @object-ui/app-shell --filter @object-ui/i18n run type-check: both Done, exit 0.
  • eslint --no-inline-config on the changed files: 0 errors (warnings are the files' existing no-explicit-any and one unused code).
  • check:i18n-keys, check:i18n-drift, check:i18n-dead-keys (ui): exit 0 each; drift: every changed en value followed by all nine packs.
Ablations (scripts/ablation-replace.mjs, restored to HEAD each time)
  • sampleRecordsLoaded returns null: 6 of 12 red (every count case), 6 controls green.
  • openLocalPurgeConfirm purges without the dialog: 3 red (note clear, Cancel, ⋯ menu dialog).
  • SampleDataLeaveBanner raises nothing on leaving: 1 red (the banner case).
Derived gates (dispatch-gates --commands, 35 families)

All 35 derived families ran on 1470c715 with exit 0; dispatch-gates --ran answered 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN. pnpm check:changeset-fixed (its roster is under .changeset) exit 0. After merging origin/main (head eaf46b57, which brought locale-pack edits from other PRs and merged cleanly), the derivation is the same 35-command list, and these were run again with exit 0: the marketplace + i18n + PackagesPage tests (164 files, 2028 passed), app-shell and i18n type-check, check:i18n-keys, check:i18n-drift, check:type-check-coverage, check:type-check-debt, check:nul-bytes, check:published-files, check-empty-changeset, check-changeset-no-major.


Generated by Claude Code

…ll loaded and clears them in place

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVKAj6nUY3DxWKsvXb
…nd follow the installer to the app with a banner

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVKAj6nUY3DxWKsvXb
@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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2

维护者速读

  • 改了什么:在本运行时安装市场应用后,结果提示写明这次载入了多少条示例记录,并就地给出「清除示例数据」;清除前改用控制台自己的确认框,写明最多删除多少条;离开安装页后,控制台顶部横幅提醒这个应用有示例数据,一键回到清除确认。再次安装会提示示例数据会重新载入;成功句改成确定的「已出现在应用切换器中」。
  • 为什么改:After installing an app, say how much sample data was loaded and offer clearing it right there #30323:示例数据默认保留(维护者裁定),但清除入口藏在 ⋯ 菜单里,确认框是浏览器原生的,也不说数量,客户容易带着假客户、假收入正式开用。
  • 风险与回滚:只改控制台的市场页、一份新的会话内记录模块和一个用通用横幅的提醒;数量取自安装应答已有的 data.seeded,清除规则不变(只删带种子键的记录)。新增 5 个文案键(十种语言)。回滚即撤本 PR。
  • 先看:ui/packages/app-shell/src/console/marketplace/sampleDataNotice.ts、SampleDataLeaveBanner.tsx,以及 MarketplacePackagePage.tsx 的安装结果段。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/console/marketplace/__tests__/MarketplacePackagePage.sampleDataNotice-30323.test.tsx,预期 12 passed。
  • 需要你做的:无,席位落地。
  • 席位意见:可合。刷新页面后的数量要服务端给,不在本 PR,卡保持打开转 server 车道。

席位核对 — ACCEPT · head eaf46b5

  • 形态:19 文件 +771/−25(市场页、新 sampleDataNotice.ts 与 SampleDataLeaveBanner.tsx、marketplaceApi.ts 的 LocalInstallSeeded 类型、三份测试、十个语言包、一个 i18n 计数钉子、changeset @object-ui/app-shell + @object-ui/i18n patch)。check-governed-merges --pr 30537:NOT governed,796 行 ≤ 3000。Part of #30323,draft,目标 main。席位读过新模块与类型:数量只在 seeded.mode === 'inline' 时取 inserted + updated + skipped,其余情况不说示例数据;会话记录只在内存里、只记本会话的安装,刷新即丢,不猜数量;横幅用 ConsoleLayout 已有的 banner 通知,不是新组件;resetSampleDataSessionForTesting 不在任何公共 barrel 上,只有测试引用。
  • 契约:Clause-② no,Metadata-protocol none,与认领 6659546812 一致:只读安装应答已有的 seeded 字段,没有新的服务端字段;新增 5 个语言键、改写 marketplace.install.localSuccess,十种语言齐全。
  • 前提实测:dev 报告 6660782810。新测试 12 绿(真 marketplaceApi、一处 fetch 替身,window.confirm 被设成一调用就抛错);三处消融各自红(数量函数返回 null 6 红、清除不走对话框 3 红、横幅不发 1 红),均已还原;原有两份市场测试改成点控制台对话框;marketplace + i18n + PackagesPage 164 文件 2028 测试绿;两包 type-check exit 0;派生门禁 35 条全部 exit 0,合 main 后复跑仍 0。
  • 门禁 check-runs:head 上 55 个,44 success,11 skipped,0 红。mergeable_state clean。
  • 接受的偏差:① 写 Part of 不写 Fixes:确认框里的「最多删除 N 条」和离页横幅只对本次会话内的安装成立,刷新后没有接口给出数量(purge 没有预演,列表的 withSampleData 只答有无),席位接受会话内口径。② PR 归属块链接的是卡线程,与本席其它卡线程的 PR 一致。
  • 范围外去向:刷新后仍能显示示例记录数(服务端给出某包现存示例行数,或 purge 预演)在 packages/cloud-connection,落地时写进 Release 转 domain:server。Marketplace install starts on one click, with no view of what it will add #30325(同文件、安装前确认)在另一卡线程,后落者合 main。
  • 落地条款:中继 pr_ready + automerge_enable。合并后卡不关(Part of),席位同一笔摘掉 pm:dispatched、换回 pm:queue、domain:ui 改为 domain:server,并留一条写清交付与剩余归属的 Release 评论。

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.

1 participant