Skip to content

fix(analytics): preserve selected hash size in links - #1967

Merged
efiten merged 3 commits into
Kpa-clawbot:masterfrom
n30nex:codex/analytics-hash-byte-links
Sep 6, 2026
Merged

fix(analytics): preserve selected hash size in links#1967
efiten merged 3 commits into
Kpa-clawbot:masterfrom
n30nex:codex/analytics-hash-byte-links

Conversation

@n30nex

@n30nex n30nex commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Red commit: 5a5ecb6 (local browser: 14 passed, 8 behavior assertion failures before the fix).

Hash Issues links now restore bytes=1|2|3 for the selected control and its matrix/collision data. Missing or malformed values default to one byte. Selector clicks, section/top links, tab-bar changes, filters and theme refreshes retain the chosen view through the existing URL helper.

Fixes #1914.

  • E2E assertion added: test-issue-1306-collisions-terminology-e2e.js:242. The existing CI-selected harness passes 23 checks, including distinct nonempty collision rows for each byte size. Its original assertions remain.
  • Browser verified: http://127.0.0.1:55634 with the local fixture API, plus reviewed matrix/risk screenshots. Region refresh passed; area coverage skips because the fixture has no areas.
  • Required frontend checks pass: 99 filter, 18 aging, 666 helpers; URL helpers pass 18. Three independent reviews found no blocking issues; their coverage suggestion is included in fb482fe.
  • Added work parses URL state and updates six links. Rendering and bulk requests are reused; no backend, configuration, dependency or CI-list changes.
  • A broader smoke run timed out at Live autocomplete (bug(live): node filter is oversized, ignores dark mode, no autocomplete, requires Enter + reloads page #1110); full-suite success is not established.

Preflight overrides

@efiten

efiten commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Merging. CI had never run on this (it was stuck in action_required, now approved for all seven of your PRs) and came back green.

The change is well contained and the details are right where they usually are not:

  • The URL value is validated, not trusted. ['1','2','3'].includes(urlBytes) with a fallback to 1 means a hand-edited or truncated link cannot put the view into a state the server has no data for.
  • history.replaceState only fires when the hash actually changes. Rewriting it unconditionally on every refresh is how a back button ends up useless.
  • data-hash-section moves the section anchors along with the selection, so a shared "Hash Issues" link lands on the section the reader was looking at and the byte size they were looking at, rather than one of the two.
  • URLState.updateHashParams is the existing shared helper (public/url-state.js:93), not a second implementation of hash editing.

Reading the byte size on every render rather than once at init is the part that actually fixes it: a tab switch, filter change or theme refresh re-renders, and the old refreshHashViews(1) silently reset the view each time. That is why this looked intermittent rather than broken.

eslint clean, frontend helper suite 666 passed 0 failed on your branch.

@efiten
efiten merged commit eb1d733 into Kpa-clawbot:master Sep 6, 2026
7 checks passed
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.

Allow to link to Mesh Analytics with a path hash byte size set via url

2 participants