You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(types)!: authoring types are input types — ActionParam takes the spec's declaration forms, ListViewSchema stops promising phantom defaults (objectstack#4074) (#3020)
Three public types said something different from what the platform accepts,
found by making packages/types' tests compile (#3009) and resolving the
declared p1-spec-alignment.test.ts debt site-by-site.
ActionParam is now the AUTHORING shape, aligned with the spec's input:
name/label/type optional, field/objectOverride added. The spec's primary
declaration form — a bare field reference inheriting label/type/validation/
options from an object field — was unrepresentable while all three were
required. The RESOLVED shape the dialog consumes (after app-shell's
resolveActionParams() inlines the reference) remains core's ActionParamDef,
all three required: authoring and resolved are different types on purpose.
label is the spec's I18nLabel by import — which the new compile-time guard
promptly revealed to be aliased to plain string in the current spec, so no
behavioural widening today; importing the alias means objectui tracks any
future widening automatically.
ListViewInferred is z.input, not z.infer. The spec sub-schemas flowing into
the list-view surface (userActions, tabs→ViewTab, sharing) carry .default()s,
so the inferred output type made userActions.refresh or a tab's pinned/visible
REQUIRED — but nothing on the render path runs .parse(): normalizeListViewSchema
deliberately applies no defaults ("an absent flag stays absent", its own suite).
The output type rejected valid authored metadata while promising renderers
defaults that never arrive; input matches both author and runtime.
FormField.dependsOn is DependsOnInput. The runtime reader
(resolveCascadingOptions) has always accepted a bare name, a list of names, or
{field, param} entries; the public property said string, so array-authored
metadata type-errored while working and the form renderer read the key through
(f as any).dependsOn to get past its own type. The shape now lives in
@object-ui/types next to FormField; core imports and re-exports it; the two
as-any reads in components are typed.
The p1-spec-alignment.test.ts exclusion is gone — its 14 errors resolved:
the "sharing in ObjectUI format" and legacy-ARIA fixtures are re-seated as
normalizer-input dialects (folded by normalizeListViewSchema; asserted
branch-by-branch in core's normalize-list-view.test.ts, the seam where the
fold runs), and the one fixture no surface ever admitted (an ObjectQL triplet
as a spec ViewTab.filter) is corrected to the rule-object form. Every test
file in @object-ui/types is compiled, no exclusions.
Discrimination-checked: reverting ListViewInferred to z.infer, dependsOn to
string, or ActionParam.name to required each fails compile in the now-compiled
tests (TS2739 / TS2322 / TS2741); restored, all projects clean.
Claude-Session: https://claude.ai/code/session_014DBMo8gnFduzgpuSHd5Eje
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments