Repository navigation
fix(diagram): keep the reader's selection when opening a pathway from inside it - #236
Merged
Merged
Conversation
… inside it Reported by a curator: "a searched entity is inselected if you try to navigate to a new pathway within the diagram" (#168). Reproduced, and it is not the flag -- that survives and redraws: before /PathwayBrowser/R-HSA-70326?select=R-HSA-70171&flag=PKM 6 flagged after /PathwayBrowser/R-HSA-9856872?select=R-HSA-70326&flag=PKM 2 flagged `select` went from what the reader had chosen to the pathway they were leaving. The handler did that on purpose, to orient them in the diagram they arrived in -- and the sibling handler for `.SUB.Pathway` did not, so the two ways out of a diagram disagreed and only one of them told you. Where you came from is still one Back away. What you were looking at was not recoverable at all, which is the asymmetry that settles it. Asserted on the address rather than the handler, because `select` in the URL is what survives a reload and what a curator can share. Proven to discriminate: without the fix: Expected "R-HSA-70171", received "R-HSA-70326" with the fix: passes The second half of #168 -- analysis reports not being emailed -- is untouched and has no reproduction yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…hout one
My own review of this change found the pattern I have been criticising all day in
the test I had just written:
if (!target) { test.skip(true, 'no pathway box to open'); return; }
The recordings make this deterministic, so that branch should be unreachable. If
it ever fires it means the fixture changed underneath us -- and the test would
report green while checking nothing, which is exactly the failure mode this suite
keeps turning up elsewhere.
Asserted instead, so a missing pathway box is a red test with a sentence
explaining it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 18, 2026
adamjohnwright
added a commit
that referenced
this pull request
Sep 18, 2026
…#245) `playwright.config.ts` had `reuseExistingServer: !process.env['CI']`, and this host always has `serve-prod.js` on :4200 serving beta out of `dist/`. So a local run tested the last deployed build rather than the commit about to be pushed. It showed up as `diagram-behaviour.spec.ts:48` failing on a clean `main` while CI was green on the same commit. The served build predated the fix that test asserts by eight hours: dist/reactome/browser/index.html 2026-09-17 13:14:18 b11c0e3 (#236, the fix asserted) 2026-09-17 21:43:58 Today's failure direction was harmless -- red on good code -- and it cost a `--no-verify` push on a branch that was fine. The same mechanism passes on a tree that is broken, which is the direction that matters. E2E_PORT now asks for a server of our own. Preflight sets 4201, so it builds and serves the tree under test while beta keeps 4200. A distinct port rather than `reuseExistingServer: false`, because that aborts on "port already in use" and would mean stopping beta before every push. Measured, same two specs, same commit: reusing :4200 (beta's build) 1 failed, 21 passed own server on :4201 17 passed, 5 skipped, exit 0 The five new skips are the point rather than a loss. They are the render-service tests, which skip with a reason when `/RenderService/health` does not answer -- so `RENDER_TARGET=127.0.0.1:1` had been silently ineffective all along. The reused server proxied to this box's real render service, so the local smoke exercised the *present*-service path while its own comment said it existed to reproduce CI's absent one. It now reproduces it, and matches CI, which has no render service either. Interactive runs keep the reuse: one `ng serve` with hot reload and many test runs is the right trade while developing. It is only the gate that must not. Refs #243 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.
Reported by a curator on #168: "a searched entity is inselected if you try to
navigate to a new pathway within the diagram."
It is not the flag
Reproduced first, because the issue said both halves needed one. The flag works —
it survives and redraws against the new diagram:
What does not survive is
select: it goes fromR-HSA-70171, what the readerhad chosen, to
R-HSA-70326, the pathway they were leaving. A search leaves anentity selected, so that is precisely the curator's report.
Why it did that
diagram.component.ts:843set it deliberately, to orient the reader in thediagram they arrived in:
The sibling handler for
.SUB.Pathwayuses'preserve'and touches nothing. Sothe two ways out of a diagram disagreed, and only one of them discarded your work.
Why preserving wins
Where you came from is still one Back away. What you were looking at was not
recoverable at all. That asymmetry is the whole argument — and it also makes the
two navigation handlers behave the same, which is worth something on its own.
Proven to discriminate
Asserted on the address rather than on the handler, because
selectin the URL iswhat survives a reload and what a curator can paste to a colleague.
Gates green:
check:types,check:lint(652, unchanged),check:dead(145,unchanged),
format:check.diagram-behaviour.spec.tsre-recorded — 5 passed.Refs #168. The second half of that issue — analysis reports not being emailed —
is untouched, and I do not yet know whether delivery is this repo's job or the
analysis service's.
🤖 Generated with Claude Code