Skip to content

port(upstream#1967): keep the selected hash size in Hash Issues links - #44

Merged
dborup merged 3 commits into
masterfrom
codex/port-upstream-1967-hash-size-links
Sep 20, 2026
Merged

dborup merged 3 commits into
masterfrom
codex/port-upstream-1967-hash-size-links

Conversation

@adminopenclaw8-sketch

@adminopenclaw8-sketch adminopenclaw8-sketch commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

Split out of #25 (commit 0500c0cd there). This branch holds exactly one upstream change so it can be reviewed, tested and reverted on its own.

Upstream

Problem

On Analytics → Hash Issues the selected hash size (1/2/3 byte) was not kept: section and ↑top links, tab switches, filter changes and theme refreshes all reset the view to 1 byte.

Change

refreshHashViews writes bytes into the URL hash via URLState.updateHashParams (with replaceState) and rewrites the section links to carry it. Each render reads bytes back from the URL; missing or invalid values fall back to 1.

Adaptation to this fork

None. The cherry-pick applied without conflicts and the changed lines are identical to upstream.

Dependencies and merge order

Verification

Local run of the same commands as CI's “Go Build & Test” job (server tests with -race), on this branch and on master fda24ca5 under the same conditions (same machine, run one after another):

Check master fda24ca5 this branch verdict
xss-gate-diff PASS PASS
channel-lib-test PASS PASS
decrypt-cli-build-test PASS PASS
dockerfile-copy-invariants FAIL FAIL not runnable locally: script needs bash ≥4 (declare -A), macOS has 3.2; identical on master
staging-disk-monitor PASS PASS
css-vars-lint PASS PASS
JS unit tests from CI list + AGENTS.md set (67 files) see below 63 PASS, 4 FAIL
test-issue-1375-scope-stats-fetch.js FAIL FAIL Exactly one api('/scope-stats' call exists (the fixed loader) — found 2 baseline failure, unchanged
test-issue-1648-m4-emoji-scan.js FAIL FAIL map.js has 1 emoji/misc-icon hit(s): baseline failure, unchanged
test-a11y-axe-routes-coverage.js FAIL FAIL axe ROUTES missing analytics tabs (issue #1706): areas, foreign-traffic, wardriving baseline failure, unchanged
test-frontend-helpers.js FAIL FAIL favStar returns empty star for non-favorite: The expression evaluated to a falsy value:, favStar returns filled star for favorite: The expression evaluated to a falsy value: baseline failure, unchanged

Baseline failures (fail identically on master; not introduced or changed here): see rows marked baseline failure, unchanged.

Browser validation (local, fixture DB, no staging/production): Local Go server (built from master) on the committed E2E fixture DB (freshened, migrated and seeded exactly like CI), serving this branch's public/, compared side by side with the same server serving master's public/. Analytics → Hash Issues, clicked the 2-byte selector, then dispatched theme-refresh. master: URL stays #/analytics?tab=collisions, section links carry no bytes, and after the refresh the view is back to "1-Byte Hash Usage Matrix". this branch: URL becomes …&bytes=2, the three section links carry bytes=2, after the refresh the 2-byte button is still active ("2-Byte Hash Usage Matrix"), and a direct deep link #/analytics?tab=collisions&bytes=3 opens with the 3-byte view selected.

Not run:

  • The E2E assertions this PR adds/extends in test-issue-1306-collisions-terminology-e2e.js (Playwright) have not run anywhere for this fork.
  • Playwright E2E suites (no local Playwright install); CI's E2E job will also be skipped, see below.
  • eslint (not installed locally; CI installs it on the fly).
  • Go -race/tests for modules this PR does not touch (unchanged code, identical to master).
  • Browser tests against staging/production (deliberately none).

Expected GitHub CI: “Go Build & Test” is expected to fail on TestPruneOldNeighborMetrics, which already fails on master (see #25's run). Downstream jobs (Playwright, image build) are therefore skipped. “Deploy Staging” and all GHCR publish steps only run on push to master and cannot run for this PR.
Two further ingestor tests have failed intermittently in this split's CI on branches whose cmd/ingestor tree is byte-identical to master (#27, #28), so they can also appear here without being caused by this change:

GitHub CI result: run 34751735213 on 1a5df04a. Go Build & Test: failure; all downstream jobs incl. Deploy Staging skipped. Failed tests:

  • TestPruneOldNeighborMetrics: fails on master, documented baseline

🤖 Generated with Claude Code

n30nex and others added 3 commits September 13, 2026 10:43
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 Kpa-clawbot#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 (Kpa-clawbot#1110); full-suite
success is not established.

## Preflight overrides

- The external `run-all.sh` is absent. Corresponding scope, PII, syntax,
whitespace and CSS checks passed; no SQL, migration or image changes
require those gates.
- Red browser evidence is local. Upstream CI execution remains a
separate approval gate, as discussed in Kpa-clawbot#1922.

(cherry picked from commit eb1d733)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Brings the branch up to master dbdf1c0 (post #54, #27) so CI runs on current master.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Independent review flagged that the URL sync ran first inside
refreshHashViews, ahead of the button states, titles and both render calls,
so a throwing history.replaceState (Safari throttles it; it is unavailable on
an opaque origin) would take the whole tab down rather than just the URL
update.

I could not reproduce that outcome: with a stub that throws for every
'bytes=' URL, both the old and the new ordering render the tab fully with
zero page errors, because the existing 'newHash !== location.hash' guard
means the deep-link path never calls replaceState at all. So this is not a
fix for an observed break — it is the ordering the code should have had
either way: the rendered views are the feature, the URL sync is a
convenience, and nothing in the render path depends on it. Extracted into
syncHashUrl() and called last, with the reasoning in a comment.

No test is added: a test asserting a behavioural difference here would be
asserting one I could not demonstrate. The existing 23 assertions still pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dborup
dborup merged commit 637a4ee into master Sep 20, 2026
6 checks passed
dborup pushed a commit that referenced this pull request Sep 20, 2026
Brings the branch up to master 9f3625e (post #44, which also touched
public/analytics.js in a different region) so CI runs on current master.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

3 participants