Skip to content

fix(routing): ask the path whether this is a content page, not the whole URL - #186

Merged
adamjohnwright merged 1 commit into
mainfrom
fix/content-route-guard
Sep 9, 2026
Merged

fix(routing): ask the path whether this is a content page, not the whole URL#186
adamjohnwright merged 1 commit into
mainfrom
fix/content-route-guard

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Finding 3 of the adversarial review of #184/#181. Findings 1 and 2 went in with #185; this one was pushed to that branch after it had already auto-merged, so it never reached main. Same commit, its own PR.

Both effects that write pathway browser state into the URL stood down like this:

if (this.router.url.includes('content') || this.router.url.includes('query')) return;

The query string answers that as readily as the path does. sample holds a column name taken verbatim from the reader's own expression file, and analysis.service.ts:520 sets it automatically to the first column — so an expression file whose first column is called "GC content" puts ?sample=GC__content in the URL, and from that moment nothing the reader did was written to the URL again. Not selecting a node, not flagging, not changing tab. None of it survived a reload, and none of it was in any link they shared.

Now one exported predicate testing whole segments of the path only. "query" is gone rather than fixed: the search page is content/query, already covered by the content test, and of the two words it is the likelier to turn up in somebody's data.

Verified

  • e2e/content-page-urls.spec.ts (new) — the three content pages keep their own addresses, which is what the guard is actually for and had no coverage at all; and the pathway browser still writes its URL under ?sample=GC__content.
  • Confirmed to be a regression test rather than a description by putting the substring guard back and rebuilding: that case fails on it, passes on this.
  • 6 unit cases on isContentRoute, including the four URLs the old guard got wrong.
  • check:types, format:check, lint clean; 14 tests in url-state.service.spec.ts.

🤖 Generated with Claude Code

…ole URL

Both effects that write pathway browser state into the URL stood down
with `router.url.includes('content') || router.url.includes('query')`.
The query string answers that as readily as the path does.

`sample` holds a column name taken verbatim from the reader's own
expression file, and analysis.service.ts sets it automatically to the
first column. So an expression file whose first column is called
"GC content" puts `?sample=GC__content` in the URL -- and from that
moment nothing the reader did was written to the URL again. Not
selecting a node, not flagging, not changing tab. None of it survived a
reload, and none of it was in any link they shared.

Now one exported predicate, testing whole segments of the path only.
"query" is gone rather than fixed: the search page is `content/query`,
already covered by the first test, and of the two words it is the
likelier to turn up in somebody's data.

Verified by putting the substring test back: the new e2e case fails on
it and passes on this, so it is a regression test rather than a
description. The three content pages keep their own addresses either
way, which is what the guard is actually for and had no coverage at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright enabled auto-merge (squash) September 9, 2026 19:46
@adamjohnwright
adamjohnwright merged commit eda9f58 into main Sep 9, 2026
6 checks passed
@adamjohnwright
adamjohnwright deleted the fix/content-route-guard branch September 9, 2026 19:52
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