fix: surface reader load failures instead of spinning forever
The PDF reader pointed an iframe at the vendored pdf.js viewer and had no way to report a failure: the viewer renders its own errors inside the frame, so a missing or unreadable file showed an empty grey panel. Probe the file with a request first and render an error card with a retry when that fails, matching the chrome the EPUB reader uses. Add the missing +page.ts for the PDF route so the tab gets the book title rather than a bare "Reader". Drop chapter-sidebar.svelte and its import. It rendered a list of chapters whose buttons had no click handler, and read/+layout@.svelte imported it without ever rendering it. The reader's own sidebar replaces it.
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
<script>
|
||||
import * as Sidebar from '$lib/components/ui/sidebar/index';
|
||||
|
||||
let { chapters } = $props();
|
||||
</script>
|
||||
|
||||
<Sidebar.Root>
|
||||
<Sidebar.Header />
|
||||
<Sidebar.Content>
|
||||
<Sidebar.GroupLabel>Chapters</Sidebar.GroupLabel>
|
||||
<Sidebar.GroupContent>
|
||||
<Sidebar.Menu>
|
||||
{#each chapters as chapter}
|
||||
<Sidebar.MenuItem>
|
||||
<Sidebar.MenuButton>
|
||||
{#snippet child({ props })}
|
||||
<span>{chapter.label}</span>
|
||||
{/snippet}
|
||||
</Sidebar.MenuButton>
|
||||
</Sidebar.MenuItem>
|
||||
{/each}
|
||||
</Sidebar.Menu>
|
||||
</Sidebar.GroupContent>
|
||||
<Sidebar.Group />
|
||||
</Sidebar.Content>
|
||||
<Sidebar.Footer />
|
||||
</Sidebar.Root>
|
||||
Reference in New Issue
Block a user