Repository navigation
Delete dead SchemaPropertyForm, fix stale generic-form comments (closes #2102) - #2135
Conversation
…2102) core#2013 already fixed the two user-visible bugs core#2102 was filed for: project now renders a schema-driven properties form via GenericSchemaForm's no-hardcoded-form fallback (previously gated on a hand-maintained core-type allowlist that incorrectly excluded it), and person's form-availability classification is now plugin-registry- derived instead of allowlist-derived. This commit lands the remaining, verified-safe cleanup: - Delete schema-property-form.svelte: fully superseded once GenericSchemaForm gained namespace-aware read/write via schema-field-resolution.ts (core#2013) — it had zero production imports, referenced only by its own dedicated test. - Port that test file's namespaced-write and un-migrated-flat- properties coverage onto GenericSchemaForm, which now owns that behavior, instead of just deleting it. - Add end-to-end regression coverage for GenericSchemaForm rendering the real `project` schema (status/priority/start_date/end_date, mirroring core_schemas.rs exactly) — closing the gap between the existing loader/predicate-level tests and the actual rendered form. - Fix stale comments left pointing at the deleted SchemaPropertyForm and a DateSchemaForm that has never existed, across base-node-viewer.svelte, plugins/types.ts, plugin-registry.ts, and task-node-viewer.svelte. The larger architectural refactor the original issue sketched (TypedFormShell extraction, task-schema-form.svelte's hardcoded enum/ date-picker duplication) and the open question about project's user-creatability are filed as separate follow-ups (#2132, #2133) — both large and separable from the bug-fix-and-cleanup scope here. Co-Authored-By: Claude <[email protected]>
…num label-for Adversarial review of PR #2135 found no blockers but three real gaps: - generic-schema-form-project.test.ts's hand-mirrored project schema didn't match core_schemas.rs's real protection/extensible values for status/ priority. Nothing reads those today, but the PR's own follow-up (#2132) is about adding protection-based field filtering, and a fixture claiming to mirror the real schema "exactly" needs to actually do so or the first attempt at that filtering gets a false-green test. - The SchemaPropertyForm deletion dropped its two boolean-field tests (checkbox rendering + persisted write) without a GenericSchemaForm equivalent, leaving that leaf type with zero coverage. Restored. - A test comment claimed an un-migrated flat write "lands flat, not namespaced" without scoping that to the payload this component sends — the backend's own normalize-to-namespace step is a separate concern. Reworded to say so explicitly. Also fixed a real, small, in-scope bug the review surfaced: SchemaFieldLeaf's enum control never set `id={fieldId}` on its Select.Trigger, so `<label for>` pointed at nothing for every enum field — now directly relevant since project's status/priority (both enum) render through this control as of this PR. One-line fix, matching the pattern the date case already uses on its Popover.Trigger. Co-Authored-By: Claude <[email protected]>
Adversarial review (self-requested, independent sub-agent)Spawned a fresh review agent against this PR's diff, given no prior context, with explicit instructions to be skeptical of this PR's own narrative and verify every claim against actual code (not the PR description). Full report below; verdict: no blockers, one should-fix, several non-blocking notes — all addressed in the follow-up commit Verified correct:
Addressed (commit
Deferred (correctly, not silently dropped): stale docs in the separate Full frontend suite re-run cold after fixes: 219 files / 4733 tests, all green. Self-approving and merging. |
Closes #2102
What this issue turned out to need
core#2102 was filed before core#2013 (
isCustomSchemaType→ plugin-registry-based node-type predicates, merged 2026-08-17) and core#2116/PR#2125 (person duplicate-convergence UI, merged 2026-08-18). Re-investigating against currentmainfound the two user-visible bugs the issue was originally filed for already fixed:projectrenders no property form — fixed by core#2013.GenericSchemaForm's no-hardcoded-form fallback is now unconditional (schema-form-loader.svelte.ts), instead of gated on the old hand-maintainedCORE_NODE_TYPESallowlist that incorrectly excludedprojectfrom ever reaching the generic form despite having no hardcoded one. Opening a project node today renders a real, schema-driven form (status/priority/start_date/end_date), reads/writes the namespacedproperties.project.*shape correctly (schema-field-resolution.ts), and gates its Relationships button on non-empty groups exactly as the issue asked.personclassified as a custom type — moot.CORE_NODE_TYPESwas deleted entirely by core#2013; classification is now plugin-registry-derived (hasInlineNodeComponent/needsGenericSchemaForm), which is correct forpersonwithout any list to maintain.This PR verifies that and lands the remaining, safe cleanup:
schema-property-form.svelte— a third, fully redundant schema-form implementation. It had zero production imports (referenced only by its own dedicated test) and was made entirely redundant onceGenericSchemaFormgained namespace-aware read/write viaschema-field-resolution.ts(core#2013) — the two behaviors that used to distinguish it (writing the namespaced shape, migrating an un-migrated flat value) are thingsGenericSchemaFormnow does too.GenericSchemaForm(property-form-field-dispatch.test.ts) rather than just deleting it — namespaced nested-field writes, and un-migrated-flat-property reads/writes, are now proven against the component that actually owns that behavior.generic-schema-form-project.test.ts— end-to-end coverage ofGenericSchemaFormrendering the realprojectschema (mirrorscore_schemas.rsexactly: status/priority/start_date/end_date), closing the gap between core#2013's loader/predicate-level tests and the actual rendered form: field labels, the backend-applied default status, filled/total counting, and a real write round-tripping through the namespaced shape without dropping a sibling field.base-node-viewer.svelte,plugins/types.ts,plugin-registry.ts, andtask-node-viewer.sveltethat referenced the now-deletedSchemaPropertyForm(one of them introduced by core#2013 itself, still saying "generic SchemaPropertyForm" when the actual wired-in fallback isGenericSchemaForm) and aDateSchemaFormthat has never existed.Deliberately not done here (filed as follow-ups)
TypedFormShell, removetask-schema-form.svelte's (~695 lines) hardcodedSTATUS_OPTIONS/PRIORITY_OPTIONSenum constants and duplicated date-picker markup in favor ofSchemaFieldLeaf, and decide whetherperson-schema-form.svelteis worth converting to schema-driven field iteration. This is real, valuable work, but it's large, separable, and touches the most actively-used property form in the app (task editing) — bundling it here risked shipping something half-scrutinized. That issue also captures a latent gap found during this investigation:GenericSchemaFormdoesn't filter fields byprotectionlevel, so asystem-managed field (e.g., person's_possible_duplicate) would render as a raw editable control if a type were ever rendered through generic per-field iteration without that filter — not currently reachable in production (the two other core types withsystemfields,ai-chatandcollection, both have dedicated full-page viewers that bypassBaseNodeViewer's generic-form branch), but worth closing before anything relies on that path.projecthas no plugin registration, so there is no slash command / user-facing way to create one today (AI/MCP only). This is a product decision (isprojectmeant to be user-creatable the waytask/personare, or agent-managed only?), not a mechanical fix, so it's filed for confirmation rather than resolved unilaterally.personkept hardcoded, not converted to schema-driven field iteration — deliberate, not an oversight. Both ofperson's two real fields already carry non-trivial, actively-used UX from core#2116 (name→content sync; blur-triggered adopt-existing suggestion with a monotonic-generation staleness guard; a convergence "possible duplicate" badge) that a generic loop would still need to special-case, and the schema's third field (_possible_duplicate) is system-managed and must never be user-editable — see the protection-level filtering gap above. Net benefit of converting now was judged low relative to the regression risk; Compose task/person schema forms through a shared TypedFormShell; remove hardcoded enum/date-picker duplication #2132 revisits this after the shell/dedup work lands.required/defaultenum semantics — the backend already applies schemadefaults at node-creation time (apply_schema_defaults_with_fields,crud.rs), so a new project node'sstatusis never actually empty in practice; verified via the new project schema tests. No submission-blocking validation exists anywhere in this form family today (task included), sorequiredstays informational metadata for now — tracked in Compose task/person schema forms through a shared TypedFormShell; remove hardcoded enum/date-picker duplication #2132 if a visible affordance is wanted later.Testing
bun run test(cold vitest cache): 4730/4731 passed. The one failure (architecture-benchmarks.test.ts, a timing threshold) is a pre-existing flaky perf test unrelated to this change — passes in isolation, confirmed before and unaffected by this diff.bunx svelte-check: 0 errors.bun run quality:fix: clean (eslint, svelte-check, tsc,cargo fmt,cargo clippy --all-targets -D warnings -D clippy::unused-async) — no Rust files touched by this PR; ran to confirm the sidecar-build/workspace still compiles clean..rs) files changed.