Skip to content

Commit 83f32ea

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-28579-checklist-studio-door
2 parents 1fb71f6 + a20dcae commit 83f32ea

18 files changed

Lines changed: 1158 additions & 111 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@object-ui/types': patch
4+
---
5+
6+
docs(spec): the record-page `timeline` total's published description reads it as an upper bound of the drawn 动态 entries
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`RecordPageTimelineCountSchema.total`'s `.describe()`, which ships in the published JSON schema and the API reference, and the schema's docblock now say what the `RecordPageTimelineRequestSchema` docblock says: the total counts the rows of the sources the request named, as that schema's table defines them and as the caller may read them. That makes it an upper bound of the entries the 动态 panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff. Description text only: no key, type, bound, default or export changes, and no behaviour changes.
12+
13+
The `RecordPageResponse.timeline` docblock in `@object-ui/types`, the UI's mirror of the response, says the same: the total counts the sources' rows, so it is an upper bound of the drawn entries, and the panel draws fewer in the same two cases. Comment only: no type, member or export changes.
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+
fix(app-shell): the Studio app navigation, object, object extension and flow editors and the metadata item editor no longer edit the published version over a draft the author is not allowed to read
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Before.** A pending draft can carry an audience gate (`requiredPermissions`) its author does not hold, for example one written over the API or MCP, and the draft read answers `403 PERMISSION_DENIED` for it by design. `readDraftForSave` hands that refusal back as `refused`, but the Interfaces pillar's app navigation, the Data pillar's object and its extension at a base's paired package, the Automations pillar's flow and the metadata item editor still read it as "no pending draft": they opened the published body in its place, and their next save sent that body as the draft, dropping the gate and every other unpublished change. The metadata item editor did the same after a publish that left such a draft behind.
11+
- **Now.** Each of them installs no buffer for such an item: nothing is shown to edit and no save is sent. The refusal strip says the item has an unpublished draft this author may not read and that editing the published version would overwrite it; the server's own sentence is behind Details. The metadata item editor withholds every write it offers for that item and shows the same strip in place of the editor. The strip is now its own module, `StudioRefusalStrip`, so the metadata item editor draws the one Studio uses.
12+
- **Unchanged.** An item with no pending draft opens the published body and its first save is still pinned to "no draft row"; a readable draft opens as served. Any other failed draft read is handled as before.

‎.changeset/29153-field-help-on-inline-help-text.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ Metadata-protocol: none
1010
Nothing changes in what a metadata author can write. What changes is the served, translated read of an object: `translateObject` (the resolver behind `GET /api/v1/meta/object/:name` and every other localized object read) now serves a field's `objects.OBJECT.fields.FIELD.help` translation on the field's own `inlineHelpText` when the field authors one.
1111

