fix(node-ui): SubGraphBar "All" pill now matches layer tab badge#725
Merged
Conversation
The All pill skipped any entity whose `subGraphs` set was empty, which silently undercounted root-bucket SWM entities (graph URI `<cg>/_shared_memory`) — their first path segment starts with `_` and `subGraphOf` filters it out, leaving an empty set. WM masked the same bug by accident because root-bucket WM URIs start with `assertion` (non-underscore) which leaks through as a slug. Drop the size === 0 skip so All equals the layer tab badge in both layers. Per-chip counts are unaffected (they still only iterate real named sub-graphs). Pin the new behavior with a fresh vitest case alongside the existing R2-5 / Issue B regressions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous commit dropped the `subGraphs.size === 0` skip unconditionally, which inflated the "All" pill in layer-agnostic mode too (sub-graph page — ProjectView passes entities without `layer`). In that mode "All" is the umbrella over the named chips below it, so root-bucket entities that no chip can drill into inflate the total past anything the user can reach. Restrict the new inclusion to layer mode (the WM/SWM/VM pages, where "All" must match the layer tab badge). Pin both semantics with an explicit test for each. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merged
4 tasks
This was referenced May 27, 2026
matic031
pushed a commit
to KilianTrunk/dkg
that referenced
this pull request
Jun 2, 2026
Brings forward 3 node-ui UI bug fixes that landed on main but hadn't yet flowed into the release branch: - 902a618 fix(node-ui): entity tripleCount matches Triples tab (count type + multi-value + incoming) (OriginTrail#728) - 76b86b9 fix(node-ui): SubGraphBar "All" pill now matches layer tab badge (OriginTrail#725) - 387b0e0 fix(node-ui): WM Assertions tab surfaces sub-graph assertions (OriginTrail#706) (OriginTrail#710) All three touch only node-ui files (UI + UI tests); no runtime / chain / publisher / agent surface area touched. Auto-merge with rc.12 was clean — one file (`packages/node-ui/src/ui/api.ts`) merged automatically with no conflicts.
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
Allpill silently undercounted SWM root-bucket entities (graph URI<cg>/_shared_memory). User-visible repro: layer tab badge27butAll 25on the SWM tab of a context graph with two root-bucket SWM entities.entityScopedAllTotalskipped entities with an emptysubGraphsset, but whether the set is empty depends on a layer-asymmetric parse insubGraphOf(filters_-prefixed first segments). WM root-bucket URIs leak through (<cg>/assertion/...→ slug'assertion') and were counted by accident; SWM root-bucket URIs (<cg>/_shared_memory) were filtered and silently dropped.subGraphs.size === 0skip soAllreflects every layer-resident entity, matching the tab badge. Per-chip counts are untouched — they only iterate real named sub-graphs fromfetchSubGraphs, so removing the skip doesn't surface phantom chips. This is a pre-existing semantic bug, not a regression from fix(node-ui): WM Assertions tab surfaces sub-graph assertions (#706) #710.Related
SubGraphBarcount-correctness themeFiles changed
packages/node-ui/src/ui/components/SubGraphBar.tsxsubGraphsskip inentityScopedAllTotal; expand the inline doc to explain the new semantic and the underscore-filter asymmetry that drove the bug.packages/node-ui/test/sub-graph-bar-layer-scope.test.tssubGraphsset) count toward theAllumbrella. Existing 6 cases stay green.Test plan
pnpm --filter @origintrail-official/dkg-node-ui exec tsc --noEmit— cleanpnpm --filter @origintrail-official/dkg-node-ui exec vitest run test/sub-graph-bar-layer-scope.test.ts— 7/7 pass (new case + 6 existing R2-5 / Issue B regressions)ui-refreshCG: SWM tabAllreads27(matches tab badge);epcis-supply-chainreads24unchanged. WM tabAllstill reads12. Root-only CG (no sub-graphs): bar still renders nothing.Out of scope (intentional follow-ups)
subGraphOfparse asymmetry — the function still returns'assertion'for WM root-bucket URIs. Cosmetic (no chip renders for it); a hygiene cleanup for a future touch.metamembership leaking intoentityScopedCounts.get('meta')— invisible today because themetachip is filtered at the display merge.🤖 Generated with Claude Code