fix(viewer): drop the EntityRef-keyed selection half in clearAllModels too - #3372
fix(viewer): drop the EntityRef-keyed selection half in clearAllModels too#3372BIMvoice wants to merge 1 commit into
Conversation
…s too (#3348) The `all-models-cleared` teardown scope cleared only the global-id half of selection (`selectedEntityId`/`selectedEntityIds`/`selectedStoreys`); the EntityRef-keyed half (`selectedEntity`/`selectedEntities`/ `selectedEntitiesSet`/`selectedModelId`/`activeStorey`) survived pointing at models `clearAllModels()` had just removed. `resetViewerState()` clears both halves, so the asymmetry only surfaced on the georeference-reload path that calls `clearAllModels()` without it. Since every model is gone in this scope there is no surviving sibling to preserve a selection for, so both halves now clear unconditionally. Claude-Session: https://claude.ai/code/session_01QPHChk3Ve9N519A4kY7436
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00. Or wait 34 minutes for your next included review. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Comment |
Viewer benchmark✅ No threshold regressions detected. 01_Snowdon_Towers_Sample_Structural(1).ifcBaseline recorded 2026-07-01T20:31:05.538Z on github-actions ubuntu-latest, viewer-benchmark-ci (headless Chrome, SwiftShader ANGLE), production build.
AC20-FZK-Haus.ifcBaseline recorded 2026-07-01T20:30:59.972Z on github-actions ubuntu-latest, viewer-benchmark-ci (headless Chrome, SwiftShader ANGLE), production build.
Refresh the baseline from a CI run: dispatch the Benchmark workflow with |
Summary
clearAllModels()'sall-models-clearedteardown scope cleared only the global-id half of selection state (selectedEntityId/selectedEntityIds/selectedStoreys). TheEntityRef-keyed half (selectedEntity/selectedEntities/selectedEntitiesSet/selectedModelId/activeStorey) survived, still naming modelsclearAllModels()had just removed.resetViewerState()already clears both halves, so the asymmetry only showed on a path that callsclearAllModels()without it —GeoreferencingPanel.tsx'sreloadModelsForAlignment, which reloads models afterclearAllModels()alone.clearAllModelsremoves every model, there is no surviving federated sibling to preserve a selection for (unlike the single-modelmodel-removedscope, which filters bymodelId), so theall-models-clearedarm now clears both halves unconditionally — same shapesession-resetalready used for this slice.PINNED_ALL_MODELS_CLEARED_KEYSinteardown-registry.test.tsto include the five newly-emitted keys.Refs #3348.
Test plan
apps/viewer/src/store/clearAllModels-selection-stale.test.ts— new test, confirmed RED against the pre-fix arm (selectedEntity/selectedEntities/selectedEntitiesSet/selectedModelId/activeStorey all survivedclearAllModels()), GREEN after the fix.teardown-registry.test.ts,selectionSlice.test.ts,clearAllModels-overlay-stale.test.ts,removeModel-*.test.ts,resetViewerState.*.test.ts,teardown.idempotence.test.ts,*.solid-teardown.test.ts— 88/88 passing.tsc --noEmitclean forapps/viewer.node scripts/check-module-size.mjsexits 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01QPHChk3Ve9N519A4kY7436