Skip to content

Commit 589be30

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-xcbmm5
2 parents 9ea89d0 + 74fd4bf commit 589be30

198 files changed

Lines changed: 13082 additions & 1041 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec)!: a locale tag written in another case is corrected to its BCP-47 case — a translation saved as `zh-cn` reaches `zh-CN` sessions — and a translation bundle with two keys that fold to one tag is refused
6+
7+
Clause-②: no (narrowing)
8+
Metadata-protocol: narrowed
9+
10+
A translation saved with `locale: 'zh-cn'` answered 200, and a `zh-CN` session kept rendering the stock strings. Case was accepted as written on the premise that the resolvers fold it, but a resolver answers one locale for a request, exact match first, so the stock `zh-CN` bundle won and the `zh-cn` entry was never merged into it.
11+
12+
- **The parse corrects case.** `LocaleSchema` returns each tag in its BCP-47 case: the language subtag in lower case, a script in title case, a region in upper case, and every subtag after a singleton in lower case. `zh-cn` reads back as `zh-CN`, `zh-hans-cn` as `zh-Hans-CN`, `EN` as `en`. This reaches every reader of the schema: a translation item's `locale`, a `TranslationBundle` / `PlatformTranslationBundle` locale key, `i18n.defaultLocale` / `fallbackLocale` / `supportedLocales`, a seed dataset's `locale` scope and the seed loader's `locale`. A canonical tag is returned unchanged, and nothing that parsed before is refused, with the one exception below.
13+
- **Stored rows are read back canonical.** The metadata save door stores the authored body, so a row saved as `zh-cn` stays `zh-cn` at rest. A new stored-row conversion, `translation-locale-tag-case-folded`, folds case right after `translation-locale-tag-canonicalized` rewrites `_` and padding, and the runtime-authored translation sync replays both before keying a row by its locale. A row saved as `zh-cn` is served to `zh-CN` sessions from the next sync on, with nothing to re-save. An artifact built by `@objectstack/spec` 18.2.0 or earlier is folded the same way.
14+
- **Case only.** The fold never replaces a legacy or macrolanguage subtag the way `Intl.getCanonicalLocales` does: `iw` stays `iw`, `cmn-cn` becomes `cmn-CN`. That keeps a translation on the locale its author named, and gives the same answer in every runtime.
15+
- **Upgrade path.** The ADR-0087 D3 semantic entry `translation-locale-case-canonicalized` carries both halves to `os migrate meta` and the upgrade guide. No key is added or removed, and the published JSON Schema of a locale is unchanged.
16+
- **Exact matchers that read a folded locale against a row tagged as written.** The email-template floor warning compares `i18n.supportedLocales` with `emailTemplates[].locale`, and the messaging template ladder compares the default locale with `sys_notification_template.locale`. A row tagged `zh-cn` no longer matches a supported or default locale authored as `zh-cn`, which now reads `zh-CN`: re-tag the row in its canonical case.
17+
18+
<!-- adr-0087: registered translation-locale-case-canonicalized -->
19+
20+
**BREAKING** for an author whose one translation bundle spells a locale twice, in two cases.
21+
22+
- **Before.** `{ 'zh-cn': { messages: { save: '保存' } }, 'zh-CN': { messages: { cancel: '取消' } } }` parsed as a `TranslationBundle` (or `PlatformTranslationBundle`) with both keys kept, and the `zh-cn` strings never reached a `zh-CN` session.
23+
- **Now.** Both keys fold to `zh-CN`, so keeping both would put two entries on one key and silently drop one set of strings. The parse refuses the bundle at the second key, naming both keys and the tag they fold to. Two separate bundles in `stack.translations`, one with `zh-cn` and one with `zh-CN`, are still accepted; the runtime merges them as one locale.
24+
- **Fix.** FROM a bundle holding both spellings, `{ 'zh-cn': A, 'zh-CN': B }`, TO one canonical key holding both sets of strings, `{ 'zh-CN': A and B merged }`, merged by hand: where both set the same string, keep the one you mean. No bundle in this repository has such a pair. A stored row with such a pair and different strings under the two keys is left as stored by the conversion and reported as a TODO.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
fix(spec)!: an inline action (`InlineActionSchema`, a page button's `properties.action`) refuses `confirmText` beside a non-empty `params`, as a registered action (`ActionSchema`) already does, instead of accepting a pair that opens two dialogs for one decision
6+
7+
The console runs an inline action through the registered action's runner: it awaits the confirm dialog, and only then opens the param dialog. So an inline action carrying both keys showed the user a confirm that already read as "the action ran" while nothing had been sent, then a second dialog. `ActionSchema` refused that pair; the inline door accepted it, because until the inline pick carried `description` there was nowhere to move the question. It carries `description` now, so the inline door refuses the pair with the same predicate and the same message as the registered door, at the `confirmText` path.
8+
9+
Clause-②: no (narrowing) — `InlineActionSchema` refuses `confirmText` beside a non-empty `params`, which it accepted before. Nothing is widened.
10+
11+
Metadata-protocol: narrowed (an inline action may no longer declare `confirmText` beside a non-empty `params`)
12+
13+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed or renamed: the inline door already picked both keys and keeps them, and this adds the pair refusal ActionSchema carries. There is no rewrite that keeps what the author meant without reading it (the confirm sentence may or may not suit the param dialog's description line), so the author decides, and the refusal names the remedy. The in-repo census at the base found no shipped inline action carrying the pair. -->
14+
15+
**BREAKING** accept-set narrowing at `InlineActionSchema` (`@objectstack/spec`), served where a page's `element:button` `properties.action` is judged: the component-props gate (`component-props-invalid`, `@objectstack/lint`) at every CLI command (`os validate`, `os compile`, the publish gate) and at the runtime `page` save door. `defineStack` does not parse a component's `properties` bag, so it does not refuse the pair.
16+
17+
- **Before.** `{ type: 'api', target: '/x', confirmText: 'Reject this request?', params: [{ name: 'reason', type: 'textarea' }] }` parsed clean, and the console showed a confirm dialog and then the param dialog.
18+
- **Now.** The same body is refused at `confirmText` with the registered door's message: the pair shows TWO dialogs for one decision; carry the question in `description` and drop `confirmText`.
19+
- **Unchanged.** `confirmText` on an inline action with no `params`, or beside `params: []`, parses as before; so does an inline action with `params` and `description`. A view's `bulkActionDefs` keep the pair, which renders one dialog by that schema's own contract.
20+
- **Who sees it.** An author whose page button declares an inline action with both keys. A stored page keeps loading and serving; its next save is refused, with the remedy in the finding.
21+
22+
**The remedy.** Move the confirm sentence to the inline action's `description`, which the param dialog draws under its title, and drop `confirmText`.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
fix(objectql): a write answers every stored declared column the driver did not echo as `null`, so the insert and update answer is the record the next read returns, on every driver (#29538)
6+
7+
Clause-②: no — nothing a request may send is refused or newly admitted, and nothing a write stores changes; measured on base and head through the engine and the protocol doors on SQLite, driver-memory and driver-mongodb (fake `Db`), every write was accepted on both. An insert or by-id update answer gains a `null` key for a stored declared column the driver did not echo, and on driver-mongodb and driver-memory a `formula` over such a column in that answer now evaluates against that `null`, as the next read and driver-sql already did.
8+
Metadata-protocol: none
9+
10+
- **Before.** After #29408, `find` and `findOne` answer an unwritten declared column `null` on every driver, but the write answer still came straight from the driver. driver-sql echoed `null` (its table has the column); driver-mongodb and driver-memory echoed only the keys the write stored. So a create on mongo or memory answered `{ title: 'x' }` and the very next `GET` of the same row answered `{ title: 'x', note: null }`, and a formula reading `note` answered `null` (a fault) in the create response and its value on the `GET`.
11+
- **Now.** The engine answers the insert result (single, batch, and each `insertMany` outcome) and the by-id update readback on every stored declared column, `null` where the driver echoed no key, before the formulas and the `afterInsert` / `afterUpdate` hooks. Every door on those two verbs answers alike: `POST /data/:object`, `PATCH /data/:object/:id`, `createManyData`, `updateManyData`, and `batchData` create / update / both upsert arms.
12+
- **Never a `null` the row does not hold.** A column the insert payload, or the PATCH and then the stored row before it, carries a value for is stored, so a driver that stores it without echoing it leaves it absent from the answer, as before, rather than answered `null`. A reader that layers the payload under the answer (the record-change flow's `record`, which overlays the write result on the input) keeps the value it wrote.
13+
- **Unchanged.** What a write stores. A predicate update still answers its affected-row count. A column field-level security refuses the writer stays absent (the security mask still deletes it), and so do a name outside the declared set, an injected column a federated (`external`) object has no storage for, and a `created_at` / `updated_at` a federated object neither declares nor has injected — the read's own exclusions.
14+
- **Who sees it.** A client of an object served by driver-mongodb or driver-memory that diffs a create or update response against its own state, or renders it: a field the save never mentioned now arrives in that response as `null`, as it does on the next read, instead of appearing only on the next read. In-process readers of the write result see the same: an `afterInsert` / `afterUpdate` hook, a `data.record.created` / `data.record.updated` event payload and the webhooks that deliver it. A reader that told a missing key from `null` (`'x' in row`, `has(record.x)`) now reads what driver-sql already answered; test emptiness with `record.x != null`. A `formula` over an unwritten field in a write response on those two drivers changes value: it used to answer `null` with a fault, and now answers what the next read answers (`record.qty != null ? record.qty * 2 : -1` was `null`, now `-1`).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
'@objectstack/objectql': patch
4+
'@objectstack/spec': patch
5+
---
6+
7+
fix(metadata-protocol)!: an object saved back from a translated `/meta` read stores its source labels, and an object the registry would refuse is refused at save and at publish, never reported published (#29673)
8+
9+
Clause-②: no (narrowing) — the object save door (`saveMetaItem`, draft and live) refuses `422 INVALID_METADATA` an object declaring its own `queue` field on a user-owned object (ADR-0142 D3), which it stored before and the registry then refused to register; the publish promote refuses such a draft the same way. A label equal to what the `/meta` read serves for its source in some locale is stored as the source text. Nothing is widened.
10+
Metadata-protocol: none
11+
Skills-docs: none — `skills/objectstack-data/SKILL.md` (Ownership queues) already teaches that an object declaring its own `queue` field is refused, which stays true and is now said at save; no file under `skills/**` teaches saving a translated read back.
12+
13+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped. The refusal at save is the registry's own, moved forward to the door that stores the body; a row stored before this rule already never registered. A stored row carrying a translated injected column is repaired by `os migrate meta --stored`, which re-saves it through the same door: no ledger entry and no tombstone. -->
14+
15+
**BREAKING** accept-set narrowing at the object save door (`@objectstack/metadata-protocol`), served by `PUT /api/v1/meta/object/:name` (draft and live) and `POST /api/v1/packages/:id/publish-drafts`.
16+
17+
- **Before.** A `/meta` read in a non-English locale serves each injected system column with a translated label (`queue` → `队列`, `owner_id` → `负责人`). Studio saves the whole body it read, so the save stored those columns back as the author's own fields. For `queue` the registry then refused the object at publish, the refusal went to a log line, and `publish-drafts` answered `outcome: 'published'` while the object's data door answered 404. For `owner_id` and the other columns, every other locale was served the Chinese label.
18+
- **Now.**
19+
- The save door puts a slot back to its source text when the incoming value differs from the source and equals what the read's translator makes of that source in some locale, translating with the read's own options (a packaged object's overlay slot that diverged from the packaged text is served untranslated, so it is no translation's source). The source is the stored row the save overwrites, then the platform's own definition of an injected column. The strip that follows then removes the platform's columns as it always did. Slots: an object's `label`, `pluralLabel` and `description`; a field's `label`, `description`, `inlineHelpText` and `inlineTitle`; an option's `label`.
20+
- The save door asks the registry whether it would register the object, judging the body alone, and refuses what it would not, in both modes. The publish promote asks again, before anything is promoted, so a draft stored before this rule is refused and not reported published. The only refusal this makes new at the door is an author's own `queue`; a field `type` the registry refuses was already refused at save by the object schema. The record-currency `summary` door is left to the registration, since it judges the body against the other objects as they stand and a sibling in the same batch can change that answer either way.
21+
- `os migrate meta --stored` reports a stored object row carrying a translated label as `translated-label-echo` and, with `--apply`, re-saves it through the save door.
22+
- **Unchanged.** A label that is not a translation of its source is the author's edit and is kept. A field the source does not declare is not compared. An English body is stored as before.
23+
- **The edge.** An author who types exactly the translation of a label's source in some locale gets the source back; a reader in that locale is served the translation anyway.
24+
- **New export.** `BUILTIN_SYSTEM_FIELD_LABEL_LOCALES` (`@objectstack/spec/system`): the locales the built-in system-field label table answers in, with no bundle. `SchemaRegistry.objectRegistrationRefusal` (`@objectstack/objectql`) answers the refusal `registerObject` would throw judging the body alone (every door but the record-currency `summary` one), without registering anything.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
perf(app-shell): a record in a packaged app reads the objects that point at it through the app's package, not the whole object registry
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Opening a record in a packaged app, when its object has no declared record page, read the whole object registry so the synthesized page could find the objects that point at the record's object for its related lists: 561 KB of a 1.58 MB record open on the CRM example. When the app's navigation reaches the record's object, the app bundle already names every object that points at it, so the route now reads the app's package list and, by name, the record's lookup targets and any pointing object from another package (answered from the bundle). The related lists are the same, in the same order. The route still reads the registry for an object outside the app's navigation, with no bundle (draft preview, or a host without one), and under a record drawer.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
feat(app-shell): the Studio item header says where a customization of a read-only base is saved
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
ADR-0146 D3 saves every edit of a read-only base into its `.custom` pair. The Studio item header now says so, in the pending-changes sheet's own words: "Saved to BASE's customizations" (zh: 保存到 BASE 的定制). It shows on one line under the title row, above the tabs. It appears on Interfaces for an item the pair adds, overrides or has been unlocked by Customize; on Data for an object the pair adds or a base object the pair's extension already extends; and on Automations for a flow the pair adds, overrides or has been unlocked. Access is unchanged, since its chip already names the base.
11+
12+
`StudioItemHeader` takes an optional `note` prop, drawn outside the title row so the objectstack#29693 fold never measures it. The sentence moves to its own module, `preview/savedToCustomization.tsx`, beside a new `SavedToCustomizationNote` element, so the header does not depend on the pending-changes sheet's module; `DraftChangesPanel` still exports `savedToCustomizationText`. No i18n key is added, and nothing is removed or narrowed.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
feat(app-shell): Studio's override mark opens a popover that names the customization and offers Restore package original
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
In Studio, the mark on an item customized into the base's pair ("Overrides HotCRM") used to tell you nothing more, and you had to find "Restore package original" in the item's ⋯ menu. The mark is now a button. Pressing it opens a small popover that says which package the item overrides and which version of it the customization was taken from, with a "Restore package original" button. That button asks through the same confirmation dialog as before, and confirming sends the same two deletes at the pair: its draft, then its row. Customize keeps the header's primary slot, and Restore is never a header button of its own. The ⋯ menus of the Interfaces item, the flow and the All-metadata form editor no longer list Restore, so the mark is the one place to find it. On a narrow header, where the mark folds into the ⋯ menu, it opens the same popover there. Choosing the folded entry with the keyboard opens it too. The popover stays open while the pointer moves over it, and Restore there closes the ⋯ menu before the confirmation opens.

0 commit comments

Comments
 (0)