Skip to content

feat(app-shell): marketplace card and package page show which languages an app ships - #31855

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-n3nvnk
Nov 9, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-n3nvnk

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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 languages counts (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

维护者速读

  • 改了什么:应用市场卡片显示该应用最新版本支持的语言和翻译覆盖率(如「简体中文 100% · 日本語 60%」,最多三个,其余显示「+N more」),详情页在分类标签栏列出全部语言并标出默认语言;旧版本(未测量)显示「无语言信息」。
  • 为什么改:客户选应用时看不出它有没有中文等语言、翻译了多少;cloud#3803 已在发布时测量并下发这两个字段,控制台这一半负责显示。
  • 风险与回滚:只读显示,不改数据和接口;接口没返回这两个字段(生产环境目前就是这样)时页面和现在完全一样。回滚即还原本 PR。
  • 先看: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.ts types 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) and locale_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:
    • keys absent: unserved, nothing drawn, so the CONTROL catalog renders exactly as before;
    • supported_locales: null: unknown, "No language information", never "English only";
    • a list: each locale in served order with its served 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), so zh-CN reads 简体中文 as in the language menu and th, outside the platform table, reads ไทย. Percents are formatted with Intl.NumberFormat in useDisplayLocale(), 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.tsx mount 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-Hant regenerated by gen:zh-hant): marketplace.facet.languages, marketplace.languages.none, marketplace.languages.more (placeholder extra), marketplace.languages.default. They are published through the ./locales entry (en: typeof enPack & typeof enMarketplace), hence Clause-②: yes (widening).

Tests

New describe blocks in the existing harness files (each case drives the rendered page through a stubbed fetch that answers the proxy's body):

  • MarketplacePage.facets-31011.test.tsx · "Marketplace card languages": a measured version shows English 100% · 简体中文 100% · 日本語 60% · +1 more with ไทย 12.5% in the tooltip and screen-reader text, and a locale without a coverage row draws without a percent; a null version 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; the null face; 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/i18n whole package, plus every file under console/marketplace/__tests__/ and the three LocaleSwitcher tests: 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.
  • The two touched harness files plus ui/scripts/__tests__/percent-storage-callers-11475.test.ts after 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, both type-check tasks executed (cache miss).
  • node ui/scripts/check-i18n-en-drift.mjs: exit 0 (no designer en value changed); eslint on 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

  • Live verification NOT MEASURED: staging is unreachable from this container (the egress proxy answers 403 to CONNECT for the cloud hosts), and the cloud repository is not readable from this lane, so the served shape is the card's statement and there are no live screenshots. Production does not serve the keys yet (cloud seat reading on the card); there the page reads exactly as today.
  • The languages facet is not in this PR. Its values can only come from the served counts, and the card does not say where the list answer carries them (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.
  • cloud-connection: the marketplace proxy's public-snapshot path ignores ?languages= (silent unfiltered 200) and drops facet counts (#31462 finding) #31834: on the public snapshot path (OS_MARKETPLACE_PUBLIC_BASE_URL set) 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.
  • The spec's MarketplaceSearchRequestSchema / MarketplaceSearchResponseSchema declare no languages; the cloud list door does not answer that schema today either. Noted, not changed here (no packages/spec in the claim).

Verification

  • Derived gate list (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/ and pnpm check:type-check-debt ran at the last branch commit before the merge of main, which brought no ui or spec change; the three PR-body gates and check-partof-closing-keyword ran against this body.
  • node scripts/check-sdui-manifest.mjs and its --self-test: exit 0.

Generated by Claude Code

… 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
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 9, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 6351a1aa05741456db61c1e00d2bc72f9d6e66cc
Local-runs: none

This is the lane seat's own review of record, owed by the Clause-②: yes declaration alone (face declaration). packages/spec/** and the server are untouched. check-governed-merges --pr 31855 reads NOT governed (450 lines).

① Derived judgments

  • @object-ui/i18n is published and only widens. All 11 marketplace catalogues (namespaces/marketplace/*.ts, the lazy namespace, as the amendment corrected) gain four keys: marketplace.facet.languages, marketplace.languages.none, .more and .default. No key is removed or reworded. zh-Hant is generated.
  • @object-ui/app-shell is private.
  • No request changes. The facet, the only new read, is held as the amendment ruled, and the PR carries it as Part of #31462.
  • Metadata-protocol: none is RIGHT. No author-written key, value or meaning changes.
  • Accept sets: none change.

② Semver level

  • .changeset/31462-marketplace-app-languages.md marks @object-ui/app-shell and @object-ui/i18n as patch.
  • Both declaration lines are at line start, in the changeset and in the PR body.
  • That is RIGHT: a widening ships as patch.

③ Boundary flags

Implemented-by: claude/project-thread-n3nvnk
Reviewed-by: session_01QsR2jVEjiYrK7onirxUGyo

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo

席位核对 · ACCEPT · 2026-11-09T07:53Z · head 6351a1aa05741456db61c1e00d2bc72f9d6e66cc

Seat domain:ui#3 reviewed the diff of its own dispatch for #31462. The card thread is session_01QsR2jUUskSunPYptce52wd, and the os-dev-report is 6734730777. Checked against GitHub, not against the report.

  1. Shape: 19 files, +450 / -0, draft on main, Part of #31462 and Part of #30284.
    • shippedLanguages.ts is the reader. It keeps three answers apart: keys absent (draws nothing), null ("No language information"), and a list (default first, with coverage).
    • MarketplaceLanguages.tsx draws the card line (three, then "+N more", with the full list in the tooltip and screen-reader text) and the detail page's taxonomy group (default marked).
    • Two optional read keys on MarketplacePackageVersion.
    • Four keys in each of the 11 lazy marketplace catalogues.
  2. Premise: cloud#3803 serves supported_locales / locale_coverage on staging. The console drew nothing of it. The step-1 report is 6733694533, and the amendment is 6733722107.
  3. Gates and check-runs:
    • 57 runs on this head: 44 success, 13 skipped, 0 red. mergeable_state is clean.
    • Dev: 39/39 derived gates exit 0, with --ran reconciled. The i18n package and 161 files were run by hand; the derived loop runs no ui vitest.
    • Two ablations turn red exactly on the null and CONTROL cases.
  4. Declaration review: TIER_DEFAULT PASS, record 6734758230 on this head.
  5. Tests read:
    • The card line shows three and "+N more", and the full list is in title and the sr text.
    • null reads "No language information" and never "English only".
    • The CONTROL: absent keys draw nothing, on both card and detail.
    • The detail group marks the default.
    • An out-of-table code is named by CLDR and kept as served.
    • The percents are locale-formatted.
  6. Accepted deviations:
  7. Landing:

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 9, 2026 07:54
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 9, 2026 07:54
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 1ff1d45 Nov 9, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-n3nvnk branch November 9, 2026 08:12
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>
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/m 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