Measured while implementing #5903. Filed rather than fixed there: #5903's fence
is the declaration surface, and its PR is deliberately behaviour-preserving at
this line.
The fact
packages/plugin-gantt/src/ObjectGantt.tsx, the exportFileName fallback chain
handed to GanttView:
String(
ganttConfig?.exportFileName ?? schema.label ?? objectSchema?.label ?? schema.objectName ?? ''
) || undefined
schema.label is BaseSchema['label'], which since #4580's revised Q1-A ruling
is string | I18nLabel — and I18nLabel is string | Record<string, string>,
the spec's INLINE locale map. So a gantt authored as
{ "type": "object-gantt", "objectName": "task", "label": { "en": "Shift Plan", "zh-CN": "排班计划" } }
exports its CSV/PNG named [object Object].
Why it was invisible until now
The read was (schema as any).label, so the union never reached the String().
#5903 drops that cast (the key needs no declaration — BaseSchema already
carries it), which makes the union visible at the call site for the first time.
The behaviour is unchanged by that card; only the visibility is new.
The shape of the fix
resolveI18nLabel(label, locale) from @objectstack/spec/ui is the resolver
that owns this vocabulary, and the file already has a display locale in scope
(useDisplayLocale). Note objectSchema?.label, the very next link in the same
chain, plausibly needs the same treatment — worth measuring together rather than
patching one link.
⚠️ Whichever way it goes, the ?? chain must not grow a lenient coercion: per
AGENTS.md #0.1 the fix is to resolve the declared vocabulary, not to accept a
second one.
Generated by Claude Code
Measured while implementing #5903. Filed rather than fixed there: #5903's fence
is the declaration surface, and its PR is deliberately behaviour-preserving at
this line.
The fact
packages/plugin-gantt/src/ObjectGantt.tsx, theexportFileNamefallback chainhanded to
GanttView:schema.labelisBaseSchema['label'], which since #4580's revised Q1-A rulingis
string | I18nLabel— andI18nLabelisstring | Record<string, string>,the spec's INLINE locale map. So a gantt authored as
{ "type": "object-gantt", "objectName": "task", "label": { "en": "Shift Plan", "zh-CN": "排班计划" } }exports its CSV/PNG named
[object Object].Why it was invisible until now
The read was
(schema as any).label, so the union never reached theString().#5903 drops that cast (the key needs no declaration —
BaseSchemaalreadycarries it), which makes the union visible at the call site for the first time.
The behaviour is unchanged by that card; only the visibility is new.
The shape of the fix
resolveI18nLabel(label, locale)from@objectstack/spec/uiis the resolverthat owns this vocabulary, and the file already has a display locale in scope
(
useDisplayLocale). NoteobjectSchema?.label, the very next link in the samechain, plausibly needs the same treatment — worth measuring together rather than
patching one link.
??chain must not grow a lenient coercion: perAGENTS.md #0.1 the fix is to resolve the declared vocabulary, not to accept a
second one.
Generated by Claude Code