Repository navigation
Show a person's title in the viewer header on first open; stop logging tab clicks as failed drops - #3523
Conversation
Pragmatic Code Review: PR #3523Review Type: Initial Review (there were no earlier reviews or comments) SummaryThis is a small, focused fix that clearly improves the code. Making
Real drag paths behave as before:
The three new test files pass locally (20 tests). Requirements Check (#3521)
Code Review Findings🟢 Nit: 📁 🟢 Nit: 📁 🟢 Note (no action): Moving the unparseable-index log from 🟢 Note (no action): No critical or important issues. No node-type, Pro-boundary, security or performance concerns: the change is frontend reactivity and logging only. RecommendationAPPROVE. The two nits are optional polish. |
Review addressed
No logic change beyond the refactor. Re-review decision: not needed. Both changes are small, behavior-preserving refactors of review nits. |
…gging tab clicks as failed drops (closes #3521) SchemaFormLoader.currentNodeType becomes $state: for a hardcoded-form type (person) it is the only input to hasTitleTemplate that changes when the form loads, so the header kept its first answer ("Untitled") until the node changed. Regression tests at the loader and the mounted viewer fail with the field made plain again. sveltednd calls onDrop on every pointerup after a pointerdown on a tab, with no target container for a plain click. readTabDrop classifies that as a click; incomplete drop state still warns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m's comment - readTabDrop is generic and its drop result carries the dragged item, so handleDrop decides validity in one place (no second draggedItem check). - loadForm's comment gave the old reason for setting the type synchronously; it now matches the field's doc (the header derives before loadForm runs). Addresses reviewer recommendations from PR review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
828ee83 to
349f672
Compare
Closes #3521
Person header ("Untitled" on first open)
Cause:
BaseNodeViewer's header derives fromschemaFormLoader.hasTitleTemplateon its first render, beforeloadFormruns, becauseloadFormwaits for the children to load.persondeclares its template on its plugin, so the loader'scurrentNodeTypeis the only input that changes when the form loads.currentNodeTypewas a plain field, so the header kept "Untitled" until something else changed the node.Fix:
currentNodeTypeis now$state. Thenode-display-title.tscomment that said no core type ships a template is corrected.Tests (each confirmed failing with the field made plain again):
schema-form-loader.svelte.test.ts: an effect trackinghasTitleTemplatesees it flip onloadForm('person').base-node-viewer-title-template-header.test.ts: mounts the viewer on a persisted person and asserts the header shows its stored title, read-only. A text page still shows its content.TabSystem "Invalid drop operation: missing required state"
Cause:
@thisux/sveltednd0.0.20 starts a drag on every pointerdown on a tab and calls the droppable'sonDropon pointerup. The target container is only set onpointerover, so a plain click arrives as a drop with no target and logged the warning on every tab click.Fix:
readTabDrop(utils/tab-drop.ts, unit-tested) treats that case as a click. Incomplete or unparseable drop state still warns. Real moves are unchanged.Checks
bun run test:changed: frontend (Happy-DOM) and browser passedbun run quality:fix: clean🤖 Generated with Claude Code