feat: unified chapter picker overlay + currently reading quick-switch modal on reader
All checks were successful
Release / Test backend (push) Successful in 47s
Release / Check ui (push) Successful in 1m41s
Release / Docker (push) Successful in 5m40s
Release / Gitea Release (push) Successful in 21s

This commit is contained in:
root
2026-04-12 17:42:45 +05:00
parent 44f81bbf5c
commit 48d0ae63bf
4 changed files with 233 additions and 22 deletions

View File

@@ -5,6 +5,7 @@
import { page } from '$app/state';
import AudioPlayer from '$lib/components/AudioPlayer.svelte';
import CommentsSection from '$lib/components/CommentsSection.svelte';
import CurrentlyReadingModal from '$lib/components/CurrentlyReadingModal.svelte';
import type { PageData } from './$types';
import * as m from '$lib/paraglide/messages.js';
import { audioStore } from '$lib/audio.svelte';
@@ -22,6 +23,9 @@
let settingsPanelOpen = $state(false);
let settingsTab = $state<'reading' | 'listening'>('reading');
// ── Currently reading modal ───────────────────────────────────────────────
let readingModalOpen = $state(false);
const READER_FONTS = [
{ id: 'system', label: 'System' },
{ id: 'serif', label: 'Serif' },
@@ -517,6 +521,18 @@
<!-- Chapter heading + meta + language switcher -->
<div class="mb-6">
<!-- Book title — tappable, opens Currently Reading modal -->
<button
type="button"
onclick={() => (readingModalOpen = true)}
class="flex items-center gap-1 text-(--color-muted) hover:text-(--color-brand) text-sm font-medium transition-colors mb-1.5 max-w-full"
title="Switch book"
>
<span class="truncate">{data.book.title}</span>
<svg class="w-3.5 h-3.5 shrink-0 opacity-60" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
</svg>
</button>
<p class="text-xs font-semibold text-(--color-brand) uppercase tracking-widest mb-1.5">
{m.reader_chapter_n({ n: String(data.chapter.number) })}
</p>
@@ -1315,3 +1331,11 @@
</div>
{/if}
{/if}
<!-- Currently Reading modal -->
{#if readingModalOpen}
<CurrentlyReadingModal
currentSlug={data.book.slug}
onclose={() => (readingModalOpen = false)}
/>
{/if}