fix: Pane visibility settings will be persisted locally (#2888)

This commit is contained in:
luis-411
2024-11-22 10:59:21 +01:00
committed by GitHub
parent d3ce536c1a
commit f1796312de
3 changed files with 76 additions and 15 deletions

View File

@@ -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]
}