Skip to content

feat(node-ui): S4 assertion detail view + S5 breadcrumb nav + M2(b) cross-subgraph follow#909

Open
Jurij89 wants to merge 4 commits into
mainfrom
feat/s4-s5-assertion-detail-breadcrumb
Open

feat(node-ui): S4 assertion detail view + S5 breadcrumb nav + M2(b) cross-subgraph follow#909
Jurij89 wants to merge 4 commits into
mainfrom
feat/s4-s5-assertion-detail-breadcrumb

Conversation

@Jurij89

@Jurij89 Jurij89 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Three Track-A context-graph navigation features as a 3-commit bundle:

  • S4 — Assertion Detail View (01e802426): new AssertionDetailView (entity-detail twin — Entities/Triples/Graph tabs + right-rail metadata); lifecycle trail created ▸ promoted ▸ published ▸ finalized with is-current halo; useAssertionState hook (lazy per-mount state fetch); AssertionsList row click-through; Promote CTA (visible only when state==='created' && layer==='wm', reuses shared handlePromote); hydrating / state-error / promoted / created-empty edge-states.
  • S5 — Breadcrumb Navigation (3c1ecf4a3): inline breadcrumb in ProjectHeaderStrip (Context Graph › layer|subgraph › entity|assertion); drops the in-detail "Back to Context Graph" button (breadcrumb is the sole back-affordance); hop navigation reuses the M2 origin-snapshot.
  • M2 option (b) — silent cross-subgraph follow (b433866ee): link-follow now switches activeSubGraph via setActiveSubGraphSync; the breadcrumb makes the move visible.

Related work

Files changed

  • src (6): api.ts (fetchAssertionState/fetchAssertionTriples/rawBindingValue), hooks/useAssertionState.ts (new), styles.css (is-current halo + discarded dot + breadcrumb), views/ProjectView.tsx (selectedAssertion state + cross-subgraph follow), views/project/components.tsx (AssertionDetailView + breadcrumb + drop back button), views/project/helpers.ts (trail/CTA/subgraph-line/breadcrumb helpers).
  • test (7): assertion-detail-helpers, assertion-detail-view.dom, breadcrumb.dom, use-assertion-state, s5-back-affordance-removed, project-view-navigation, ka-detail-label.

Test plan

  • 20-item plan (T01–T20; 18 merge-gate / 2 smoke) + stuck-loading regression test (negative-proofed) + created-empty branch test.
  • Full node-ui suite: 96 files / 1354 pass / 38 skip / 0 fail.
  • Coverage above ratchet floor: 69.62 stmt / 61.1 br / 65.1 fn / 72.28 lines (floor 58/49/51/60).
  • Extended slice deterministic ×2 warm reruns (220 tests, identical). tsc --noEmit (package) clean.

Notes for reviewers

  • src/ui tsc parity: src/ui's standalone tsconfig has 33 pre-existing errors; this PR adds 1 more instance of the existing entityMeta(e, profile) ProjectProfile | undefined pattern (byte-identical to the KADetailView twin + 3 other sites). NOT a regression — the package tsconfig (the CI gate) excludes src/ui and is clean. A proper fix is shared-type surgery across all call sites (out of scope).
  • .v10-ka-back retained: class stays because AgentProfileView uses it for an unrelated shell-level back (sibling of the protected PanelCenter "Back to Project"); only the CG-detail back button was removed.
  • Graph tab: ships with current viewport; S7 (Track B, pending) lands the full-width/expandable upgrade for both detail views — code comment marks the deferral.
  • Promoted empty-state: detail panes scope to the assertion's data graph; a promoted assertion's data graph is empty post-promote (documented G-BACKEND-M5 backend gap) → graceful explanatory empty-state. S4's shippable scope is the created WM assertion.

🤖 Generated with Claude Code

@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from b433866 to 2d78973 Compare June 1, 2026 22:06
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/api.ts
Comment thread packages/node-ui/src/ui/views/project/helpers.ts
Comment thread packages/node-ui/src/ui/hooks/useAssertionState.ts
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from 2d78973 to 076df56 Compare June 1, 2026 22:16
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/views/project/components.tsx
Comment thread packages/node-ui/src/ui/api.ts
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from 076df56 to 0818d95 Compare June 1, 2026 22:21
Comment thread packages/node-ui/src/ui/hooks/useAssertionState.ts
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/api.ts Outdated
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from 0818d95 to a226d38 Compare June 1, 2026 22:38
Comment thread packages/node-ui/src/ui/api.ts
Comment thread packages/node-ui/src/ui/views/project/helpers.ts
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Jurij Skornik and others added 3 commits June 2, 2026 00:55
Add a clickable assertion detail view (the twin of KADetailView):
Entities / Triples / Graph tabs + an ASSERTION INFO + LIFECYCLE
metadata rail, scoped to the assertion's own data graph.

