fix: unify theme system - fix theme switching persistence

- Unified localStorage key to 'theme-preference' across all components
- Fixed header.tsx using wrong localStorage key ('theme' instead of 'theme-preference')
- Added localStorage hybrid persistence for instant theme changes
- Removed router.refresh() which was causing stale data revert
- Replaced Blue theme with Sepia
- Consolidated auth() calls to prevent race conditions
- Updated UserSettingsData types to include all themes
This commit is contained in:
2026-01-18 22:33:41 +01:00
parent ef60dafd73
commit ddb67ba9e5
306 changed files with 59580 additions and 6063 deletions

View File

@@ -13530,6 +13530,9 @@ export namespace Prisma {
fontSize: string | null
demoMode: boolean | null
showRecentNotes: boolean | null
emailNotifications: boolean | null
desktopNotifications: boolean | null
anonymousAnalytics: boolean | null
}
export type UserAISettingsMaxAggregateOutputType = {
@@ -13544,6 +13547,9 @@ export namespace Prisma {
fontSize: string | null
demoMode: boolean | null
showRecentNotes: boolean | null
emailNotifications: boolean | null
desktopNotifications: boolean | null
anonymousAnalytics: boolean | null
}
export type UserAISettingsCountAggregateOutputType = {
@@ -13558,6 +13564,9 @@ export namespace Prisma {
fontSize: number
demoMode: number
showRecentNotes: number
emailNotifications: number
desktopNotifications: number
anonymousAnalytics: number
_all: number
}
@@ -13574,6 +13583,9 @@ export namespace Prisma {
fontSize?: true
demoMode?: true
showRecentNotes?: true
emailNotifications?: true
desktopNotifications?: true
anonymousAnalytics?: true
}
export type UserAISettingsMaxAggregateInputType = {
@@ -13588,6 +13600,9 @@ export namespace Prisma {
fontSize?: true
demoMode?: true
showRecentNotes?: true
emailNotifications?: true
desktopNotifications?: true
anonymousAnalytics?: true
}
export type UserAISettingsCountAggregateInputType = {
@@ -13602,6 +13617,9 @@ export namespace Prisma {
fontSize?: true
demoMode?: true
showRecentNotes?: true
emailNotifications?: true
desktopNotifications?: true
anonymousAnalytics?: true
_all?: true
}
@@ -13689,6 +13707,9 @@ export namespace Prisma {
fontSize: string
demoMode: boolean
showRecentNotes: boolean
emailNotifications: boolean
desktopNotifications: boolean
anonymousAnalytics: boolean
_count: UserAISettingsCountAggregateOutputType | null
_min: UserAISettingsMinAggregateOutputType | null
_max: UserAISettingsMaxAggregateOutputType | null
@@ -13720,6 +13741,9 @@ export namespace Prisma {
fontSize?: boolean
demoMode?: boolean
showRecentNotes?: boolean
emailNotifications?: boolean
desktopNotifications?: boolean
anonymousAnalytics?: boolean
user?: boolean | UserDefaultArgs<ExtArgs>
}, ExtArgs["result"]["userAISettings"]>
@@ -13735,6 +13759,9 @@ export namespace Prisma {
fontSize?: boolean
demoMode?: boolean
showRecentNotes?: boolean
emailNotifications?: boolean
desktopNotifications?: boolean
anonymousAnalytics?: boolean
user?: boolean | UserDefaultArgs<ExtArgs>
}, ExtArgs["result"]["userAISettings"]>
@@ -13750,6 +13777,9 @@ export namespace Prisma {
fontSize?: boolean
demoMode?: boolean
showRecentNotes?: boolean
emailNotifications?: boolean
desktopNotifications?: boolean
anonymousAnalytics?: boolean
}
export type UserAISettingsInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
@@ -13776,6 +13806,9 @@ export namespace Prisma {
fontSize: string
demoMode: boolean
showRecentNotes: boolean
emailNotifications: boolean
desktopNotifications: boolean
anonymousAnalytics: boolean
}, ExtArgs["result"]["userAISettings"]>
composites: {}
}
@@ -14181,6 +14214,9 @@ export namespace Prisma {
readonly fontSize: FieldRef<"UserAISettings", 'String'>
readonly demoMode: FieldRef<"UserAISettings", 'Boolean'>
readonly showRecentNotes: FieldRef<"UserAISettings", 'Boolean'>
readonly emailNotifications: FieldRef<"UserAISettings", 'Boolean'>
readonly desktopNotifications: FieldRef<"UserAISettings", 'Boolean'>
readonly anonymousAnalytics: FieldRef<"UserAISettings", 'Boolean'>
}
@@ -14708,7 +14744,10 @@ export namespace Prisma {
preferredLanguage: 'preferredLanguage',
fontSize: 'fontSize',
demoMode: 'demoMode',
showRecentNotes: 'showRecentNotes'
showRecentNotes: 'showRecentNotes',
emailNotifications: 'emailNotifications',
desktopNotifications: 'desktopNotifications',
anonymousAnalytics: 'anonymousAnalytics'
};
export type UserAISettingsScalarFieldEnum = (typeof UserAISettingsScalarFieldEnum)[keyof typeof UserAISettingsScalarFieldEnum]
@@ -15742,6 +15781,9 @@ export namespace Prisma {
fontSize?: StringFilter<"UserAISettings"> | string
demoMode?: BoolFilter<"UserAISettings"> | boolean
showRecentNotes?: BoolFilter<"UserAISettings"> | boolean
emailNotifications?: BoolFilter<"UserAISettings"> | boolean
desktopNotifications?: BoolFilter<"UserAISettings"> | boolean
anonymousAnalytics?: BoolFilter<"UserAISettings"> | boolean
user?: XOR<UserRelationFilter, UserWhereInput>
}
@@ -15757,6 +15799,9 @@ export namespace Prisma {
fontSize?: SortOrder
demoMode?: SortOrder
showRecentNotes?: SortOrder
emailNotifications?: SortOrder
desktopNotifications?: SortOrder
anonymousAnalytics?: SortOrder
user?: UserOrderByWithRelationInput
}
@@ -15775,6 +15820,9 @@ export namespace Prisma {
fontSize?: StringFilter<"UserAISettings"> | string
demoMode?: BoolFilter<"UserAISettings"> | boolean
showRecentNotes?: BoolFilter<"UserAISettings"> | boolean
emailNotifications?: BoolFilter<"UserAISettings"> | boolean
desktopNotifications?: BoolFilter<"UserAISettings"> | boolean
anonymousAnalytics?: BoolFilter<"UserAISettings"> | boolean
user?: XOR<UserRelationFilter, UserWhereInput>
}, "userId">
@@ -15790,6 +15838,9 @@ export namespace Prisma {
fontSize?: SortOrder
demoMode?: SortOrder
showRecentNotes?: SortOrder
emailNotifications?: SortOrder
desktopNotifications?: SortOrder
anonymousAnalytics?: SortOrder
_count?: UserAISettingsCountOrderByAggregateInput
_max?: UserAISettingsMaxOrderByAggregateInput
_min?: UserAISettingsMinOrderByAggregateInput
@@ -15810,6 +15861,9 @@ export namespace Prisma {
fontSize?: StringWithAggregatesFilter<"UserAISettings"> | string
demoMode?: BoolWithAggregatesFilter<"UserAISettings"> | boolean
showRecentNotes?: BoolWithAggregatesFilter<"UserAISettings"> | boolean
emailNotifications?: BoolWithAggregatesFilter<"UserAISettings"> | boolean
desktopNotifications?: BoolWithAggregatesFilter<"UserAISettings"> | boolean
anonymousAnalytics?: BoolWithAggregatesFilter<"UserAISettings"> | boolean
}
export type UserCreateInput = {
@@ -16874,6 +16928,9 @@ export namespace Prisma {
fontSize?: string
demoMode?: boolean
showRecentNotes?: boolean
emailNotifications?: boolean
desktopNotifications?: boolean
anonymousAnalytics?: boolean
user: UserCreateNestedOneWithoutAiSettingsInput
}
@@ -16889,6 +16946,9 @@ export namespace Prisma {
fontSize?: string
demoMode?: boolean
showRecentNotes?: boolean
emailNotifications?: boolean
desktopNotifications?: boolean
anonymousAnalytics?: boolean
}
export type UserAISettingsUpdateInput = {
@@ -16902,6 +16962,9 @@ export namespace Prisma {
fontSize?: StringFieldUpdateOperationsInput | string
demoMode?: BoolFieldUpdateOperationsInput | boolean
showRecentNotes?: BoolFieldUpdateOperationsInput | boolean
emailNotifications?: BoolFieldUpdateOperationsInput | boolean
desktopNotifications?: BoolFieldUpdateOperationsInput | boolean
anonymousAnalytics?: BoolFieldUpdateOperationsInput | boolean
user?: UserUpdateOneRequiredWithoutAiSettingsNestedInput
}
@@ -16917,6 +16980,9 @@ export namespace Prisma {
fontSize?: StringFieldUpdateOperationsInput | string
demoMode?: BoolFieldUpdateOperationsInput | boolean
showRecentNotes?: BoolFieldUpdateOperationsInput | boolean
emailNotifications?: BoolFieldUpdateOperationsInput | boolean
desktopNotifications?: BoolFieldUpdateOperationsInput | boolean
anonymousAnalytics?: BoolFieldUpdateOperationsInput | boolean
}
export type UserAISettingsCreateManyInput = {
@@ -16931,6 +16997,9 @@ export namespace Prisma {
fontSize?: string
demoMode?: boolean
showRecentNotes?: boolean
emailNotifications?: boolean
desktopNotifications?: boolean
anonymousAnalytics?: boolean
}
export type UserAISettingsUpdateManyMutationInput = {
@@ -16944,6 +17013,9 @@ export namespace Prisma {
fontSize?: StringFieldUpdateOperationsInput | string
demoMode?: BoolFieldUpdateOperationsInput | boolean
showRecentNotes?: BoolFieldUpdateOperationsInput | boolean
emailNotifications?: BoolFieldUpdateOperationsInput | boolean
desktopNotifications?: BoolFieldUpdateOperationsInput | boolean
anonymousAnalytics?: BoolFieldUpdateOperationsInput | boolean
}
export type UserAISettingsUncheckedUpdateManyInput = {
@@ -16958,6 +17030,9 @@ export namespace Prisma {
fontSize?: StringFieldUpdateOperationsInput | string
demoMode?: BoolFieldUpdateOperationsInput | boolean
showRecentNotes?: BoolFieldUpdateOperationsInput | boolean
emailNotifications?: BoolFieldUpdateOperationsInput | boolean
desktopNotifications?: BoolFieldUpdateOperationsInput | boolean
anonymousAnalytics?: BoolFieldUpdateOperationsInput | boolean
}
export type StringFilter<$PrismaModel = never> = {
@@ -17815,6 +17890,9 @@ export namespace Prisma {
fontSize?: SortOrder
demoMode?: SortOrder
showRecentNotes?: SortOrder
emailNotifications?: SortOrder
desktopNotifications?: SortOrder
anonymousAnalytics?: SortOrder
}
export type UserAISettingsMaxOrderByAggregateInput = {
@@ -17829,6 +17907,9 @@ export namespace Prisma {
fontSize?: SortOrder
demoMode?: SortOrder
showRecentNotes?: SortOrder
emailNotifications?: SortOrder
desktopNotifications?: SortOrder
anonymousAnalytics?: SortOrder
}
export type UserAISettingsMinOrderByAggregateInput = {
@@ -17843,6 +17924,9 @@ export namespace Prisma {
fontSize?: SortOrder
demoMode?: SortOrder
showRecentNotes?: SortOrder
emailNotifications?: SortOrder
desktopNotifications?: SortOrder
anonymousAnalytics?: SortOrder
}
export type AccountCreateNestedManyWithoutUserInput = {
@@ -19469,6 +19553,9 @@ export namespace Prisma {
fontSize?: string
demoMode?: boolean
showRecentNotes?: boolean
emailNotifications?: boolean
desktopNotifications?: boolean
anonymousAnalytics?: boolean
}
export type UserAISettingsUncheckedCreateWithoutUserInput = {
@@ -19482,6 +19569,9 @@ export namespace Prisma {
fontSize?: string
demoMode?: boolean
showRecentNotes?: boolean
emailNotifications?: boolean
desktopNotifications?: boolean
anonymousAnalytics?: boolean
}
export type UserAISettingsCreateOrConnectWithoutUserInput = {
@@ -19795,6 +19885,9 @@ export namespace Prisma {
fontSize?: StringFieldUpdateOperationsInput | string
demoMode?: BoolFieldUpdateOperationsInput | boolean
showRecentNotes?: BoolFieldUpdateOperationsInput | boolean
emailNotifications?: BoolFieldUpdateOperationsInput | boolean
desktopNotifications?: BoolFieldUpdateOperationsInput | boolean
anonymousAnalytics?: BoolFieldUpdateOperationsInput | boolean
}
export type UserAISettingsUncheckedUpdateWithoutUserInput = {
@@ -19808,6 +19901,9 @@ export namespace Prisma {
fontSize?: StringFieldUpdateOperationsInput | string
demoMode?: BoolFieldUpdateOperationsInput | boolean
showRecentNotes?: BoolFieldUpdateOperationsInput | boolean
emailNotifications?: BoolFieldUpdateOperationsInput | boolean
desktopNotifications?: BoolFieldUpdateOperationsInput | boolean
anonymousAnalytics?: BoolFieldUpdateOperationsInput | boolean
}
export type UserCreateWithoutAccountsInput = {