Fix legend visibility persistence, CATH-Gene3D splitting, and Feedback button styling#284
Merged
tsenoner merged 7 commits intoJun 17, 2026
Merged
Conversation
Switching annotations called clearPersistedLegendHiddenValues, which rewrote the previous annotation's legend localStorage entry to an empty hiddenValues array, so hidden categories reappeared on switch-back. The core legend already persists and restores hiddenValues per datasetHash + annotation, so remove the clearing call and its now-dead plumbing (the persisted-legend controller, its runtime wiring, and the lastKnownAnnotation tracking it required). The demo still resets on a full reload via the separate clearForNewDataset path, so it always returns to its original state. Closes #281 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Categorical annotation cells encode multiple hits as
"accession (name)|score" joined by ';', but a name can itself contain
';' (e.g. CATH-Gene3D "Ribosomal Protein L15; Chain: K; domain 2"). The
naive split(';') shattered a single hit into bogus categories such as
"domain 2)" and "Chain: K". Split only on ';' at parenthesis depth 0 so
each (name) stays intact, falling back to a plain split for the rare
name with an unbalanced '(' so distinct hits are not merged.
This repairs already-distributed bundles; sanitizing the names at the
source is tracked in tsenoner/protspace#56.
Closes #282
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Feedback button rendered with the shadcn default variant (solid bg-primary #3c83f6), a different and more prominent blue than the canonical ProtSpace #00a3e0 used in-canvas. Switch both the desktop and mobile call sites to a no-border ghost: transparent, #00a3e0 text/icon, faint blue hover. De-emphasized and consistent on the light and dark headers. Closes #283 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The top-level ; splitter only needs its per-char paren-depth scan when a cell contains a parenthesis. Most categorical columns (Kingdom/Organism/ Localization) never do, so short-circuit to a native split for them — behavior-identical since depth stays 0 throughout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The canonical brand blue #00a3e0 only reaches ~2.6:1 against the light Explore header (#f4f4f4), failing WCAG AA (4.5:1). Make the ghost CTA hue variant-aware: keep #00a3e0 on the dark header (~5.6:1) and use a darker #006d96 (~5.3:1) on the light variant. Both hues are literal class strings so Tailwinds source scan can generate them. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
230df7c to
21c9a75
Compare
Replace the per-character `for..of` + `current += ch` build in
splitOnTopLevelSemicolons with an index + slice scan: no per-char
allocation, no code-point decoding, byte-identical output (25 splitter
tests unchanged).
Also document the fallback's net-imbalance limitation — a stray '(' in
one hit cancelled by a stray ')' in a later hit leaves end-depth 0, so
the inter-hit ';' is swallowed and the two hits merge (subsumed by the
name-sanitization work in tsenoner/protspace#56) — and add a JSDoc block
to the now-exported splitCategoricalAnnotationValues.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The core legend owns per-annotation hidden categories (saveSettings/loadSettings + syncHiddenValues, keyed by datasetHash + annotation). The interaction controller's `hiddenValues` field and `handleLegendItemClick` only mutated write-only state that was never pushed to the plot, and `handleAnnotationChange` always pushed `[]` regardless of click history. Remove the field, the handler, and its now-dead `legend-item-click` listener; push `[]` directly and document why the core's async restore runs after this synchronous reset. Behaviour-identical — the legend hide/restore e2e tests still pass on Chromium, Firefox and WebKit. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Three independent bug fixes plus follow-up cleanup.
;(parenthesis-aware), so names containing;(e.g.…;domain 2)) stay intact instead of shattering into bogus categories.#00a3e0, de-emphasized on the light and dark headers.Cleanup (no behaviour change) — rewrote the top-level
;splitter as an index + slice scan (no per-char allocation or code-point decoding; output identical, splitter tests unchanged) and documented its net-imbalance fallback limitation; removed the dead app-side legendhiddenValues/handleLegendItemClicknow that the core legend owns hidden state.Backend follow-ups (separate repo): tsenoner/protspace#56 (
;at source), tsenoner/protspace#58 (|at source).Closes #281, #282, #283