Repository navigation
Person schema: replace name with first_name and last_name - #2508
Conversation
Splits person's single `name` property into `first_name`/`last_name` and
adopts a `titleTemplate` ("{first_name} {last_name}") as the single
composition rule, replacing three previously-independent hand-composed
copies (compute_display_name, content-sync, the onboarding identity flow).
Whitespace-collapse + trim in interpolate_title_template_with_schema
degrades correctly when one or both fields are empty.
Person nodes are now read-only inline (like other title_template-driven
types) with display composed server-side; PersonSchemaForm, the
onboarding wizard, and the Settings identity card all move to two name
fields. Extends into the onboarding-identity subsystem (proto RPC, Tauri
command, wizard, identity-card, git-config prefill split) not listed in
the issue but sharing the same `name` field and breaking under the same
change.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01G13TUWLzHwrGGi9Ubw8bQt
Pragmatic Code Review — PR #2508 (closes #2111)Review Type: Initial Review Requirements Check (issue #2111)
All 9 acceptance criteria are met. Scope note (not in the issue's stated call sites)The PR also converts the onboarding-identity subsystem (proto Code Review Findings🟡 Important: Zero test coverage for
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above — two 🟡 test-coverage gaps (person-node.svelte, SchemaFormLoader's new hasTitleTemplate fallback branch) flagged as worth closing before merge but not blocking; both traced by hand and found correct as implemented.
Code Review SummaryThis PR correctly implements the core ask of #2111 — splitting Recommend REQUEST CHANGES — not because the person-schema work itself is wrong, but because the specific mechanism this PR chose for duplicate-detection display names doesn't reach the frontend as implemented. Everything else is solid. Requirements Check (issue #2111)
Code Review FindingsCritical Issues🔴
Ok(Node {
id: nd.id,
...
title: None,
})This is not new code in this PR, but it means This PR introduces three new reads of
All three will silently fall through to their This also means const title = $derived(sharedNodeStore.getNode(nodeId)?.title);( Why unit tests didn't catch it: Engineering principle: A cross-layer contract (wire message → domain type) needs to actually carry the field a new feature depends on before that feature ships. This PR correctly identified and implemented the composition rule but the transport of the composed value was not verified end-to-end — the person work is the first core-type consumer to actually exercise this path, so it's the first place the gap becomes visible. Either add Recommendation: Verify this by actually running the desktop app ( Suggested Improvements🟡 Confirmed both implementations are semantically equivalent today (space-join non-empty parts; 🟡 The old code read the daemon's flattened 🟡 Traced the requested scenario (open person node A → navigate to node B before A's async schema-form/generic-schema lookups resolve) in detail: Nitpicks
Recommendation: REQUEST CHANGESThe schema, composition-rule, and onboarding-identity work is solid and ready. The blocker is the |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks self-approval/self-request-changes). Full findings in the review comment above — critical issue: node.title is never populated over the wire (NodeData proto has no title field; proto_node_data_to_node hardcodes title: None), so the PR's new title-based display reads (person-node.svelte inline display, PersonSchemaForm/possible-duplicate-badge duplicate-suggestion names, membership.svelte.ts co-member names) will not resolve in production despite passing unit tests that mock the backend response directly.
…late path - Adds hasTitleTemplate coverage for person (the first hardcoded-form type to exercise the new pluginRegistry fallback branch), including a navigation-sequence test pinning that currentNodeType tracking doesn't leak the previous type's answer across resetGenericSchema/loadForm. - Fixes pre-existing flakiness in the same file: task-schema-form.svelte's cold dynamic import can exceed vitest's 5s default in isolation. Adds a beforeAll warm-up (same pattern as core-plugins.test.ts's viewer warm-up) for both task and person's schema forms, rather than raising the per-test timeout. - person-node.svelte now reads `nodeType` (its own prop) instead of a hardcoded 'person' literal for the title_template placeholder lookup — harmless today since PersonNode is only ever registered for 'person', but was inconsistent with every other reference in the file. Skipped: extracting a `resolvePersonDisplay` helper into node-display-title.ts was tried and reverted — that file's docblock is explicitly a generic, type-agnostic rule (any node type via a caller-supplied hasTitleTemplate boolean), and a person-specific wrapper didn't belong there. person-node.svelte instead composes the same primitives node-row.svelte already uses inline for every other title_template type (HAS_RESOLVED_CHARACTER_RE + pluginRegistry.getTitleTemplate), keeping one pattern rather than adding a one-off abstraction. compute_display_name's Rust-side duplication of the composition rule was also left as-is — both sides carry cross-referencing comments and independent test coverage; a shared helper isn't worth the cross-language friction. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G13TUWLzHwrGGi9Ubw8bQt
Address-Review SummaryAddressed both 🟡 findings from the review; the 🟢 hardcoded-string finding was folded into the same fix. The two 🟢 "no action needed" notes weren't recommendations to act on. ✅ Addressed
⏭️ Tried, then reverted (not a "skip")I initially extracted a Reverted. Not acted on (not recommendations)
Verification
Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: All changes in this round are test-only (5 new tests + 1 flaky-test fix) plus a single one-line consistency fix ( |
Summary
namefield intofirst_name/last_name;emailunchangedtitleTemplate: "{first_name} {last_name}"as the single display-composition rule, replacing three previously independent hand-composed copies (compute_display_name,PersonSchemaForm's content-sync, and the onboarding identity flow). Whitespace-collapse + trim ininterpolate_title_template_with_schemaalready degrades correctly when one or both name fields are emptynode.titlePersonSchemaForm, the onboarding wizard, and the Settings identity card all move to two name inputsSetLocalPersonIdentityRequest, theset_local_identity/get_local_identityTauri commands, the wizard,identity-card.svelte, and the git-config prefill split via a newsplitFullNamehelper) — not listed in the issue's call sites, but built on the same singlenamefield and broken by the same changeperson_empty_name_is_valid/person_absent_name_is_validstill pass unchanged — a person with no name remains valid{"person":{"name":...}}updatedDecisions recorded
node-display-title.ts,plugin-registry.tsdocs reference'{first_name} {last_name}'verbatim), and the interpolation helper already degrades correctly for missing fields.email, then"Unknown"— same rule in bothtitle_template(schema) andcompute_display_name(Rust, used only for the embedding-content fallback which title_template doesn't reach).namefield doesn't exist post-reset and the two would need to land together regardless.Test plan
bun run test— 239 test files, 4930 tests passed (5 new)bun run rust:test:workspace— full workspace, 0 failuresbun run rust:lint(clippy,-D warnings -D clippy::unused-async) — cleanbun run rust:format— cleanbun run quality:fix(eslint + svelte-check) — 0 errorstest:all+cargo build --bin nodespaced+test:e2e+ Tauri-seam integration tests) — all greenCloses #2111
🤖 Generated with Claude Code
https://claude.ai/code/session_01G13TUWLzHwrGGi9Ubw8bQt