Repository navigation
feat(app-shell): marketplace card and package page show which languages an app ships - #31855
Merged
Merged
Conversation
… an app ships The catalog card names the latest version's served supported_locales with their coverage, three then how many more; the package page lists every language in its taxonomy strip with the default marked. An answered null reads "No language information"; absent keys draw nothing. Labels follow the platform locale table reading the language menu uses. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUUskSunPYptce52wd
…ocale Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUUskSunPYptce52wd
…odule Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUUskSunPYptce52wd
…aling helpers Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUUskSunPYptce52wd
Contributor
Author
|
domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo Contract reviewServed-tier: This is the lane seat's own review of record, owed by the ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
Contributor
Author
|
domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo 席位核对 · ACCEPT · 2026-11-09T07:53Z · head
|
rajeev-kumar-se
pushed a commit
to rajeev-kumar-se/objectstack
that referenced
this pull request
Nov 10, 2026
…app ships (objectstack-ai#32000) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbYH6pirAR8NaHkLvUrUr9cq)_ Fixes objectstack-ai#31462 Part of objectstack-ai#30284 (the console half; the cloud half is cloud#3803. PR objectstack-ai#31855 landed the card line, the detail group and the null face; this PR lands the languages facet.) Clause-②: no Metadata-protocol: none No new `@object-ui/i18n` key: the facet row reuses `marketplace.facet.languages` from PR objectstack-ai#31855, so no published type widens. ## 维护者速读 - **改了什么**:应用市场目录在「职能/行业/类型」筛选旁新增「语言」一行,按钮来自云端返回的语言计数,例如「简体中文 3」。选中后按 `?languages=` 筛选,和其它筛选是 AND 关系。另外,卡片和详情页的默认语言改为按 `default_locale` 判定并排在最前,不再默认取第一个。 - **为什么改**:这是 objectstack-ai#31462 剩下的筛选部分。云端已在卡片上说明计数位于 `data.facets.languages`。之前的实现把第一个语言当作默认语言,但云端说明默认语言不一定排在第一个。 - **风险与回滚**:改动只在控制台,不涉及接口和数据。云端没有返回语言计数时(生产环境目前就是这样),页面和现在一样。回滚即还原本 PR。 - **先看**:`marketplaceTaxonomy.ts`(`readLanguageCounts` 与 `languageFacetEntries`)、`MarketplaceFacetFilters.tsx`(语言行)、`shippedLanguages.ts`(默认语言判定)。 - **两分钟验证**:`cd ui && pnpm exec vitest run packages/app-shell/src/console/marketplace/__tests__/MarketplacePage.facets-31011.test.tsx packages/app-shell/src/console/marketplace/__tests__/MarketplacePackagePage.taxonomy-31011.test.tsx`,预期 31 个用例全部通过。 - **需要你做的**:无,由席位落地。 ## What changes - **The served shape**, per the cloud lane's reading on the card (comment 6737348900, cloud `main` `d189d279`): the list answer is `{ items, total, limit, offset, facets }`, and `facets.languages` is an array of `{ value, count }`. It lists counts above zero only, most listings first, then by value. `value` is the stored locale tag, which `?languages=` takes back verbatim. The counts are disjunctive: a facet's counts apply every other filter but not its own selection. - **`marketplaceApi.ts`**: `MarketplaceListResponse.facets` (`MarketplaceFacetCounts`, with all four count lists typed and only `languages` read) and `MarketplaceListParams.languages`, sent like the taxonomy facets as ONE comma-joined parameter. - **`marketplaceTaxonomy.ts`**: - `FacetSelection.languages`. - `facetListParams` sends the selection sorted, so one selection is one request spelling. - `readLanguageCounts` reads `facets.languages`. It returns `null` when the answer has none, and drops an entry that is not a selectable value. - `languageFacetEntries` keeps the catalog's order, labels each value through objectstack-ai#30514's reading (`localeLabel` over `resolveBuiltInLanguage`, via `languageLabel`), and appends any selected value the newest counts no longer name, without a count. - **`MarketplaceFacetFilters.tsx`**: a Languages row after the taxonomy rows, with toggle buttons carrying their count. With no counts and no selection, no row is drawn, so an empty list draws no facet, as an unserved taxonomy facet does. - **`MarketplacePage.tsx`** keeps the newest answer's counts and hands them to the row. - **`shippedLanguages.ts`, the default locale**: PR objectstack-ai#31855 marked the first served locale as the default. The cloud lane's reading says the default is a row of `locale_coverage.locales` on every branch, but not always the first one, because the rows follow bundle order when the app declares no locales. The reader now marks the default by `locale_coverage.default_locale` and lists it first, on the card and on the package page. Without a coverage, nothing is marked. ## Tests New cases in the existing harness files, each driven through the rendered page with the stubbed list door. The stub now also serves `facets` when a case gives it. - `MarketplacePage.facets-31011.test.tsx`, "Marketplace languages facet": - The counts are drawn in the served order with native names and counts (`English4`, `简体中文3`, `日本語1`, `ไทย1`), and the first read sends no `languages`. - A selection sends `languages=zh-CN`, then `languages=ja-JP,zh-CN`. Deselecting both drops the parameter. - A selected `th` that another filter's answer no longer counts stays on the row, pressed, without a count. - CONTROL: an empty `languages` list, and an answer with no `facets`, both draw no row while the taxonomy rows still draw. - The card lists `简体中文 100% · English 80%` when `default_locale` is `zh-CN` and `zh-CN` is served second. - `MarketplacePackagePage.taxonomy-31011.test.tsx`: the default is marked by `default_locale` and listed first, even when it is served last. <details><summary>Runs at head 255fedc (main c924627, nothing newer on main at report time)</summary> - `@object-ui/i18n` whole package, plus every file under `console/marketplace/__tests__/` and the three `LocaleSwitcher` tests: `Test Files 161 passed (161)`, `Tests 2409 passed | 13 skipped`. - `pnpm --dir ui exec vitest run scripts/`: `Test Files 171 passed | 2 skipped (173)`, `Tests 5062 passed`. - `turbo run type-check --filter=@object-ui/app-shell`: 69/69 tasks, and the app-shell `type-check` executed (cache miss). - `eslint` on the touched files: 0 errors. </details> <details><summary>Ablation (scripts/ablation-replace.mjs, each leg restored to its HEAD blob)</summary> - `LIST_FILTERS` without `'languages'`: exactly the two cases that read the `?languages=` request go red (`2 failed | 29 passed`). - `isDefault` keyed on `codes[0]` (the position, as before): exactly the two default-locale cases go red (`2 failed | 29 passed`). </details> ## Acceptance notes - **Live verification NOT MEASURED.** Staging is unreachable from this container (the egress proxy answers 403 to CONNECT for the cloud hosts), so the shape is the cloud lane's quoted reading, and there are no live screenshots. Production does not serve the counts yet; there the catalog draws no languages row. - **objectstack-ai#31834** still stands. On the runtime's public-snapshot path (`OS_MARKETPLACE_PUBLIC_BASE_URL`), the proxy filters the snapshot itself, ignores `?languages=`, and re-serializes the page without `facets`. On that path this row stays hidden, but a `?languages=` request sent there would answer the unfiltered catalog. The default path forwards the query to the cloud unchanged. - The spec's `MarketplaceSearchResponseSchema.facets` declares no `languages`, and spells its counts camelCase, while the cloud door answers snake_case keys. This is noted only; no `packages/spec` change is in the claim. ## Verification - Derived gate list (`dispatch-gates --commands`, 37 commands): every gate ran locally at head 255fedc and exited 0, reconciled with `--ran`. The PR-body gates ran against this body. - `node scripts/check-sdui-manifest.mjs` and its `--self-test`: exit 0. --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jUUskSunPYptce52wd)_ Co-authored-by: Claude <noreply@anthropic.com>
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 Steedos · project thread
Part of #31462. The card, detail and null faces land here; the languages facet follows in its own PR once the cloud lane names where the list answer carries the
languagescounts (asked on the card, unanswered at this head).Part of #30284 (the console half; the cloud half is cloud#3803, live on staging).
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
ui/packages/app-shell/src/console/marketplace/shippedLanguages.ts(三种回答的判定)、MarketplaceLanguages.tsx(卡片行与详情组)、ui/packages/i18n/src/namespaces/marketplace/en.ts(新增 4 个键)。cd ui && pnpm exec vitest run packages/app-shell/src/console/marketplace/__tests__/MarketplacePage.facets-31011.test.tsx packages/app-shell/src/console/marketplace/__tests__/MarketplacePackagePage.taxonomy-31011.test.tsx,预期 25 个用例全绿。What changes
marketplaceApi.tstypes the two keys cloud#3803 serves on every version:supported_locales: string[] | null(the locales that carry text, default first, as the app declares them) andlocale_coverage: { default_locale, expected_keys, locales: [{ locale, translated, coverage_percent }] } | null. Both optional: a catalog that does not serve them yet still type-checks and reads as absent.shippedLanguages.ts(new) reads a version into one of three answers, kept apart on purpose:unserved, nothing drawn, so the CONTROL catalog renders exactly as before;supported_locales: null:unknown, "No language information", never "English only";coverage_percent(a locale the coverage has no row for is drawn without a percent), the first marked default.Names follow i18n phase 4 (locale menu): the Console language menu offers the PLATFORM_LOCALES languages, intersected with an app’s supportedLocales #30514's reading, with no second map:
localeLabel(resolveBuiltInLanguage(code) ?? code), sozh-CNreads 简体中文 as in the language menu andth, outside the platform table, reads ไทย. Percents are formatted withIntl.NumberFormatinuseDisplayLocale(), so no pack carries a format string.MarketplaceLanguages.tsx(new): the card's line (three languages, then+N more; the full list in the tooltip and the screen-reader text) and the package page's "Languages" group in the taxonomy strip (every language, the default marked, the served code as each badge's title).MarketplacePage.tsx/MarketplacePackagePage.tsxmount them: the card under its description, the detail group after the taxonomy groups, reading the version the page already calls latest.@object-ui/i18n: four keys in each of the eleven marketplace catalogues (namespaces/marketplace/*.ts,zh-Hantregenerated bygen:zh-hant):marketplace.facet.languages,marketplace.languages.none,marketplace.languages.more(placeholderextra),marketplace.languages.default. They are published through the./localesentry (en: typeof enPack & typeof enMarketplace), henceClause-②: yes (widening).Tests
New
describeblocks in the existing harness files (each case drives the rendered page through a stubbedfetchthat answers the proxy's body):MarketplacePage.facets-31011.test.tsx· "Marketplace card languages": a measured version showsEnglish 100% · 简体中文 100% · 日本語 60% · +1 morewithไทย 12.5%in the tooltip and screen-reader text, and a locale without a coverage row draws without a percent; anullversion reads "No language information" and not "English"; CONTROL, a catalog without the keys draws no line.MarketplacePackagePage.taxonomy-31011.test.tsx· "Details — the languages an app ships": the full list in served order with the default marked; thenullface; CONTROL, no group.Runs at head 6351a1a (the merge of main d6e28c0 brought no ui or spec change; the suites below ran on the branch commits before it and were re-run where a later commit touched their files)
@object-ui/i18nwhole package, plus every file underconsole/marketplace/__tests__/and the threeLocaleSwitchertests:Test Files 161 passed (161),Tests 2403 passed | 13 skipped. The de quote-pairing, count-family, untranslated-identity, machine-locale and namespace censuses are in that run.ui/scripts/__tests__/percent-storage-callers-11475.test.tsafter the last source commit:Test Files 3 passed (3),Tests 38 passed (38).pnpm --dir ui exec vitest run scripts/:Test Files 170 passed | 2 skipped (172),Tests 5027 passed.turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n: 70/70 tasks, bothtype-checktasks executed (cache miss).node ui/scripts/check-i18n-en-drift.mjs: exit 0 (no designer en value changed);eslinton the touched files: 0 errors.Ablation (each leg through scripts/ablation-replace.mjs, restored to the HEAD blob c87a3e41)
if (served === null) return UNKNOWN;→return UNSERVED: exactly the two null-face cases go red (2 failed | 23 passed).if (!Array.isArray(served)) return UNSERVED;→return UNKNOWN: exactly the two CONTROL cases go red (2 failed | 23 passed).Acceptance notes
data.facets.languages,data.languages, a record keyed by tag…). The question is on the card for the cloud lane; the facet follows in its own PR once answered, never on a guessed shape.OS_MARKETPLACE_PUBLIC_BASE_URLset) the runtime's marketplace proxy filters and pages the catalog itself and does not read?languages=, so a languages filter would answer the unfiltered catalog. It is filed separately (packages/cloud-connection, outside this card's surface); the default path, which forwards the query to the cloud unchanged, is the one this card builds on.MarketplaceSearchRequestSchema/MarketplaceSearchResponseSchemadeclare nolanguages; the cloud list door does not answer that schema today either. Noted, not changed here (nopackages/specin the claim).Verification
dispatch-gates --commands, 39 commands): all run locally, exit 0, reconciled with--ran(39 derived, 39 run, 0 NOT-MEASURED). 34 re-ran at head 6351a1a;pnpm --dir ui exec vitest run scripts/andpnpm check:type-check-debtran at the last branch commit before the merge of main, which brought no ui or spec change; the three PR-body gates andcheck-partof-closing-keywordran against this body.node scripts/check-sdui-manifest.mjsand its--self-test: exit 0.Generated by Claude Code