fix(translation): reduce initial layout shift in the translation view, closes #3078 (#3428)

* fix(css): allow overriding the padding of the root html

* fix(translation): reduce initial layout shift in the translation view, closes #3078
This commit is contained in:
Huang Xin
2026-03-01 16:12:02 +08:00
committed by GitHub
parent e949476d27
commit 0d2e5b7c76
32 changed files with 198 additions and 67 deletions
+12
View File
@@ -51,6 +51,7 @@ interface ReaderStore {
setHoveredBookKey: (key: string | null) => void;
setBookmarkRibbonVisibility: (key: string, visible: boolean) => void;
setTTSEnabled: (key: string, enabled: boolean) => void;
setIsLoading: (key: string, loading: boolean) => void;
setIsSyncing: (key: string, syncing: boolean) => void;
setProgress: (
key: string,
@@ -393,6 +394,17 @@ export const useReaderStore = create<ReaderStore>((set, get) => ({
},
})),
setIsLoading: (key: string, loading: boolean) =>
set((state) => ({
viewStates: {
...state.viewStates,
[key]: {
...state.viewStates[key]!,
loading,
},
},
})),
setIsSyncing: (key: string, syncing: boolean) =>
set((state) => ({
viewStates: {