Uh oh!
There was an error while loading. Please reload this page.
refactor(types): derive more view-configs from spec + ratchet against new hand-mirrors - #2120
Merged
Merged
Conversation
… new hand-mirrors
Continues the single-source cleanup (after userActions). objectql.ts states
"Never Redefine Types. ALWAYS import them." yet several view-config fields were
hand-written inline mirrors of spec types — and inconsistently (one interface
used `selection?: SelectionConfig`, two others hand-wrote `{ type: ... }`).
Convert the provably-safe ones to the @objectstack/spec/ui type:
- `selection` → SelectionConfig (shape-identical; sibling already used it)
- `pagination` → PaginationConfig (shape-identical; sibling already used it)
- `appearance` → Partial<AppearanceConfig> (note: allowedVisualizations is the
spec's visualization enum, not a free string[]) — full workspace type-check
clean, no consumer breaks.
Add a local ESLint ratchet `object-ui/no-inline-spec-config` (scoped to
objectql.ts, error-level — same pattern as no-synthetic-event-trigger): a
spec-backed view-config field must reference its spec type, never a bare inline
object literal. A spec ref / `Partial<X>` / `Partial<X> & { ext }` (the
transitional pattern) is fine; a bare `{ … }` is flagged. Covers the converted
fields + grouping/gallery/timeline; lints clean today. +10 rule tests.
Pending (still inline — convert + add to the rule next; they likely carry
objectui extensions so each needs its own shape check): kanban, calendar,
gantt, addRecord, userFilters. Documented in the rule so it's not a silent skip.
No behavior change; no changeset (shape-identical types + repo tooling).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
What
Continues the spec single-source cleanup (after #2119's
userActions). Two parts:1. Convert hand-written inline mirrors → spec types in
objectql.ts:selection{ type: 'none'|'single'|'multiple' }SelectionConfigpagination{ pageSize: number; pageSizeOptions?: number[] }PaginationConfigappearance{ showDescription?; allowedVisualizations?: string[] }Partial<AppearanceConfig>selection/paginationwere provably safe — a sibling interface in the same file already used the spec type and compiled; this just fixes the inconsistency.appearancenarrowsallowedVisualizationsto the spec's visualization enum (more correct) — full workspace type-check is clean, no consumer breaks.2. A lint ratchet so hand-mirrors can't creep back: local rule
object-ui/no-inline-spec-config(scoped toobjectql.ts, error-level — same pattern as the existingno-synthetic-event-trigger). A spec-backed view-config field must reference its spec type; a bare inline{ … }is flagged. A type ref /Partial<X>/Partial<X> & { ext }(the transitional pattern) is fine.Why
objectql.tsliterally states "Never Redefine Types. ALWAYS import them." — a hand mirror silently drifts from the spec, which is the bug class behind "shipped-but-inert" metadata. Verified the ratchet is live: a deliberate inlineappearanceerrors atobject-ui/no-inline-spec-config; the converted form lints clean.Pending (documented in the rule, not a silent skip)
Still inline — convert + add to the rule next; each likely carries objectui extensions so needs its own shape check:
kanban,calendar,gantt,addRecord,userFilters.Verification
@object-ui/types/app-shell/plugin-list/reacttscclean (thecomponentserrors onmainare the pre-existing react-runtime/sucrase breakage, unrelated).eslint objectql.ts: 0 errors.🤖 Generated with Claude Code