- AssertionsList rows are now click-through (onSelectAssertion threaded
  through LayerContent + LayerDetailView); the promote button stops
  propagation. Rows are keyboard-focusable.
- New useAssertionState hook (a verdict lock-b, lazy): on mount it reads
  dkg:state + dkg:memoryLayer + dkg:assertionGraph + prov:wasAttributedTo
  for the lifecycle URN from <cg>/_meta. fetchAssertionTriples reads the
  assertion's own data graph for the Entities/Triples/Graph panes.
- Lifecycle trail reuses .v10-ka-timeline / .v10-ka-event* with a new
  is-current halo (rgba mirrors the existing dot fills) + a discarded
  tone; layer tone wiring by trust layer; discarded renders a single
  muted event.
- Header: 3-line structure (line 3 subgraph only when truthy); right-rail
  badge {glyph} {layer} · {state}. Promote CTA only when
  state==='created' && layer==='wm', reusing a shared useAssertionPromote
  hook (AssertionsList adopts it too — no duplicated daemon call).
- Triples tab is a plain s/p/o table, no filter pills.
- Graph tab uses the current viewport treatment with the required S7
  follow-up comment at the mount site.
- Edge cases: hydrating (CTA hidden, all-neutral trail, no state suffix)
  and state-fetch error (panel "state unavailable", quiet danger hint).
- ProjectView: selectedAssertion state + openAssertionDetail (captures M2
  origin), mutually exclusive with the entity detail; handleDetailClose,
  layer-switch and subgraph-select all clear it.

Tests: T01-T03 (helpers), T06/T07/T20 (ProjectView navigation),
T08/T09/T10/T17 (detail-view DOM), T19 (state/triples reads).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the in-detail "← Back to Context Graph" button with a persistent
breadcrumb in ProjectHeaderStrip, the sole back-affordance for both the
entity and assertion detail views.

- buildBreadcrumbHops: Context Graph › {Layer full-name | Subgraph
  displayName} › {entity | assertion name}. Middle hop is EITHER the
  layer OR the subgraph, never both (§4.7.1). First hop → overview;
  middle hop (when a detail is open) → restore the M2 origin; trailing
  hop is a non-interactive span ("you are here").
- ProjectHeaderStrip renders the hops inline in the existing
  .v10-project-strip flex row (does NOT stack), reusing
  .v10-project-strip-sep (now 6px each-side padding) for the › glyph.
  Clickable hops: --text-link + underline-on-hover + focus-visible ring;
  per-hop max-width 200px + ellipsis (first hop stays intact);
  unconditional title= tooltip on every hop. Removes the now-orphaned
  .v10-project-strip-name / -sg / -sg-icon rules.
- KADetailView drops its .v10-ka-back button + onClose prop; the
  breadcrumb drives close via ProjectView.handleDetailClose.
  AssertionDetailView never had a back button (S4 lock).
- ProjectView: ProjectHeaderStrip wired with activeLayer + detailLabel
  (entity label / assertion name) + onOverview (→ overview) +
  onRestoreOrigin (= handleDetailClose); KADetailView onClose removed.

Note: the .v10-ka-back CSS class is retained — AgentProfileView's
unrelated "← Back" still uses it (a shell-level back, sibling of the
protected PanelCenter "Back to Project"). The "Back to Context Graph"
label and the detail-view button are gone (T13 guards both).

Tests: T04/T05 (breadcrumb hop construction + cross-subgraph update,
helpers); T11/T12 (ellipsis tooltip + clickable/trailing affordance,
DOM); T13 (back-affordance-removed source guard); existing M2 close
tests rewired to the breadcrumb restore path; ka-detail-label updated to
assert the back button is gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ollow

Enable the cross-subgraph auto-switch alongside S5. When following a
link to an entity that lives in a DIFFERENT sub-graph than the one in
scope, handleNavigate switches activeSubGraph to the target's sub-graph
via setActiveSubGraphSync (PR #793 Bug N) so the breadcrumb's React tree
sees it synchronously. The breadcrumb now makes the move visible
(Context Graph › <new subgraph> › Entity), which is what made option (b)
acceptable (the plan tied (b) to the breadcrumb existing).

Ground-truth note: there was no option-(a) "suppression branch" to
reverse — the prior handleNavigate did NO subgraph switching at all
(option (a) was the ABSENCE of a switch). So this ADDS the follow logic.

- primarySubGraphOf(entity): first non-meta subgraph slug (mirrors the
  SubGraphBadge rule); the follow decision input.
- entitiesRef mirrors rawMemory.entities so handleNavigate resolves the
  target's subgraph synchronously without churning its (deliberately
  stable) callback identity.
