Repository navigation
chore(i18n): remove the unused savedOutsideApp messages from every locale - #38370
Merged
Merged
Conversation
…cale Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzywxH36FPH6ayWMUe
Contributor
Author
|
repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978 L1-b, the seat's L1 thread for zone o3-studio · 2026-11-28T16:42Z 席位核对 — L1 REWORK @
|
…sages Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzywxH36FPH6ayWMUe
Contributor
Author
|
repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978 L1-b, the seat's L1 thread for zone o3-studio · 2026-11-28T17:08Z 席位核对 — L1 delta ACCEPT @
|
Contributor
Author
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T17:10Z · zone
|
Nenzyz
pushed a commit
to Nenzyz/objectstack
that referenced
this pull request
Dec 1, 2026
…as a shared mapping, and Manage it in Studio (objectstack-ai#38357) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoXjoHKbjY5r1kWnzkDHsGaB)_ Fixes objectstack-ai#37359 repo:objectstack#3 · os-tesla · session_01L9qibxL8ZWRpBvBqgZ5Vor Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 管理员在应用里导入数据时,对好列之后,可以在预览这一步把列的对应、写入方式和匹配字段存成大家都能选的共享映射,存进应用的软件包;应用没有可用的软件包时先问存到哪个包,取消就什么都不写。「已保存的映射」旁边多一个「管理」,打开 Studio 里这个对象的字段映射列表。没有权限的人看不到这两个按钮。 - 属于「导入用的共享字段映射在哪里新建和管理」这张决策卡,你选了 A 并排期为 p2。 - 存错了只是多一条共享映射,可以在 Studio 里删掉;名字已被占用、取消选包、系统应用里都不会存。 - 无 ## What changes - **`ImportWizard` takes two optional props** (`ImportWizard.tsx`): - `onSaveSharedMapping(draft)`: the host's door for saving a shared `mapping` item. When it is passed, the **preview step** shows "Save as shared mapping" under the write-mode panel, where the columns, the write mode and the match fields are all known (the claim's premise correction: the ruling said the mapping step, but write mode and match fields are collected on the preview step). The form asks for a label and an API name, suggested from the label, and checked against the spec's `SnakeCaseIdentifierSchema`. The saved mapping joins the Saved mapping list at once. A rejection keeps the form open and shows its message; a host that resolves `null` wrote nothing and adds nothing. - `onManageMappings()`: "Manage" beside the Saved mapping selector. - Neither is offered while a saved mapping is in use (that mapping already owns the columns). - **`sharedMappingDraft.ts`** (new, pure): `buildSharedMappingDraft` turns the wizard's column index → field map into the `mapping` item: `fieldMapping` is one `{ source: header, target: field }` per mapped column in column order, `mode` is the write mode, `upsertKey` the match fields (only for update and upsert), each `source` the header trimmed, as the import door trims a header before it looks one up (`import-prepare.ts`); `sourceFormat: 'csv'` (the import door applies a `csv` mapping to CSV, Excel and pasted rows alike, and the wizard sends such a mapping's rows as CSV text from every source). It refuses: nothing mapped; update or upsert with no match field; a mapped column whose header is blank or shared with another column, since the import door finds a column by its header text. The per-import toggles (create missing options, skip blank match keys, background job) have no key on a mapping and stay with the import. - `index.tsx` exports the `SavedMapping` and `SharedMappingDraft` types for the host. - **The app (`@object-ui/app-shell`)**, after PR objectstack-ai#38204 merged, per the claim: - `objectViewSharedMapping.ts` (new): `sharedMappingDoors` hands the wizard both props only when `mayManageViews` holds (an administrator holding `manage_metadata`, the shared-view rule), never on the identity import, and never without a metadata client. `ObjectView` spreads it into the `ImportWizard`. - `saveSharedImportMapping` first reads `GET /meta/mapping/<name>` and refuses a name a mapping already holds, in any package. The draft save's first-write pin (`If-None-Match: *`) only asserts that no **draft** row exists, so without the read a save would replace a published mapping of the same name; and a name two packages hold is refused at import (`409`). Then it calls `saveAndPublishRuntimeMetadata('mapping', …)` with the app (`useRuntimeCreateApp`), so the mapping goes into the app's package or its pair, or the package the person picks in objectstack-ai#38204's ask. A cancelled ask resolves `null`, which writes nothing and keeps the wizard's form open; a system app and a caller the package door refuses are refused with their reason; a pending draft of that name is refused and nothing is published. No path saves a mapping naming no package. - `RuntimeArtifactType` gains `'mapping'`. - Manage closes the wizard and opens `/studio/~all/metadata/mapping?targetObject=<object>`: every package's mappings, the same set the wizard's Saved mapping list offers. - The metadata list state gains `targetObject` (`LIST_TARGET_OBJECT_PARAM`, `metadataListState.ts`). It narrows only a type whose reader names a row's object; `ResourceListPage` gives that reader to `mapping` alone and draws the narrowing as a chip ("Object: crm_lead ×") in both the Studio and the Setup toolbars, whose × shows every object again. - i18n: 13 new `grid.import.*` keys and 3 `console.objectView.sharedMapping*` keys (name taken, draft pending, system app) in every language pack; `zh-Hant` regenerated by `gen:zh-hant`; 2 `engine.list.targetObject*` keys in the Studio namespace (en, zh). The de quote-pairing pin counts the five new „…“ pairs (128 → 133). - Changeset `37359-import-wizard-shared-mapping.md`: `@object-ui/plugin-grid`, `@object-ui/i18n` and `@object-ui/app-shell` **patch**. The claim named `minor`; `check-changeset-no-major.mjs` grades every entry `patch` under `Metadata-protocol: none`, so patch it is. - **The ADR-0146 dated line is not in this PR.** Per the claim it goes into the weekly ADR PR, as the card body says. ## Tests - `sharedMappingDraft.test.ts` (9): the insert shape, a header saved trimmed, the upsert shape (also parsed by the spec's `MappingSchema`), a match field whose column was unmapped, nothing mapped, blank and shared headers (each named once), a duplicated header on an unmapped column, the name grammar, the name suggestion. - `ImportWizard.sharedMappingSave-37359.test.tsx` (10), through the real wizard: no door → no save; the insert draft; the upsert draft and the "choose the match fields" reason; a shared header refused before any call; a bad API name cannot be sent; a refused save; a saved mapping listed and then picked, after which there is nothing to save; a `null` save adds nothing; Manage with and without the door. - `objectViewSharedMapping-37359.test.ts` (11), with a real `MetadataClient` over a fake `/meta` door and the package list stubbed at `fetch`: the saved request (`PUT /meta/mapping/supplier_list?mode=draft&package=com.example.crm`, `If-None-Match: *`, header → field, `mode: upsert`, `upsertKey: ['email']`, then the publish); a taken name refused with zero writes; a pending draft refused with no publish; no app package → the ask, and the save names the picked package; a cancelled ask → `null`, zero writes; a system app refused, never asks, zero writes; who gets the doors (admin both; non-admin, identity import, no client: none); Manage closes and navigates; Manage's address decodes back to the object. - `metadataListState.targetObject-37359.test.ts` (3): the codec round trip and a blank value; narrowing; a reader with no object is not narrowed. - `ResourceListPage.targetObject-37359.test.tsx` (4), the real page: the narrowed list under its chip; the × lists every object and drops the param; no param, no chip; a type whose rows name no object (`skill`) is not narrowed. ## Acceptance notes - Measured in tests, not in a browser: the package ask opens over the import wizard's own dialog (two Radix dialogs stacked, the same shape as objectstack-ai#38204's ask over Create View). - Still to measure on a real server: that a named-mapping import accepts a match-only (readonly or autonumber) field in `upsertKey`. The wizard offers such fields as match fields, and the draft saves what was chosen. ## Verification <details><summary>Tests</summary> - Import wizard half at 8b1e3b8: `pnpm --dir ui exec vitest run packages/plugin-grid/ packages/i18n/`: 430 files, 4704 passed, 13 skipped. `@object-ui/plugin-grid` and `@object-ui/i18n` `type-check`: exit 0. - App half at afeff95: the 4 new files, 18/18. `vitest run` over app-shell's `ResourceListPage*`, `metadataListState*`, `runtime-metadata-persistence*`, `objectView*`, `ObjectView*`, `__tests__/identityImport*`, `useListOrderedNames*` and `packages/i18n/`: 258 files, 3147 passed, 13 skipped. `@object-ui/app-shell` `type-check` (`tsc --noEmit && tsc -p tsconfig.test.json`): exit 0, after a declaration build of `@object-ui/app-shell^...`. </details> <details><summary>Ablation</summary> Each mutation landed on disk through `ablation-replace.mjs` and was restored (blob equal to HEAD, `git diff HEAD` empty). Import wizard half: - the shared-header refusal turned off: 2 failed (the pure refusal and the wizard's disabled save); - `upsertKey` dropped from the draft: 2 failed (the pure upsert shape and the wizard's upsert draft); - Manage never drawn: 1 failed; - the save drawn without a host door: 1 failed; - the header saved untrimmed: 1 failed (the trimmed-header pin), at 81774d0. App half, against the 18 new app tests (baseline 18/18): - the name read skipped: 1 failed (a taken name); - a cancelled ask rethrown instead of `null`: 1 failed (cancel); - `'pending-draft'` ignored: 1 failed (pending draft); - the `canManageViews` gate dropped: 1 failed (non-admin gets neither); - the list's `targetObject` narrowing deleted: 2 failed (the pure narrowing and the real page's narrowed list); - the chip never drawn: 2 failed (the chip and its ×). </details> <details><summary>Derived gates</summary> At 9008472: 43 of 43 derived families run, each exit 0; `dispatch-gates --ran` accounted (43 derived, 43 run, 0 not measured, a derived zero). List with exit codes: `gates-ran-90084723.list` in the card's project folder. The run started at afeff95; the one-file lint fix of 9008472 (`objectViewSharedMapping.ts`, the caught error kept as `cause`) landed during it and changes no derived path. At 81774d0 (the trim and the changeset's `Clause-②` line, two already-changed files plus a test): no derived path changes; `check-changeset-no-major` exit 0, plugin-grid `type-check` exit 0, ESLint 0 errors, the two plugin-grid shared-mapping test files 19/19. `overlap-check` at afeff95: clean against `origin/main` (bc31d45) and the two open PRs that share files (objectstack-ai#38370 the locale packs, objectstack-ai#38318 the Studio namespace). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibxL8ZWRpBvBqgZ5Vor)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibxL8ZWRpBvBqgZ5Vor <!-- signed: repo:objectstack#3 · os-tesla · session_01L9qibxL8ZWRpBvBqgZ5Vor --> --------- 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 Tesla · project thread
Part of #38149
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
PR 2 of #38149. PR 1 (#38204, merged at bc31d45) stopped reading the i18n keys
view.savedOutsideAppandreport.builder.savedOutsideApp; this PR deletes both entries from each of the 11 bundled locales inui/packages/i18n/src/locales/(ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant) — 22 deleted lines, nothing else. One patch changeset on@object-ui/i18n..changeset/pre/*untouched.Premise grep at base bc31d45 (
git grep -n savedOutsideApp): hits only the 11 locale files, the two.changeset/preentries, and historical CHANGELOG.md lines in app-shell and i18n. No source or test file reads either key. After the change: only the.changeset/preentries and CHANGELOGs remain.No key-census baseline lists them;
all-locales-key-parity.test.tsstays green because every locale drops both keys together.Tests
i18n package (head e2ac23d)
pnpm --filter @object-ui/i18n test: Test Files 110 passed (110), Tests 1874 passed | 13 skippedpnpm --filter @object-ui/i18n type-check: VERDICT command-exit 0Verification
Read first: any one locale diff, e.g.
ui/packages/i18n/src/locales/en.ts. Two-minute check:git grep -n savedOutsideApp -- ui/packages/*/srcprints nothing.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibzywxH36FPH6ayWMUe