fix: Pane visibility settings will be persisted locally (#2888)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { EditorFontSize, EditorLineHeight, EditorLineWidth } from '@standardnotes/models'
|
||||
import { NativeFeatureIdentifier } from '@standardnotes/features'
|
||||
|
||||
export enum LocalPrefKey {
|
||||
ListPaneCollapsed = 'listPaneCollapsed',
|
||||
NavigationPaneCollapsed = 'navigationPaneCollapsed',
|
||||
ActiveThemes = 'activeThemes',
|
||||
UseSystemColorScheme = 'useSystemColorScheme',
|
||||
UseTranslucentUI = 'useTranslucentUI',
|
||||
@@ -14,6 +17,8 @@ export enum LocalPrefKey {
|
||||
}
|
||||
|
||||
export type LocalPrefValue = {
|
||||
[LocalPrefKey.ListPaneCollapsed]: boolean
|
||||
[LocalPrefKey.NavigationPaneCollapsed]: boolean
|
||||
[LocalPrefKey.ActiveThemes]: string[]
|
||||
[LocalPrefKey.UseSystemColorScheme]: boolean
|
||||
[LocalPrefKey.UseTranslucentUI]: boolean
|
||||
@@ -25,3 +30,20 @@ export type LocalPrefValue = {
|
||||
[LocalPrefKey.EditorLineWidth]: EditorLineWidth
|
||||
[LocalPrefKey.EditorFontSize]: EditorFontSize
|
||||
}
|
||||
|
||||
export const LocalPrefDefaults = {
|
||||
[LocalPrefKey.ListPaneCollapsed]: false,
|
||||
[LocalPrefKey.NavigationPaneCollapsed]: false,
|
||||
[LocalPrefKey.ActiveThemes]: [],
|
||||
[LocalPrefKey.UseSystemColorScheme]: false,
|
||||
[LocalPrefKey.UseTranslucentUI]: true,
|
||||
[LocalPrefKey.AutoLightThemeIdentifier]: 'Default',
|
||||
[LocalPrefKey.AutoDarkThemeIdentifier]: NativeFeatureIdentifier.TYPES.DarkTheme,
|
||||
|
||||
[LocalPrefKey.EditorMonospaceEnabled]: false,
|
||||
[LocalPrefKey.EditorLineHeight]: EditorLineHeight.Normal,
|
||||
[LocalPrefKey.EditorLineWidth]: EditorLineWidth.FullWidth,
|
||||
[LocalPrefKey.EditorFontSize]: EditorFontSize.Normal,
|
||||
} satisfies {
|
||||
[key in LocalPrefKey]: LocalPrefValue[key]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user