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:
@@ -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) })
|
||||
}))
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user