refactor: resolve() internal links instead of plain hrefs

Type-checks every link against the real route tree. Caught a dead one: the
book page linked tags to /tag/{id}, a route that has never existed.
This commit is contained in:
2026-08-12 11:08:09 -04:00
parent 51c31e6bf6
commit d6207b5743
19 changed files with 588 additions and 487 deletions
@@ -1,4 +1,5 @@
<script lang="ts">
import { resolve } from '$app/paths';
import * as Table from '$lib/components/ui/table/index.js';
import * as Card from '$lib/components/ui/card/index.js';
import { getLibraryState } from '$lib/state/library.svelte';
@@ -36,7 +37,10 @@
>{library.name[0]}</Table.Cell
>
<Table.Cell class="font-medium">
<a href={`/library/${library.id}`} class="hover:underline">{library.name}</a>
<a
href={resolve('/(root)/(library)/library/[libraryId]', { libraryId: String(library.id) })}
class="hover:underline">{library.name}</a
>
</Table.Cell>
<Table.Cell class="w-16 text-center">
<EllipsisVertical class="scale-75" />