From e3548c3bb40e1dfd6b9f3425b62e0aa1fe2656b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bult=C3=A9?= Date: Wed, 29 Jul 2026 12:17:57 +0200 Subject: [PATCH 01/24] fix: stop stuck top loading bar on admin dataset pages NuxtPage's page-key was bound to an inline arrow function (`route => route.fullPath`) in two admin layouts. Vue recreates that function on every render of the owning component, and NuxtPage compares page-key by reference (not by the value it computes) to decide whether to fire the page-loading indicator. A fresh reference for the same route is treated as "the page changed", firing page:loading:start with no matching navigation to ever complete it, so the top loading bar gets stuck. This went unnoticed because nothing previously triggered it: it only fires when the owning component re-renders while mounted, e.g. when pages/admin/datasets/[id].vue's own `dataset` (fetched via the same useAPI call/URL/options as a nested tab's own dataset fetch, and therefore sharing the same Nuxt useFetch cache key) gets refreshed by that nested tab. Fix: bind page-key to a stable, hoisted function instead of an inline one in pages/admin.vue and pages/admin/datasets/[id].vue. --- pages/admin.vue | 9 ++++++++- pages/admin/datasets/[id].vue | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pages/admin.vue b/pages/admin.vue index 70e150617..11be0fc78 100644 --- a/pages/admin.vue +++ b/pages/admin.vue @@ -44,7 +44,7 @@
@@ -54,6 +54,7 @@ import { Disclosure, DisclosureButton, DisclosurePanel } from '@headlessui/vue' import AdminSidebarMenu from '~/components/AdminSidebar/AdminSidebarMenu/AdminSidebarMenu.vue' import type { OrganizationReference } from '@datagouv/components-next' +import type { RouteLocationNormalizedLoaded } from 'vue-router' definePageMeta({ layout: 'fluid', @@ -78,6 +79,12 @@ useSeoMeta({ title: 'Admin' }) const { organizations, users } = useCurrentOwned() const isSiteAdmin = computed(() => me.value.roles?.includes('admin') || false) + +// Stable reference: NuxtPage compares page-key by reference, so an inline function here +// would re-trigger the loading indicator on every render of this component. +function pageKey(route: RouteLocationNormalizedLoaded) { + return route.fullPath +}