- The follow fires ONLY when already on a sub-graph page — opening an
  entity from a plain layer list does NOT spuriously jump into a
  sub-graph just because the entity belongs to one.
- The M2 origin snapshot is still captured at first open, so closing
  returns to the ORIGINATING page, not the followed-into one (the
  origin-restore overwrites any mid-open switch).

Tests: T14 (cross-subgraph follow switches activeSubGraph + breadcrumb
reflects + close returns to origin), T15 (plain-layer open does not jump
into a subgraph; M2 origin model intact), T16 (handleDetailClose serves
both detail kinds — covered by the entity + assertion close tests),
primarySubGraphOf unit truth table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from a226d38 to 9f3025c Compare June 1, 2026 22:57
Comment thread packages/node-ui/src/ui/api.ts
Comment thread packages/node-ui/src/ui/api.ts Outdated
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/api.ts Outdated
Comment thread packages/node-ui/src/ui/views/project/helpers.ts Outdated
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from 70cb9be to e66f8f3 Compare June 2, 2026 07:27
Comment thread packages/node-ui/src/ui/api.ts
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from e66f8f3 to 44fd407 Compare June 2, 2026 07:43
Comment thread packages/node-ui/src/ui/api.ts Outdated
Comment thread packages/node-ui/src/ui/api.ts
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from 44fd407 to 6aa06e2 Compare June 2, 2026 08:05
Comment thread packages/node-ui/src/ui/views/ProjectView.tsx Outdated
Comment thread packages/node-ui/src/ui/views/project/helpers.ts
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from 6aa06e2 to e10ed15 Compare June 2, 2026 08:21
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/views/project/helpers.ts
Comment thread packages/node-ui/src/ui/views/ProjectView.tsx Outdated
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from e10ed15 to 9579e1b Compare June 2, 2026 08:49
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from 9579e1b to efb3b19 Compare June 2, 2026 09:13
Comment thread packages/node-ui/src/ui/views/ProjectView.tsx Outdated
Comment thread packages/node-ui/src/ui/views/project/helpers.ts Outdated
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from efb3b19 to 917a3a7 Compare June 2, 2026 09:42
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
Comment thread packages/node-ui/src/ui/views/project/components.tsx Outdated
… empty-state copy

Round-3 review fixes on the S4 assertion detail view (kept as a focused
4th commit rather than folded into C1 — the fixup's helpers.ts hunk
overlaps C2's breadcrumb helpers + C3's primarySubGraphOf, so an
autosquash into C1 conflicts mechanically; a standalone commit is the
clean, conflict-free shape team-lead OK'd).

- Finding 2 (api.ts fetchAssertionState): the assertionGraph fallback
  was URI-shape-unsafe. For an SWM input (a `urn:dkg:assertion:…`
  lifecycle URN) whose `dkg:assertionGraph` did NOT resolve
  (legacy/partial `_meta` row), echoing the URN made fetchAssertionTriples
  query `GRAPH <urn:…>` (a graph that never holds triples) → bogus render.
  Now: urn-input + unresolved → assertionGraph: undefined (Triples/Entities
  fall to their empty-state). WM data-graph-URI input still echoes itself.

- Finding 3 (assertionEmptyStateCopy, ux §4.7.1 locked): the empty-state
  copy now keys off `dkg:state` (4 branches) instead of special-casing
  promoted only — published/finalized show the VM / Knowledge-Assets line
  ("entities → Knowledge Assets" at the VM boundary, §4.8), discarded is
  terminal, created/promoted unchanged. Plain text, no links.

- Finding 1 (remote SWM state) reply-not-valid (no replicated state
  source); finding-1 round-2 discarded-neutral badge + finding-2 round-2
  literal-display decode already shipped earlier in C1.

Tests: SWM-legacy-no-assertionGraph guard + WM-echo counterpart
(use-assertion-state); assertionEmptyStateCopy 4-branch truth table
(assertion-detail-helpers); published empty-state DOM render
(assertion-detail-view). Finding-2 guard negative-proofed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jurij89 Jurij89 force-pushed the feat/s4-s5-assertion-detail-breadcrumb branch from 917a3a7 to b742f6f Compare June 2, 2026 10:19
Comment thread packages/node-ui/src/ui/api.ts
Comment thread packages/node-ui/src/ui/views/project/components.tsx
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.

1 participant