fix(hub): the Dashboard can filter by shared reads, not just human and agent (BEA-62) - #117
Merged
ssowonny merged 2 commits intoAug 5, 2026
Conversation
…d agent The page named three read types and let you filter two. The missing chip was share — traffic from public links an owner minted, which is the category they most want to isolate. Everything but the lens already spoke "share": heatTotal, heatText and hotPathSplit all carry it, and /heat returns it per path. So widening the union makes the treemap, the scatter and the Hot path arithmetic correct for free. The one place that decided anything was the Hot path bar, which branched agent-vs-human and would have painted shared reads in somebody else's colour; it now looks the pure lens up in a table instead. The e2e seed had no share reads at all, so the lens could not be asserted. It gains one on notes/deep/topic.md — a path no other assertion counts, so nothing else's totals move. BEA-62
# Conflicts: # internal/webapp/static/assets/index-BMdHuKLj.js # internal/webapp/static/assets/index-BhUNiSiq.css # internal/webapp/static/assets/index-C09zb-Gt.js # internal/webapp/static/assets/index-Cj99Pu7j.js # internal/webapp/static/index.html
ssowonny
deleted the
bea-62-ph-scan-bug-dashboard-read-type-filter-chips-omit-shared
branch
August 5, 2026 07:19
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.
TL;DR
Closes BEA-62.
The hole
The page's own vocabulary, across the three places it appears:
So the one category a project owner most wants to isolate was the one with no
way to isolate it.
What changed
type Lenswas a three-value union while every heat entry already carriedshare:heatTotal,heatTextandhotPathSplitall handle it, and/heatreturns it per path. Widening the union makes
e[lens]resolvee.share, sothe treemap, the scatter, the orphan footnote and the Hot path arithmetic are
correct without touching any of them.
Two small refactors came with it, both to stop a nested ternary growing a
fourth arm:
LENS_ORDER+LENS_LABELreplace the inlinel === "all" ? … : …chain in the chip row.PURE— a lookup from lens to bar split — replaces the agent/human ternary at the Hot path bar. This is the only line that decided anything: without ashareentry the bar falls through to the real split and paints share-only reads in agent's or human's colour.No Go change beyond the seed. No API change:
/heatalready returned thesenumbers, and nothing in this diff adds an actor identity to any response — the
chip is a count filter, not a reader list.
The new lens, end to end
And the bar, which is the part that could have been wrong — one row, painted in
the share swatch rather than agent's orange or human's blue:
Two deviations from the reviewed plan
Both in the tests, neither in the behavior.
browse.spec.tsandsec12.spec.tsmint share links and open them — which records real share reads onguide.md,index.mdandpages/sec12-tab.html. The count came back 3, and would move again the next time someone adds a share spec. The test now asserts the invariant instead:notes/deep/topic.mdpresent with its 3 reads and a share-coloured bar, and two files with reads but no share reads (archive/retired-spec.md,scratch.md) absent — the lens filters, it doesn't merely re-sort.0.0%isn't in the DOM. The plan's bar assertion read thestyleattribute; the browser serializeswidth: 0.0%down towidth: 0%. It checks computed CSS (toHaveCSS("width", "0px")) instead, which is what the assertion meant anyway.The seed row landed where the plan put it —
notes/deep/topic.md, deliberately apath with no existing assertions.
notes/deepdoes now carry a heat dot in itsfolder listing;
browse.spec.ts:50andlayout.spec.ts:158both survive it(one names a different file, the other counts dots dynamically), verified by
running the full suite rather than reasoning about it.
Worth a look before approving
At 360px the four chips fit with no horizontal scroll and nothing clipped, but
each label now wraps to two lines where three chips sat on one.
.in-lenshasno
flex-wrap, so this is squeeze rather than wrap. It reads fine to me andadding
flex-wrap: wrapwould change the layout at every width, so I left it —but it's a judgement call and it's yours:
What was run
go test ./...— green (full suite, includinginternal/webapp).go vet ./...— clean.npm run e2e— 148 passed, 1 skipped (the skip is the pre-existingsec14fe.spec.ts:300). Baseline was 146; the two new specs are the delta.npm test(frontend units) — 53 passed.frontend/check-dist.sh—internal/webapp/static is fresh, rebuilt assets committed.:8993— every screenshot above is from that run, at 1280×900 and at 360/390/430px.No architecture diagram change:
architecture/webapp-frontend.mdalready listsInsightsandhotPathSplit, and no type or relationship it draws moved.Build session
(Only works on the machine this ran on.)