From 83489361226507e86a177be91c8dff7ff17b8f10 Mon Sep 17 00:00:00 2001 From: Gitea OpenCode Agent Date: Wed, 14 Oct 2026 22:30:17 +0000 Subject: [PATCH] Fix issue #41: Clicking button of actors on sidebar not change map or notes --- .../components/partials/ContentSidebar.vue | 8 +- tests/sidebar-section-pane.test.js | 114 ++++++++++++++++++ 2 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 tests/sidebar-section-pane.test.js diff --git a/frontend/app/components/partials/ContentSidebar.vue b/frontend/app/components/partials/ContentSidebar.vue index 94f72b28..e6b5dd10 100644 --- a/frontend/app/components/partials/ContentSidebar.vue +++ b/frontend/app/components/partials/ContentSidebar.vue @@ -219,9 +219,11 @@ async function fetchCampaignEntries(entityType = activeSection.value, silent = f function selectSection(section) { activeSection.value = section; if (isEntrySection(section)) fetchCampaignEntries(section); - // The content area follows the sidebar: maps shows the anchored map, everything else the - // notes that are currently open. - SetActivePane(section === 'maps' && AnchoredMap.value ? 'map' : 'notes'); + // Only the notes and maps buttons say something about the note container: they switch it between + // the notes that are open and the anchored map. Actors and items open windows of their own, so + // their buttons leave whatever the note container was showing untouched. + if (section === 'notes') SetActivePane('notes'); + else if (section === 'maps' && AnchoredMap.value) SetActivePane('map'); } function createEntry(entityType) { diff --git a/tests/sidebar-section-pane.test.js b/tests/sidebar-section-pane.test.js new file mode 100644 index 00000000..24b74d31 --- /dev/null +++ b/tests/sidebar-section-pane.test.js @@ -0,0 +1,114 @@ +// Tests for the sidebar section buttons of Syndria98/dragonroll#41: clicking the actors or the items +// button must not change what the note container shows — an anchored map stays on the screen and the +// notes that were open stay open — while the notes and maps buttons keep switching the note container +// between those two, the way they have since #15. +// +// The repository root installs no dependencies, so `selectSection` is lifted out of the sidebar's +// `