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
{{ message }}
Repository navigation
Commit 320ec35
Browse filesBrowse the repository at this point in the historyBrowse files
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DHcWWbiJqPPiDYgiSMxhTQo)_Fixes#13459
Clause-②: no
Metadata-protocol: narrowed
- [x] Adds no product-specific widget, dialog, hook or string (see
AGENTS.md › Product-neutral renderer)
## What changes
**1. `ObjectGantt` refuses a `gantt` block that fails
`GanttConfigSchema`** (`packages/plugin-gantt/src/ObjectGantt.tsx`).
Before: `safeParse` failure → `console.warn` → the unvalidated block was
returned and drawn, so a misspelt or missing key still rendered a
plausible chart. Now `getGanttConfig` returns `{ config: null,
invalidBlock }` on that branch and the component renders a refusal
(`role="alert"`, `data-testid="gantt-invalid-config"`) naming every
parse issue by its path in the block, e.g. `gantt.endDateField: …`,
`gantt: Unrecognized key: "startField"`. The console warning and the
shadowed-flat-keys warning still fire. Unchanged: a valid block, the
flat ObjectView / ListView spelling (still not parsed, as before), and
the "Gantt configuration required" screen for a view with no binding.
**2. The five designer spec derivations fail loudly**
(`packages/app-shell/src/views/metadata-admin/{dashboard,package,page,report,view}-schema.ts`).
The ten `try { … } catch { console.warn(…) }` sites (seven
`z.toJSONSchema` derivations, three form clones) and their `_…Failed`
memo flags are removed. Their only input is the bundled
`@objectstack/spec`, so a failed derivation is a build-time fact: it
fails the tests beside these files, and at runtime it propagates to the
route's `ErrorBoundary` (`console/AppContent.tsx`), which shows the
error and reports it, instead of rendering a form silently missing
fields. The getters' return types narrow from `JsonSchema | undefined`
to `JsonSchema`. No runtime input reached those catches: the dashboard
form's only runtime argument, `locale`, goes through
`localizeMetadataForm`, which does not throw on an unknown locale.
`tzShift.ts` (`timeZone` fallback) is out of scope per the claim (it
waits on a spec-row decision).
## Tests
On head `e26d1cd`:
- New
`packages/plugin-gantt/src/ObjectGantt.invalidBlockRefusal-13459.test.tsx`
(4): an undeclared key and a missing required field are each refused
with the path named and no chart; the console diagnostic stays; CONTROL:
a valid block renders its tasks.
- New
`packages/app-shell/src/views/metadata-admin/spec-derivation-13459.test.ts`
(14): each of the seven getters derives an object schema from the
bundled spec, and each THROWS (and does not warn) when `z.toJSONSchema`
throws. The failing `toJSONSchema` is a scoped `vi.doMock` + `doUnmock`:
a first version used a hoisted `vi.mock`, which leaked into
`view-schema.test.ts` in the same worker (3 failures, fixed in
`a3b60c1`).
- Ablation (each leg committed first, restored with `git checkout HEAD
--`, `git diff HEAD` empty after): `ObjectGantt.tsx` reverted to
`origin/main` → the three refusal cases fail, CONTROL passes;
`view-schema.ts` reverted → the three `view-schema.*` throw cases fail,
the rest pass.
- `pnpm exec vitest run packages/plugin-gantt/` → Test Files 100 passed
| 1 skipped (101), Tests 775 passed | 114 skipped.
- App-shell, narrowed: the 88 test files that import a changed module or
a component calling one (`git grep -lE` over the five module names and
their callers `PackageFormDialog`, `*DefaultInspector`,
`ViewColumnInspector`, `ViewVariantInspector`, `ReportConfigPanel`) →
Test Files 88 passed (88), Tests 721 passed. Blind spot: a test reaching
these modules through another import path is not in that set; CI's
sharded `pnpm test` runs the whole package.
- `type-check`: `@object-ui/plugin-gantt` exit 0, `@object-ui/app-shell`
exit 0 (turbo, both `tsc --noEmit` and `tsconfig.test.json`).
- Gates, local: `eslint --no-inline-config` on the touched files 0
errors; `check:new-line-citations`, `check:changeset-claims`,
`check-changeset-no-major`, `check-changeset-presence`,
`check:i18n-keys`, `check:vi-mock-specifiers`, `check:vi-mock-inherit`,
`check:vi-mock-override-shape`, `check:control-bytes`,
`check:test-path-roots` all exit 0. `check:readme-exports` NOT MEASURED
(needs every package's dist; CI builds first).
## Acceptance notes
- The refusal copy is English, like the neighbouring "Gantt
configuration required" refusal: both address the view's author.
Localizing both would touch the ten locale packs, outside the claimed
file surface.
- `ObjectTimeline` still only warns on a failed
`TimelineExtensionSchema.safeParse` (its refusal covers a missing date
axis only). Same shape as this card's gantt half; not changed here
(outside the claimed surface).
- The `if (!specXForm || typeof specXForm !== 'object') return
undefined` guards in the form getters remain: they are not
catch-and-warn sites and the existing tests assert the forms are
defined.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01AdaeVx4N1y9QsiBkJ31nfJ)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01AdaeVx4N1y9QsiBkJ31nfJ
---------
Co-authored-by: Claude <noreply@anthropic.com>
An invalid `gantt` block is refused instead of drawn (objectui#13459). `ObjectGantt` used to log `Invalid gantt configuration` and render the block anyway, so a block with a misspelt or missing key still drew a chart. It now renders a refusal that names each `GanttConfigSchema` issue by its path in the block (`gantt.endDateField: …`); a valid block and the flat ObjectView / ListView spelling render as before.
10
+
11
+
The Studio designers' spec derivations (`dashboard`, `package`, `page`, `report` and `view` schemas in `metadata-admin`) no longer catch a failed derivation and return `undefined`, which rendered a designer form silently missing fields. Their only input is the bundled spec, so a failure is a build-time fact that fails their tests; at runtime it reaches the route's error boundary.
0 commit comments