fix(explore): preserve shape size across projection reloads - #407
fix(explore): preserve shape size across projection reloads#407FlorinSenoner wants to merge 7 commits into
Conversation
Automated reviewDoes it solve #340? Yes. I confirmed the failing path is the one this PR targets: the dataset hash is built from sorted protein IDs plus annotation and prediction fingerprints and contains nothing projection-derived, and Found 2 issues:
protspace/apps/web/src/explore/dataset-controller.ts Lines 134 to 138 in a94ffae
protspace/packages/core/src/controllers/base-persistence-controller.ts Lines 96 to 100 in a94ffae 🤖 Generated with Claude Code |
|
Independent triage at
|
|
Implemented the actionable follow-up in Verification: focused Vitest suites 38/38 passed; full |
- Move getShapeSizeState/setShapeSize into apps/web/tests/helpers/explore.ts and drop the duplicate local copies from dataset-reload.spec.ts and url-view-state.spec.ts. - Replace the inlined open-settings/fill/save sequence in the url-view-state shape-size test with the shared setShapeSize helper, which also adds the poll-until-applied wait that inline block was missing. - Extract the duplicated shape-size expectation in url-view-state.spec.ts into a named SHAPE_SIZE_TO_POINT_SIZE constant with a comment pointing at calculatePointSize()/LEGEND_DEFAULTS.symbolSizeMultiplier. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qoU16kDQxz6U3H2UWbbm2
The comment claimed to mirror calculatePointSize() without noting that the helper also clamps with Math.max(10, ...), and pointed at "the note above waitForView" when that note lives inside it. State the clamp divergence and the range where the plain multiply is equivalent, and drop the misdirected cross-reference. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qoU16kDQxz6U3H2UWbbm2
Adversarial reviewReviewed in an isolated worktree by three independent lenses (code quality, adversarial correctness, issue-resolution audit), with every finding then put through a refuter whose default position was that it is a false positive. 9 raised, 4 survived refutation. Applied and pushed (
|
|
Follow-up for the adversarial review at
Verification on the pushed commit:
No thread was resolved and no PR state/metadata was changed. |
Root cause
Automatic demo-dataset loads used the same replacement semantics as an explicit reset. On reload or a direct projection URL, the fresh explore controller first cleared the dataset-scoped legend record and then applied embedded demo bundle settings with replacement semantics, overwriting a saved Shape size with 30.
Fix
Reproduction
Before this change, Shape size returned to 30 and effective point size returned to 240. After this change, Shape size remains 42 and effective point size remains 336 across both paths. Explicit reset-to-demo still restores the captured demo defaults.
Tests
pnpm exec vitest run apps/web/src/explore/dataset-controller.eat.test.ts packages/core/src/components/legend/controllers/persistence-controller.test.ts— 38 passed.pnpm test:ci— 1,873 passed, 1 skipped.pnpm precommit— passed before commit and push.openspec validate preserve-shape-size-across-projection-navigation --strict— passed.Closes #340