Repository navigation
Filter already-linked targets in the two-pane relationship picker - #2461
Merged
Merged
Conversation
Rebased against #2432's already-merged two-pane relationship panel, which rewrote relationship-viewer-modal.svelte end to end (including removing the paste-a-UUID picker path this issue originally described — search is now the only entry path into the target picker). Add linkedTargetIds/isTargetLinked/filterUnlinkedTargets to relationship-grouping.ts as the single source of truth for "already linked into this group", comparing case-insensitively since a caller may hold an id in a different case than the backend's canonical lowercase form. runSearch now filters through filterUnlinkedTargets instead of an inline, unshared Set. Also fixes an imprecision already present in the merged two-pane picker: the "no matches" message was keyed off whether the relationship already had ANY linked row (group.rows.length > 0), so a genuinely-empty search on a relationship that already had other linked rows misreported "every result is already linked" instead of "No matches." It's now keyed off whether THIS search's own raw results were non-empty before filtering. Co-Authored-By: Claude <noreply@anthropic.com>
6 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
Closes #2434.
The relationship picker used to have a paste-a-UUID entry path (
relationship-viewer-modal.svelte) that bypassed the "already linked" filter search results went through, so pasting the id of an already-linked node offered a live "Use ID" Add whose write silently no-opped (the daemon'screate_relationshipis correctly idempotent for an existing edge).Note on scope drift: my first pass at this fix (PR #2456, since closed) targeted the old stacked-table picker. #2432's two-pane redesign merged into
mainwhile that PR was in review and rewroterelationship-viewer-modal.svelteend to end, including removing the paste-a-UUID path entirely — the picker is search-only now. So the specific paste-UUID repro in #2434 can no longer happen. This PR instead:linkedTargetIds/isTargetLinked/filterUnlinkedTargetstorelationship-grouping.tsas the single source of truth for "already linked into this group" — comparing case-insensitively (a caller may hold an id in a different case than the backend's canonical lowercase form; caught this in review of the closed PR).runSearchin the two-pane picker now filters throughfilterUnlinkedTargetsinstead of an inline, unsharedSet.group.rows.length > 0(does this relationship have ANY linked row at all), so a genuinely-empty search on a relationship that already had other linked rows misreported "every result is already linked" instead of "No matches." It's now keyed off whether this search's own raw results were non-empty before filtering (addAllLinked).The daemon's idempotent
create_relationshipis untouched — pure frontend diff.Test plan
linkedTargetIds/isTargetLinked/filterUnlinkedTargets(including 2 case-insensitivity regression tests), each individually mutation-tested (broke the real implementation, confirmed the test failed, restored, confirmed it passed again)bun run test— 232 files / 4895 tests passsvelte-check/tsc --noEmit/eslint— cleancargo build --bin nodespaced(the actual pre-push gate step) — cleantest:all+cargo build --bin nodespaced+test:e2e) — green, confirmed via the push itselfNote:
bun run quality:fix'scargo clippystep currently fails onmaindue to unrelated code inpackages/daemon/src/services/embeddings_service.rs(introduced by the most recent commit on main, unrelated to relationships). Confirmed this PR's diff touches zero Rust files andcargo build --bin nodespaced(what the actual push gate runs) is clean.🤖 Generated with Claude Code