feat(web): add client-side routes for views
ci / web (push) Successful in 27s
ci / rust (push) Successful in 53s
e2e / e2e (push) Successful in 1m1s

Deep-link, refresh and back/forward now land on the view the operator
was on instead of the board. Vanilla History API (pushState/popstate),
no router dependency: /library, /queues, /movies/{id}/releases and
/search?q= all restore on load.

Closes #102
This commit is contained in:
Miguel Palhas
2026-08-23 08:24:36 +01:00
parent 1ce9f11e62
commit e36c73ca75
3 changed files with 179 additions and 10 deletions
+13
View File
@@ -64,6 +64,19 @@ export async function searchTitles(query: string, signal: AbortSignal): Promise<
}
}
/** A single movie by id — used to restore the release deck from a URL alone. */
export async function fetchMovie(movieId: number): Promise<LibraryMovie | null> {
try {
const response = await fetch(`/api/movies/${movieId}`);
if (!response.ok) {
return null;
}
return (await response.json()) as LibraryMovie;
} catch {
return null;
}
}
let rootsCache: Root[] | null = null;
/** Every root, fetched once. Audience chips resolve root ids through these. */