feat(w3): add continuous read mode and Wave 3 plan

Introduce ReadModeOverlay with device width and font theme persistence, sidebar and volume menu entry, plus E2E-READ-01 through 03.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-08 16:38:54 +08:00
parent fe6e411d2c
commit c10be87d18
13 changed files with 653 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
import { create } from 'zustand'
import type { GlobalSettings } from '@shared/types'
export type ReadDeviceWidth = NonNullable<GlobalSettings['readModeDeviceWidth']>
export type ReadFontTheme = NonNullable<GlobalSettings['readModeFontTheme']>
interface ReadModeState {
open: boolean
volumeId: string | null
chapterIndex: number
openForVolume: (volumeId: string, chapterIndex?: number) => void
close: () => void
setChapterIndex: (index: number) => void
}
export const useReadModeStore = create<ReadModeState>((set) => ({
open: false,
volumeId: null,
chapterIndex: 0,
openForVolume: (volumeId, chapterIndex = 0) =>
set({ open: true, volumeId, chapterIndex: Math.max(0, chapterIndex) }),
close: () => set({ open: false, volumeId: null, chapterIndex: 0 }),
setChapterIndex: (chapterIndex) => set({ chapterIndex: Math.max(0, chapterIndex) })
}))
+3
View File
@@ -32,6 +32,9 @@ export const useSettingsStore = create<SettingsState>((set, get) => ({
chapterTemplates: [],
submissionPresets: [],
defaultSubmissionPresetId: 'builtin-webnovel',
readModeFontTheme: 'serif',
readModeDeviceWidth: 'desktop',
enableFocusAmbientSound: false,
loaded: false,
load: async () => {
const data = await ipcCall(() => window.electronAPI.settings.get())