feat(navigation) : preserve list state in URL and use browser history for back buttons

Add useUrlState composable to sync page, search, sort and filter state
with URL query params. Back/forward navigation now restores the exact
list position. Replace hardcoded NuxtLink back buttons with
router.back() across all create/edit pages. Fix documents attachment
filter that checked non-existent ID fields instead of relation objects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-02-11 16:48:40 +01:00
parent 185af65519
commit 480aaa24b2
18 changed files with 228 additions and 77 deletions

View File

@@ -19,9 +19,9 @@
</p>
</div>
</div>
<NuxtLink to="/component-catalog" class="btn btn-primary mt-6">
<button type="button" class="btn btn-primary mt-6" @click="$router.back()">
Retour au catalogue
</NuxtLink>
</button>
</div>
<section v-else class="card border border-base-200 bg-base-100 shadow-sm max-w-5xl mx-auto">
@@ -33,9 +33,9 @@
Mettez à jour les informations du composant et ses champs personnalisés.
</p>
</div>
<NuxtLink to="/component-catalog" class="btn btn-ghost btn-sm md:btn-md self-start">
<button type="button" class="btn btn-ghost btn-sm md:btn-md self-start" @click="$router.back()">
Retour au catalogue
</NuxtLink>
</button>
</header>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">

View File

@@ -7,9 +7,9 @@
Sélectionnez la catégorie cible puis complétez les informations du composant.
</p>
</div>
<NuxtLink to="/component-catalog" class="btn btn-ghost btn-sm md:btn-md self-start">
<button type="button" class="btn btn-ghost btn-sm md:btn-md self-start" @click="$router.back()">
Retour au catalogue
</NuxtLink>
</button>
</header>
<section class="card border border-base-200 bg-base-100 shadow-sm">