Skip to content

Relationship viewer: view settings — columns/sort/filter + persistence (closes #1918) - #2003

Merged
mstomar125 merged 1 commit into
mainfrom
issue-1918-view-settings
Aug 7, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-1918-view-settings

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Closes #1918 — the final slice (d, view settings). Completes the relationship viewer: read-only viewer (#1992) → backend editing surface (#1993) → trigger on task/person forms (#2001) → editable modal + target picker (#2002) → view settings (this PR).

What

Per-relationship-group view settings in the modal (sliders popover):

  • Column selection across three sources — target intrinsics (Target, Type), edge attributes, and the target type's own schema fields (fetched lazily per related node). Target label is pinned.
  • Sort by any displayed column (incl edge properties), asc/desc; missing values sort last; sorts committed values, never edit drafts.
  • Filter a group by a column's value.
  • Persistence in localStorage keyed per relationship identity (nodeType::relationshipName::direction::targetType) — a per-user presentation preference, not schema-node data nor per-instance.

Pure logic (relationship-view-settings.ts) + persistence (relationship-view-settings-service.ts) are unit-tested (53 tests). Live-validated end to end: column toggle, sort, and persistence across reopen.

Adversarial review → addressed

Review confirmed the core solid (sort/filter correctness, bounded once-per-id lazy fetch, corrupt-localStorage normalization, dedup, reactivity, edit-mode). One MAJOR fixed: the persistence key omitted targetType, so a node's two inbound groups that share a (name, direction) but differ by declaring source type collided — now keyed with targetType (+ a collision-isolation test). Minors fixed: a target field named type/label is skipped (dup intrinsic heading); hiding a column that drives sort/filter clears it. svelte-check / eslint / vitest clean; gate green.

Per-group view settings for the relationship modal: column selection (across
target intrinsics, edge attributes, and the target type's own schema fields),
sort, and filter, persisted per relationship.

Review fixes folded in:
- Persistence key now includes the target type
  (`nodeType::relationshipName::direction::targetType`). A node renders one
  inbound group per declaring source type for the same relationship name; the
  previous key collided them, so their view settings clobbered each other.
- Resolving column candidates skips a target field named `type`/`label` — it
  would duplicate the intrinsic Target/Type columns under the same heading.
- Hiding a column that drives the sort or filter now clears that sort/filter,
  so the control can't keep applying an invisible column.

Persistence in localStorage keyed by relationship identity (a per-user
presentation preference, not schema-node data nor per-instance). Column
resolution, sort/filter application, and persistence (including the inbound
target-type isolation) are unit-tested (53 tests); validated live end to end
(column toggle, sort, and persistence across reopen).

Co-Authored-By: Claude <[email protected]>
@mstomar125

Copy link
Copy Markdown
Contributor Author

Adversarial review → addressed → APPROVE. Independent review confirmed the implementation is solid (sort/filter correctness, bounded once-per-id lazy target-field fetch, corrupt-localStorage normalization, column dedup, reactivity, edit-mode interaction). One MAJOR — the persistence key omitted targetType, colliding a node's two inbound groups that share (name, direction) but differ by declaring source type — fixed with a target-type-inclusive key + a collision-isolation test. Minors fixed (dup type/label column skip; clear sort/filter on column hide). 53 unit tests, svelte-check/eslint clean, live-validated (columns/sort/persistence), gate green. APPROVE.

@mstomar125
mstomar125 merged commit a3754af into main Aug 7, 2026
@mstomar125
mstomar125 deleted the issue-1918-view-settings branch August 7, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relationship viewer: view and manage typed relationships between nodes

1 participant