Repository navigation
feat(console): the install note says how many sample records an install loaded, and clears them in place - #30537
Merged
Conversation
…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
Contributor
Author
|
domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2 维护者速读
席位核对 — ACCEPT · head eaf46b5
|
This was referenced Nov 5, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Sales · project thread
Part of #30323
Clause-②: no
Metadata-protocol: none
维护者速读
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.
POST /api/v1/marketplace/install-localanswersdata.seededwith the seed run's counts (mode: 'inline',inserted,updated,skipped,errors), so the claim's stop condition does not apply. Read live on base70981e63: a fresh install answeredinserted: 3, a reinstall over live sample dataskipped: 3, the purgedeleted: 3, and a reinstall after the purgeinserted: 3again (the card's "reinstalling reseeds").doInstallLocal). After a managed install, the result note says how many sample records the install left in place (inserted + updated + skippedof aninlinerun;skippedthere 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 forskipped/refused/replayerruns, an unmanaged copy, or an answer withoutseeded.marketplace.install.localSuccess(shown only when the answer sayshotLoaded: true) now reads "… is now in the app switcher." instead of "should now appear", in all 10 packs.AlertDialogin place ofwindow.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.bannernotification (NotificationBanners, drawn byConsoleLayoutabove every page).SampleDataLeaveBannerraises 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.sampleDataNotice.ts): the readersampleRecordsLoaded()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.LocalManagedInstallResultandLocalUnmanagedInstallResultgain the optionalseeded(LocalInstallSeeded) inmarketplaceApi.ts.marketplace.detail:sampleDataLoadedandpurgeConfirmAtMost(count families with each language's CLDR slots, aspurgeSuccess),sampleDataReloaded,sampleDataBannerTitle,sampleDataBannerMessage. The banner and the note's button reusepurgeSampleData..changeset/30323-install-note-sample-data.md,@object-ui/app-shelland@object-ui/i18npatch.Branch: the harness-assigned
claude/project-thread-6nrbkq, notclaude/issue-30323-*; the card is #30323.Tests
MarketplacePackagePage.sampleDataNotice-30323.test.tsx(12 cases, the realmarketplaceApiover one stubbedfetch,window.confirmstubbed 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 noseededdraw 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.MarketplacePackagePage.offlineLocalMenu-11627.test.tsxandMarketplacePackagePage.sampleDataRefusal-10432.test.tsxclick 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.tscounts one more matched „…“ span (104 to 105) forsampleDataBannerTitle.Acceptance notes
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'swithSampleDatais presence only (sampleDataInScopereadsfirstOnly). A count after the fact needs the server to answer it, inpackages/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 outsideconsole/marketplace/**.installPackage) answers no sample-data count, so its install note is unchanged; its purge confirm is the new dialog without a count.cloudUrlempty), 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.rigwith one objectrig_noteand one dataset of three records keyed bytitle:seeded: {mode: "inline", inserted: 3, updated: 0, skipped: 0, errors: 0},upgradedFrom: null,hotLoaded: trueseeded: {mode: "inline", inserted: 0, updated: 0, skipped: 3, errors: 0},upgradedFrom: "previous-marketplace-version"{deleted: 3, skipped: 0, errors: 0, withSampleData: false}; the listing then answerswithSampleData: falseseeded: {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-configon the changed files: 0 errors (warnings are the files' existingno-explicit-anyand one unusedcode).check:i18n-keys,check:i18n-drift,check:i18n-dead-keys(ui): exit 0 each; drift: every changedenvalue followed by all nine packs.Ablations (scripts/ablation-replace.mjs, restored to HEAD each time)
sampleRecordsLoadedreturnsnull: 6 of 12 red (every count case), 6 controls green.openLocalPurgeConfirmpurges without the dialog: 3 red (note clear, Cancel, ⋯ menu dialog).SampleDataLeaveBannerraises nothing on leaving: 1 red (the banner case).Derived gates (dispatch-gates --commands, 35 families)
All 35 derived families ran on
1470c715with exit 0;dispatch-gates --rananswered 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN.pnpm check:changeset-fixed(its roster is under.changeset) exit 0. After mergingorigin/main(headeaf46b57, 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