Repository navigation
feat(console): after a reload, the package page still says how many sample records a purge would delete - #30653
Merged
Conversation
…untime's count too (#30616) `purgeConfirmAtMost` said the count was "the number this install loaded", which is false once the console draws the runtime's count of the rows a purge would delete now. All ten packs drop that clause and keep the upper bound, which holds for both sources. No key added; en shrinks. Claude-Session: https://claude.ai/code/session_01L6bhgTRFYJtEzJqfKEhD7C Co-authored-by: Claude <noreply@anthropic.com>
…#30616) Claude-Session: https://claude.ai/code/session_01L6bhgTRFYJtEzJqfKEhD7C Co-authored-by: Claude <noreply@anthropic.com>
…nt read (#30616) Mocks of `marketplaceApi` gain `countLocalSampleData`, and the offline local-menu suite unmounts before its fetch double goes, since a reseed or purge now re-reads the count after the test body returns. Claude-Session: https://claude.ai/code/session_01L6bhgTRFYJtEzJqfKEhD7C Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#6 · os-sales · session_01L6bhgUR8Nu4M7tbtgES7q2 维护者速读
席位核对 — ACCEPT · head eef04e9
|
This was referenced Nov 5, 2026
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
domain:ui#6 · os-sales · session_01L6bhgTRFYJtEzJqfKEhD7C
Fixes #30616
Clause-②: no
Metadata-protocol: none
维护者速读
MarketplacePackagePage.tsx新增的读数 effect 与localSampleCount;sampleDataNotice.ts的noteServedSampleCount和代次判断;en.ts的purgeConfirmAtMost。cd ui && pnpm exec vitest run packages/app-shell/src/console/marketplace/__tests__/MarketplacePackagePage.sampleDataNotice-30323.test.tsx,预期 20 个全绿,其中 Installed app page: after a reload, show how many sample records are left (read the new server count) instead of only yes/no #30616 两个 describe 共 8 个。What changes
PR #30613 added
GET /api/v1/marketplace/install-local/:manifestId/sample-data, which answers how many rows a sample-data purge would delete right now, counted with the purge's own matcher and keep-rules. The console only knew a count for an install made in the same browser session (PR #30537); after a reload the purge confirm had no count and the banner that follows the installer to the app was gone.marketplaceApi.countLocalSampleData(manifestId)reads that route and answers{ manifestId, count, unidentified }, ornullwhen the read is refused, fails, or carries no non-negative integercount.notLoadedentry), and again every time the install-local listing is read, which already happens after an install, a reseed and a purge. The answer goes into the existing session record (sampleDataNotice.ts) through the newnoteServedSampleCount:count: 0drops the record and withdraws its banner.localSampleCount), so a count that lands while it is open reaches it; the state keeps only the target. A cloud purge draws no count, as before.count: 0leaves nothing to raise.marketplace.detail.purgeConfirmAtMostsaid the count was "the number this install loaded", false for the runtime's count. All 10 packs drop that clause and keep the upper bound, e.g. enUp to {{count}} sample records will be deleted., zh最多删除 {{count}} 条示例记录。, ru reworded toне более {{count}} …with the singular-genitive_one. The upper bound holds for both sources: the served count is exact, and the session count is at most what a purge deletes. The eagerenpack shrinks (see Verification);#30588's ceiling is untouched.unidentifiedis read but not drawn: saying it needs a new string, which the eagerenpack has no room for until #30588 moves strings to a lazy namespace.Tests
ui/packages/app-shell/src/console/marketplace/__tests__/MarketplacePackagePage.sampleDataNotice-30323.test.tsxis this surface's shared harness, so the new pins are two top-leveldescribes there (one stubbedfetchrouted by path; the realmarketplaceApi):count=42;count: 0drops a record the session held: no count line in the confirm, no banner on leaving;notLoadedentry is never counted;0drops the record.Support edits: 13 suites that mock
../marketplaceApigaincountLocalSampleData: async () => null, and the offline local-menu suite (…offlineLocalMenu-11627.test.tsx) now callscleanup()beforevi.unstubAllGlobals(), because a reseed or purge re-reads the count after the test body returns and that read reached a socket once the double was gone.Acceptance notes
unidentifiedis not drawn (no string budget, see above).marketplacenamespace #30640 (lane card Console first load: the English language pack has 63 bytes left under its size ceiling, so any card that adds English console text fails CI #30588, which moves the marketplace strings out of the eager packs into a lazymarketplacenamespace): this PR changes the values of thepurgeConfirmAtMostfamily inui/packages/i18n/src/locales/*.ts. Whichever of the two lands second carries the new values into the namespace files; if PR perf(i18n, app-shell)!: the marketplace pages' strings leave the eager language packs for a lazymarketplacenamespace #30640 lands first, this branch mergesmainand moves the change there.Verification
Ablation: the count read removed, 5 of the new pins go red
node scripts/ablation-replace.mjs --file ui/packages/app-shell/src/console/marketplace/MarketplacePackagePage.tsx --anchor 'const served = await countLocalSampleData(manifestId);' --replacement 'const served = null as …;' -- …vitest run …sampleDataNotice-30323.test.tsx: anchor 1 → 0, blob3ab826d5e075 → 87d8ee093b8e;Tests 5 failed | 15 passed (20)(the five page-level #30616 pins); restored, blob == HEAD andgit diff HEADempty. The app-shell suite reads this page fromsrc/(relative import), so no build sits between the mutation and the run.Eager en pack, gzip bytes (the CI Build & E2E UI ceiling is 60,000)
Console built from this branch (
turbo run build --filter='@object-ui/console^...', thenCI=true vite buildinui/apps/console);dist/eager-closure.jsonreadsassets/i18n-locale-en-*.jsat 192,979 raw / 59,942 gzip. The same chunk with the three oldpurgeConfirmAtMoststrings swapped back in, re-gzipped withzlib.gzipSync(level 6, what the report uses): 193,081 raw / 59,951 gzip. So −9 B gzip, −102 B raw.node scripts/check-eager-closure-budget.mjs(inui/): exit 0.Local tests and gates
All on head
eef04e97(this branch merged withmainataf8aab1b) unless noted. Lock readings are the lock's own VERDICT lines.pnpm --dir ui exec vitest run packages/i18n/ packages/app-shell/src/console/marketplace/(after rebuilding@object-ui/app-shell^...on the merged tree): Test Files 146 passed (146), Tests 1898 passed, 13 skipped.pnpm --filter @object-ui/app-shell run type-check(source and tests): exit 0, on5581ff5d(the merge brought no file underui/packages/app-shellorui/packages/i18n).pnpm --dir ui exec vitest run scripts/: 170 files passed, 2 skipped; 4970 tests passed.node ui/scripts/check-i18n-en-drift.mjs --base origin/main: exit 0, every changed en value followed by all nine packs.pnpm --dir ui run check:i18n-keys: exit 0 (4,210 keys).node ui/scripts/check-eager-closure-budget.mjs: exit 0 (on5581ff5d's console build).no-explicit-any/ one unused var in the page.node scripts/pm/dispatch-gates.mjs --commands: 35 derived families, every one exit 0;--ranreconciles 35 run, 0 NOT-MEASURED, 0 UNRUN.@object-ui/app-shellsuite (2,303 test files; stopped after 40 minutes at--maxWorkers=2on a shared box). The local run is narrowed to the marketplace directory and the i18n package, the two trees whose files this diff changes or whose mocks name the API it extends;Test UIruns the rest.Live stack (showcase
objectstack dev --fresh, the fake marketplace control plane from #30325's rig, console via vite; evidence in the project's shared files, not committed):deleted: 3, count 0 after, the user's record stays.GET …/sample-datareads; the ⋯ menu's purge confirm readsUp to 13 sample records will be deleted.; leaving the page by its back link raises"Acme Deals" has sample data.with the purge action. After a purge (deleted: 13, count 0), a fresh visit and leave raises no banner.Generated by Claude Code