fix(routing): ask the path whether this is a content page, not the whole URL - #186
Merged
Conversation
…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>
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.
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:
The query string answers that as readily as the path does.
sampleholds a column name taken verbatim from the reader's own expression file, andanalysis.service.ts:520sets it automatically to the first column — so an expression file whose first column is called "GC content" puts?sample=GC__contentin 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 iscontent/query, already covered by thecontenttest, 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.isContentRoute, including the four URLs the old guard got wrong.check:types,format:check, lint clean; 14 tests inurl-state.service.spec.ts.🤖 Generated with Claude Code