feat: preferences syncing frontend (#7192)

* feat: prefs frontend

* fix: DI issue

* fix: lint

* feat: appearance settings cleanup + fix settings, remove pinia

* fix: sync btn when logged out

* fix: prepr

* fix: sidebar issue

* feat: language coverage + cleanup

* feat: cleanup lang settings

* fix: fmt

* fix: CI

* fix: ci

* fix: storybook

* feat: bring back loader/game version sort

---------

Co-authored-by: tdgao <mr.trumgao@gmail.com>
This commit is contained in:
Calum H.
2026-08-20 07:23:01 +00:00
committed by GitHub
co-authored by tdgao
parent 79fcf41316
commit 3e07267e10
191 changed files with 3356 additions and 4372 deletions
+4 -1
View File
@@ -5,8 +5,9 @@
*/
import { invoke } from '@tauri-apps/api/core'
import type { FeatureFlag } from '@/composables/use-app-settings.ts'
import type { ColorTheme } from '@/composables/use-theme.ts'
import type { Hooks, MemorySettings, WindowSize } from '@/helpers/types'
import type { ColorTheme, FeatureFlag } from '@/store/theme.ts'
// Settings object
/*
@@ -43,6 +44,8 @@ export type AppSettings = {
advanced_rendering: boolean
native_decorations: boolean
toggle_sidebar: boolean
sync_theme_across_devices: boolean
sync_behavior_across_devices: boolean
telemetry: boolean
discord_rpc: boolean
+2
View File
@@ -213,6 +213,8 @@ type AppSettings = {
advanced_rendering: boolean
native_decorations: boolean
worlds_in_home: boolean
sync_theme_across_devices: boolean
sync_behavior_across_devices: boolean
telemetry: boolean
discord_rpc: boolean
@@ -0,0 +1,19 @@
import type { UserPreferencesContext } from '@modrinth/ui'
import { invoke } from '@tauri-apps/api/core'
type UserPreferences = NonNullable<UserPreferencesContext['preferences']['value']>
type PartialUserPreferences = Parameters<UserPreferencesContext['updatePreferences']>[0]
export async function get_user_preferences(userId: string): Promise<UserPreferences> {
return await invoke<UserPreferences>('plugin:users|get_user_preferences', { userId })
}
export async function patch_user_preferences(
userId: string,
preferences: PartialUserPreferences,
): Promise<UserPreferences> {
return await invoke<UserPreferences>('plugin:users|patch_user_preferences', {
userId,
preferences,
})
}