1212
- **Before.** The translation was served on `description` only. The i18n extractor scaffolds that entry from `help ?? inlineHelpText ?? description`, and the console draws a field's help line from `inlineHelpText || description`, so a field that authored `inlineHelpText` showed its source-language text in every locale and its translation never appeared.
13-
- **Now.** A field that authors a non-empty `inlineHelpText` is served the translation there, and on `description` as before. A field without one (absent, or an empty string, which the console reads as absent) gains no `inlineHelpText` key; its translation stays on `description`, which the console already draws.
13+
- **Now.** A field that authors a non-empty `inlineHelpText` is served the translation there, the text the entry was scaffolded from, and keeps its source-language `description`. A field without one (absent, or an empty string, which the console reads as absent) gains no `inlineHelpText` key; its translation stays on `description`, which the console already draws.
1414
- **Unchanged.** A locale with no `help` entry for the field, and the source locale, serve the authored text. Each slot keeps a value that diverged from the packaged declaration (a tenant's own edit), judged per slot by the same rule that already guards `description`. Nothing is ever served on a `help` key.
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+
fix(app-shell): Studio's flow ledger switch keeps keyboard focus while its toggle is in flight and after the answer lands
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
On Studio › Automations, a read-only package's flow offers the switch that turns it on or off for this deployment. While a toggle was in flight the switch drew `disabled`, and a browser moves focus off a focused control that turns disabled, to the page body, where it stayed once the answer landed. A keyboard or screen reader author had to tab back from the top of the page after every flip, accepted or refused. In flight the switch is now `aria-disabled` and refuses the press in its own handler, so it keeps focus and a second Space still sends no second request. A switch the deployment's posture walls off stays `disabled` and described by its reason, as before.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
fix(spec): a field that authors both `inlineHelpText` and a different `description` keeps its source-language `description`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Nothing changes in what a metadata author can write. What changes is the served, translated read of an object: `translateObject` serves a field's `objects.OBJECT.fields.FIELD.help` translation on ONE slot, the one the i18n extractor scaffolded the entry from.
11+
12+
- **Before.** The translation was served on `description`. The extractor scaffolds the entry from `help ?? inlineHelpText ?? description`, so on a field that authors both a non-empty `inlineHelpText` and a different `description`, the entry translates the `inlineHelpText`, and every reader of `description` (Studio, the designer) showed that other sentence's translation.
13+
- **Now.** A field that authors a non-empty `inlineHelpText` is served the translation there and keeps its source-language `description` (and gains none when it has none). `description` takes the translation only when neither the served field nor its packaged declaration authors a non-empty `inlineHelpText`. An empty `inlineHelpText` reads as absent, as it does in the extractor and the console.
14+
- **Unchanged.** A field that authors only `description` is served its translation there. Each slot keeps a value that diverged from the packaged declaration (a tenant's own edit). Nothing is ever served on a `help` key.

‎content/docs/references/api/record-page.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ This schema accepts one of the following structures:
548548

549549
| Property | Type | Required | Description |
550550
| :--- | :--- | :--- | :--- |
551-
| **total** | `integer` | ✅ | How many entries the record's timeline stream holds for this caller, over the sources the request named. |
551+
| **total** | `integer` | ✅ | The rows of the sources the request named, counted as this caller may read them: an upper bound of the entries the timeline panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff. |
552552

553553
### Nested Shape: `RecordPageResponse.timeline[option 2]`
554554

@@ -596,7 +596,7 @@ This schema accepts one of the following structures:
596596

597597
| Property | Type | Required | Description |
598598
| :--- | :--- | :--- | :--- |
599-
| **total** | `integer` | ✅ | How many entries the record's timeline stream holds for this caller, over the sources the request named. |
599+
| **total** | `integer` | ✅ | The rows of the sources the request named, counted as this caller may read them: an upper bound of the entries the timeline panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff. |
600600

601601

602602
---

‎packages/spec/src/api/record-page.zod.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,18 @@ export const RecordPageStreamRowsSchema = lazySchema(() => z.object({
313313
export type RecordPageStreamRows = z.input<typeof RecordPageStreamRowsSchema>;
314314
export type RecordPageStreamRowsParsed = z.infer<typeof RecordPageStreamRowsSchema>;
315315

316-
/** [#28737] The `timeline` part: how many entries the record's 动态 stream holds. */
316+
/**
317+
* [#28737] The `timeline` part: the size of the record's 动态 stream, counted
318+
* by the reads `RecordPageTimelineRequestSchema` names, as the caller. The
319+
* total counts the sources' rows as that schema's table defines them, so it is
320+
* an upper bound of the entries the 动态 panel draws, not their number. The
321+
* panel draws fewer where its `showCompleted` / `types` configuration filters
322+
* entries out, and where a ledger row has no displayable diff and so draws no
323+
* entry.
324+
*/
317325
export const RecordPageTimelineCountSchema = lazySchema(() => z.object({
318326
total: z.number().int().min(0).describe(
319-
'How many entries the record\'s timeline stream holds for this caller, over the sources the request named.',
327+
'The rows of the sources the request named, counted as this caller may read them: an upper bound of the entries the timeline panel draws, not their number. The panel draws fewer where its `showCompleted` / `types` configuration filters entries out, and where a ledger row has no displayable diff.',
320328
),
321329
}).strict());
322330
export type RecordPageTimelineCount = z.input<typeof RecordPageTimelineCountSchema>;

‎packages/spec/src/system/i18n-resolver.test.ts‎

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3944,6 +3944,10 @@ import { FieldSchema } from '../data/field.zod';
39443944
* field authoring `inlineHelpText` showed its source text over a translation
39453945
* served on `description` alone. The entry is served on that authored
39463946
* `inlineHelpText` too, under the same per-slot divergence rule.
3947+
*
3948+
* #29286 — and on that `inlineHelpText` ONLY: the entry translates the text it
3949+
* was seeded from, so a field authoring both texts keeps its source-language
3950+
* `description` rather than show another sentence's translation there.
39473951
*/
39483952
describe('translateObject — a field\'s translated help is served on `description`', () => {
39493953
const TWO_FACTOR_EN =
@@ -4025,10 +4029,10 @@ describe('translateObject — a field\'s translated help is served on `descripti
40254029
expect('help' in field).toBe(false);
40264030
});
40274031

4028-
it('a field declaring both `description` and `inlineHelpText` gets the translation on both, the slot the console draws first included', () => {
4032+
it('a field declaring both `description` and `inlineHelpText` gets the translation on `inlineHelpText` only, the slot the entry was seeded from', () => {
40294033
const field = fieldsOf(translateObject(clone(PACKAGED), BUNDLE, { locale: 'zh-CN', packagedBase: PACKAGED })).phone;
40304034
expect(field.inlineHelpText).toBe('请填写国家区号。');
4031-
expect(field.description).toBe('请填写国家区号。');
4035+
expect(field.description).toBe('Contact number.');
40324036
expect('help' in field).toBe(false);
40334037
expect(unrecognizedKeys(field)).toEqual([]);
40344038
});
@@ -4045,7 +4049,7 @@ describe('translateObject — a field\'s translated help is served on `descripti
40454049
}
40464050
// Judged per field: the undiverged sibling is still translated…
40474051
const zh = fieldsOf(translateMetadataDocument('object', clone(served), BUNDLE, { locale: 'zh-CN', packagedBase: PACKAGED }));
4048-
expect(zh.phone.description).toBe('请填写国家区号。');
4052+
expect(zh.phone.inlineHelpText).toBe('请填写国家区号。');
40494053
// …and the field `label` stays a flat `catalog ?? document`, as before.
40504054
expect(zh.two_factor_enabled.label).toBe('已启用双因素认证');
40514055
});
@@ -4088,7 +4092,7 @@ describe('translateObject — a field\'s translated help is served on `descripti
40884092
const out = translateObject(asArray(served) as any, BUNDLE, { locale: 'zh-CN', packagedBase: asArray(PACKAGED) });
40894093
const byName = Object.fromEntries((out.fields as any[]).map((f) => [f.name, f]));
40904094
expect(byName.two_factor_enabled.description).toBe('Edited by the tenant.');
4091-
expect(byName.phone.description).toBe('请填写国家区号。');
4095+
expect(byName.phone.inlineHelpText).toBe('请填写国家区号。');
40924096
expect((out.fields as any[]).some((f) => 'help' in f)).toBe(false);
40934097
});
40944098

@@ -4126,6 +4130,15 @@ describe('translateObject — a field\'s translated help reaches the slot the co
41264130
email: { name: 'email', type: 'email', label: 'Email', description: 'Primary address.' },
41274131
nickname: { name: 'nickname', type: 'text', label: 'Nickname', inlineHelpText: 'What friends call them.' },
41284132
blank_inline: { name: 'blank_inline', type: 'text', label: 'Blank', inlineHelpText: '', description: 'Shown instead.' },
4133+
// Authors BOTH texts, and they differ: the extractor seeds `help` from the
4134+
// `inlineHelpText`, so the entry is no translation of the `description`.
4135+
vat_number: {
4136+
name: 'vat_number',
4137+
type: 'text',
4138+
label: 'VAT number',
4139+
inlineHelpText: 'Leave blank for private customers.',
4140+
description: 'Tax id used on invoices.',
4141+
},
41294142
},
41304143
};
41314144
const LEAD_SCORE_ZH = '由评分规则计算,不可手动编辑。';
@@ -4134,7 +4147,10 @@ describe('translateObject — a field\'s translated help reaches the slot the co
41344147
objects: {
41354148
showcase_contact: {
41364149
fields: {
4137-
lead_score: { label: 'Lead score', help: 'Computed by scoring rules — not user-editable.' },
4150+
// No `help` for `lead_score` here: the source-locale CONTROL below
4151+
// would pass on an entry that repeats the authored text whether or
4152+
// not the translator served it.
4153+
lead_score: { label: 'Lead score' },
41384154
email: { label: 'Email', help: 'Primary address.' },
41394155
blank_inline: { label: 'Blank', help: 'Shown instead.' },
41404156
},
@@ -4150,6 +4166,7 @@ describe('translateObject — a field\'s translated help reaches the slot the co
41504166
// `nickname` has a label entry and NO help entry.
41514167
nickname: { label: '昵称' },
41524168
blank_inline: { label: '空白', help: '改为显示此项。' },
4169+
vat_number: { label: '增值税号', help: '个人客户请留空。' },
41534170
},
41544171
},
41554172
},
@@ -4164,17 +4181,19 @@ describe('translateObject — a field\'s translated help reaches the slot the co
41644181
it('serves the showcase `lead_score` translation on its authored `inlineHelpText`, which the console draws', () => {
41654182
const field = serve(SHOWCASE, 'zh-CN').lead_score;
41664183
expect(field.inlineHelpText).toBe(LEAD_SCORE_ZH);
4167-
expect(field.description).toBe(LEAD_SCORE_ZH);
4184+
expect('description' in field).toBe(false);
41684185
expect(consoleHelpLine(field)).toBe(LEAD_SCORE_ZH);
41694186
expect('help' in field).toBe(false);
41704187
const parsed = FieldSchema.safeParse(field);
41714188
expect(parsed.success ? [] : parsed.error.issues.filter((i) => i.code === 'unrecognized_keys')).toEqual([]);
41724189
});
41734190

4174-
it('CONTROL: the source locale serves the authored `inlineHelpText` untouched', () => {
4191+
it('CONTROL: the source locale, which carries no `help` entry for the field, serves the authored `inlineHelpText` untouched, never another locale\'s', () => {
41754192
const field = serve(SHOWCASE, 'en').lead_score;
4193+
expect(field.label).toBe('Lead score');
41764194
expect(field.inlineHelpText).toBe(SHOWCASE.fields.lead_score.inlineHelpText);
41774195
expect(consoleHelpLine(field)).toBe(SHOWCASE.fields.lead_score.inlineHelpText);
4196+
expect('description' in field).toBe(false);
41784197
});
41794198

41804199
it('CONTROL: a locale with no `help` entry for the field serves its authored `inlineHelpText` untouched', () => {
@@ -4205,6 +4224,32 @@ describe('translateObject — a field\'s translated help reaches the slot the co
42054224
expect(consoleHelpLine(field)).toBe('改为显示此项。');
42064225
});
42074226

4227+
it('a field authoring both texts gets the translation on `inlineHelpText` and keeps its source-language `description`', () => {
4228+
// The entry translates the `inlineHelpText` it was seeded from; on
4229+
// `description` it would show another sentence's translation.
4230+
const field = serve(SHOWCASE, 'zh-CN').vat_number;
4231+
expect(field.inlineHelpText).toBe('个人客户请留空。');
4232+
expect(field.description).toBe('Tax id used on invoices.');
4233+
expect(consoleHelpLine(field)).toBe('个人客户请留空。');
4234+
expect('help' in field).toBe(false);
4235+
});
4236+
4237+
it('a served `inlineHelpText` blanked over a packaged one still keeps `description` in its source language', () => {
4238+
// The entry was seeded from the PACKAGED `inlineHelpText`, so it is still
4239+
// no translation of the `description`, whatever the served field says.
4240+
const served = clone(SHOWCASE);
4241+
served.fields.vat_number.inlineHelpText = '';
4242+
const field = serve(served, 'zh-CN').vat_number;
4243+
expect(field.inlineHelpText).toBe('');
4244+
expect(field.description).toBe('Tax id used on invoices.');
4245+
});
4246+
4247+
it('with no packaged base, a field authoring both texts still keeps its source-language `description`', () => {
4248+
const field = fieldsOf(translateObject(clone(SHOWCASE), BUNDLE, { locale: 'zh-CN' })).vat_number;
4249+
expect(field.inlineHelpText).toBe('个人客户请留空。');
4250+
expect(field.description).toBe('Tax id used on invoices.');
4251+
});
4252+
42084253
it('keeps an `inlineHelpText` that diverged from the packaged field, in every locale', () => {
42094254
const served = clone(SHOWCASE);
42104255
served.fields.lead_score.inlineHelpText = 'Edited by the tenant.';

0 commit comments

Comments
 (0)