Repository navigation
Fix entity-noun title gate and person placeholders (#2374 items 2-4) - #2533
Merged
Merged
Conversation
…#2374) Table-view system-field leak (item 2) was already fixed on main by a duplicate issue's PR before this session started; verified still passing, no change needed here. Untitled-node fallback (item 3): navigation-service.ts's generateTabTitle gated its plugin-name fallback on rendersAsEntityRow alone, so person (which has an inline node component) fell through to the raw "person Node" instead of its plugin name. Splits the gate into two independent predicates: rendersAsEntityRow (unchanged, still drives arrow-nav/entity-row rendering) and the new hasEntityNounName (whether a plugin's name is a real noun, not a registry label like "Text Node"). person opts in via PluginDefinition.entityNoun. The fallback itself now reads "Untitled <name>" instead of a bare name, applied uniformly to every type that reaches it (ai-chat, document, user, collection, user-defined schema types, and now person) rather than only person. Also switches title/content resolution to the shared resolveTitleOrContent helper so a title_template- driven type's stale content can no longer leak through before reaching the fallback. text/header/task keep their original raw "<type> Node" fallback unchanged. Hardcoded placeholders (item 4): person-schema-form's first/last name inputs placeholder'd their own labels back ("First name" input labeled "First name"). Replaced with example values, matching how the email field already does it. Did not add a placeholder field to SchemaField: only two per-type forms exist in the whole codebase (task, person), task has no hardcoded placeholders to migrate, and the Rust SchemaField struct (nodespace-types) is constructed via ~60 exhaustive struct literals across core_schemas.rs/markdown.rs/schema_node.rs/schema/mod.rs/context_ops.rs/ entity_types_block.rs with no ..Default::default() usage, so a new field would require editing all of them for a benefit that would land on exactly one form with three fields. Co-Authored-By: Claude Sonnet 5 <[email protected]>
19 tasks
Contributor
Author
|
Reviewed (adversarial pass): item 2's already-fixed claim independently confirmed (PR#2404, merged 2026-09-07, current main already filters via isUserVisibleField — PR#2533 touches neither file). Item 3's hasEntityNounName confirmed purely additive, text/header regression explicitly tested and correct, new tests traced by hand and correctly shaped to fail on pre-fix code for person/ai-chat/stale-content cases. Item 4's placeholder-field-cost reasoning independently verified (75 SchemaField literal constructions repo-wide, zero using ..Default::default(), exactly 2 hardcoded per-type forms with task having zero placeholders to migrate) — a well-cited judgment call, not corner-cutting. Scope clean, no stray changes. Merging. |
12 tasks
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 free
to 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.
Summary
Addresses items 2-4 of #2374 (item 1, the
_possible_duplicatedesign question, moved to #2377 and is owned by a separate, active workstream — untouched here).Item 2 — table-view system-field leak: already fixed, no change needed
table-view.sveltewas already filteringprotection: 'system'fields (via the sharedisUserVisibleFieldpredicate) and already had a regression test (table-view-protection-filter.test.ts) covering person's_possible_duplicateand all six of ai-chat's system fields — landed by PR #2404 against a duplicate issue (#2376) two days before this session started. Verified the fix and its tests are still correct and passing; nothing further to do.Item 3 — untitled-node fallback showed the raw type id ("person Node")
navigation-service.ts'sgenerateTabTitlegated its plugin-name fallback onrendersAsEntityRowalone.personhas an inline node component, sorendersAsEntityRow('person')isfalse, and it fell all the way to${nodeType} Node→"person Node".Fix:
PluginDefinition.entityNounflag (types.ts) andhasEntityNounNamepredicate (node-type-predicates.ts/PluginRegistry), answering "is this plugin'snamea real user-facing noun" — a genuinely different question fromrendersAsEntityRow("does this render as a read-only row").personopts in;rendersAsEntityRowitself is untouched, since it also drives arrow-nav skipping and entity-row rendering elsewhere and those must not change.rendersAsEntityRow(type) || hasEntityNounName(type)."Person") to"Untitled <name>"("Untitled Person") — applied uniformly to every type that reaches this branch (ai-chat, document, user, collection, user-defined schema types, and now person), not just person, per the issue's own reasoning that it "distinguishes an unnamed node from a named one."resolveTitleOrContenthelper (already used bynode-row.svelte/plugin-registry.ts) instead of an ad hoc duplicate check, so a title_template-driven type (person) with stalecontentleft over from before a type conversion can no longer leak through instead of reaching the fallback.text/header/task(and any other inline-editable, non-entity-noun type) are untouched — they still fall through to the original raw"<type> Node"form. New tests pin this explicitly fortextandheader.Item 4 — hardcoded placeholder restating its own label
person-schema-form.svelte's name field was hardcoded asplaceholder="Display name"when the issue was filed; by the time this session started, an unrelated PR (#2508, "Person schema: replace name with first_name and last_name") had already split it intofirst_name/last_nameinputs — but the same bug persisted, now literallyplaceholder="First name"on a field labeled "First name" (and the same for last name). Fixed to example values ("Jane"/"Doe"), matching how the email field already does it ("[email protected]").Decision: did not add a
placeholderfield toSchemaField. Reasoning:taskandperson— both explicitly documented (types.ts) as reserved for types with genuine bespoke business logic (task's status state machine, person's duplicate-detection UX) thatGenericSchemaFormcannot express regardless of placeholder support. There's no evidence of "drift across many forms" — the bug was isolated to these 3 fields in 1 form.task-schema-form.sveltehas zero hardcoded placeholders to migrate (its fields are all Select/date-picker, no free text).titleTemplatebut deliberately kept person's form hardcoded rather than migrating it toGenericSchemaForm— the strongest available signal that per-type forms are staying, not being phased out.SchemaFieldstruct (nodespace-types/src/schema.rs) is constructed via ~60 exhaustive struct literals acrosscore_schemas.rs,markdown.rs,schema_node.rs,schema/mod.rs,context_ops.rs, andentity_types_block.rs— none using..Default::default(). Adding a field there means touching all ~60 call sites for a benefit that, today, would land on exactly one form's three text inputs.GenericSchemaForm'sSchemaFieldLeafdoes have a real (if narrow) gap — it only derives a placeholder fromfield.default, nothing else — but that's a separate, independently-decidable architectural question, not one this issue's contained scope obliges fixing given the above.Why one PR
All three items are independent but small (9 files, ~220 lines, cleanly separable by file), and item 4 turned out to be simpler than expected (a decision against a schema change, not an implementation of one) — so landing them together keeps review simple without inflating any single PR's surface.
Test plan
bun run test— 239 files, 4939 tests passed (10 new: 4hasEntityNounNamepredicate tests, 5generateTabTitlefallback tests incl. text/header/ai-chat/stale-content-ignored, 1 placeholder test)entityNounflag,Untitledprefix,resolveTitleOrContenttemplate gating, thetext/headerraw-fallback regression guard, and the placeholder test all independently verified to fail on the corresponding regression.bun run quality:fix— eslint, svelte-check, tsc, cargo fmt, cargo clippy (-D warnings -D clippy::unused-async) all cleanbun run test:all(unit + browser + skill + full Rust workspace) — 0 failurestest:all+cargo build --bin nodespaced+test:e2e) — green, pushed successfullyConfirmation: no regressions to text/header/ai-chat
text/header: explicit new tests confirm untitled nodes of these types still produce the original raw"text Node"/"header Node"fallback (mutation-tested: forcing the new gate to always pass makes these tests fail, confirming they actually exercise the guard).ai-chat: already an entity row before this change (unaffected by theentityNoungate), so its only behavior change is the same"Untitled "prefix every entity-row type now gets — explicit new test confirms"Untitled AI Chat".table-view(item 2): unaffected by this PR entirely — that fix predates this session.Closes #2374 (items 2-4; item 1 lives on in #2377).
🤖 Generated with Claude Code