Clicking button of actors on sidebar not change map or notes #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Make that when clicking the actors button on the sidebar, if there is a map anchored, make that it does not disappear. And if there are notes displaying, that they do not disappear. More generally, make that when clicking the actors or items buttons on the sidebar, the contents of the note-container do not change
Done. Here's what I found and changed.
Cause
selectSection()infrontend/app/components/partials/ContentSidebar.vue:219unconditionally wrote the content pane on every sidebar button click:So clicking actors or items always forced the pane to
notes: an anchored map was swapped out of view (Content.vuehides.anchored-mapwhenActivePane !== 'map'), and the note container was brought forward, which looked like the map/notes "disappearing".Fix
Only the buttons that actually speak about the note container change it — the notes button shows the open notes, the maps button shows the anchored map (the switching added in #15). The actor and item buttons just select their section and load their list; the note container keeps whatever it was showing:
No change was needed in
services/Content.js— the anchor itself was never dropped, only the visible pane.Tests
New
tests/sidebar-section-pane.test.js(8 tests) liftsselectSectionout of the sidebar's<script setup>block into anode:vmcontext withSetActivePane/ the entry fetch stubbed, in the same spirit astests/map-viewer.test.js. It covers: the actors and items buttons keep an anchored map visible and still anchored, keep the open notes visible, still select their section and load their list, plus the #15 behaviour — notes ↔ maps switching and the maps button doing nothing without an anchored map.Verified against the repo suite:
node --test tests/→ 116 tests, 116 pass, 0 fail. I also confirmed the two anchored-map tests fail against the previous implementation, so the new tests do catch the reported bug.Implementation is ready for review: #43