feat: show manga covers everywhere a manga is referenced

Every place that surfaced a manga title used to show *just* the
title — the home page, the reader's back-to-manga link, and the
chapter upload form's manga selector. Adding the cover image
alongside makes the app feel like an actual manga library.

- Home (`/`): manga list switched from a one-line `<a>` per item to
  a responsive grid of cards (`auto-fill, minmax(140px, 1fr)`),
  each card showing the cover (with 📖 placeholder when no cover is
  set), the title (line-clamped to 2 rows), and the author.
- Reader (`/manga/[id]/chapter/[n]`): the back-to-manga link in the
  reader header now shows a 28×42 thumbnail of the manga's cover next
  to the title. Reuses the placeholder pattern for cover-less mangas.
- Upload (`/upload`): the chapter form's manga `<select>` still uses
  a native dropdown (covers don't fit in `<option>`), but a preview
  pane below the select now shows the currently-selected manga's
  cover + title + author so the user can visually confirm which
  manga they're attaching the chapter to.

No backend changes — `cover_image_path` was already in the Manga
JSON; only the frontend needed to read it.

Lockstep version bump to 0.12.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-05-17 10:52:57 +02:00
parent dee7f1d160
commit f0e57b0615
5 changed files with 177 additions and 9 deletions

View File

@@ -70,7 +70,19 @@
</svelte:head>
<nav class="reader-nav" aria-label="reader">
<a href="/manga/{manga.id}" data-testid="back-to-manga">{manga.title}</a>
<a href="/manga/{manga.id}" class="back" data-testid="back-to-manga">
{#if manga.cover_image_path}
<img
src={fileUrl(manga.cover_image_path)}
alt=""
class="back-cover"
loading="lazy"
/>
{:else}
<span class="back-cover back-cover-placeholder" aria-hidden="true">📖</span>
{/if}
<span class="back-text">{manga.title}</span>
</a>
<span class="indicator" data-testid="page-indicator">
Page {index + 1} / {pages.length}
</span>
@@ -133,9 +145,37 @@
padding-bottom: 0.5rem;
border-bottom: 1px solid #eee;
margin-bottom: 0.75rem;
gap: 0.75rem;
}
.back {
display: flex;
align-items: center;
gap: 0.5rem;
min-width: 0;
}
.back-cover {
width: 28px;
height: 42px;
object-fit: cover;
border-radius: 3px;
background: #f0f0f0;
flex-shrink: 0;
}
.back-cover-placeholder {
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 1rem;
color: #999;
}
.back-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.indicator {
color: #555;
flex-shrink: 0;
}
.page-wrap {
display: grid;