Keep the settings rail alive across child navigation
All checks were successful
CI / backend (push) Successful in 1m13s
CI / naming (push) Successful in 2s
CI / frontend (push) Successful in 8s

Keying the outer router-view on route.path made every settings click
remount the whole settings shell, resetting the rail scroll to the
top. The key now treats /settings/* as one unit so the shell (and its
scroll position) persists while child pages swap; detail-to-detail
remounts elsewhere are unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-07-12 07:56:39 -04:00
parent 9fc5aca63b
commit 31f5e07294

View File

@@ -77,15 +77,16 @@
</div>
<!-- Keyed on path so same-component navigation (machine -> machine via
a relationship link) remounts and reloads; query-only changes
(e.g. /reports?report=x) do not remount. -->
<router-view :key="route.path" />
(e.g. /reports?report=x) do not remount, and the settings shell
keys as one unit so its rail survives child navigation. -->
<router-view :key="routeViewKey" />
</main>
<ToastHost />
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, computed, onMounted } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import ToastHost from '../components/ToastHost.vue'
import {
@@ -100,6 +101,9 @@ import { getFacilityName, getSiteLogo, getServicenowUrls } from '../utils/siteSe
const router = useRouter()
const route = useRoute()
const authStore = useAuthStore()
const routeViewKey = computed(() =>
route.path.startsWith('/settings') ? '/settings' : route.path
)
const searchQuery = ref('')
const navItems = ref([])
const activeNotifications = ref([])