+ {categories.map((category) => (
+
+
{category}
+ {settingsNavigation
+ .filter((page) => page.category === category)
+ .map((page) => (
+
+ ))}
+
+ ))}
+
+
+
+
+ );
+}
diff --git a/packages/settings/src/manifest.ts b/packages/settings/src/manifest.ts
index 1afdd5a..41fe14a 100644
--- a/packages/settings/src/manifest.ts
+++ b/packages/settings/src/manifest.ts
@@ -8,24 +8,46 @@ import Profile from "./pages/profile";
import Security from "./pages/security";
import Theme from "./pages/theme";
import Hotkeys from "./pages/hotkeys";
-import { settingsNavigation } from "./navigation";
-
-const pageComponents = {
- profile: Profile,
- security: Security,
- chat: Chat,
- call: Call,
- cache: Cache,
- theme: Theme,
- accessibility: Accessibility,
- hotkeys: Hotkeys,
- licenses: Licenses,
-} as const;
export const settingsPages = [
{ path: "/", component: Index },
- ...settingsNavigation.map((page) => ({
- ...page,
- component: pageComponents[page.path],
- })),
+ {
+ category: "account",
+ path: "profile",
+ label: "Profile",
+ component: Profile,
+ },
+ {
+ category: "account",
+ path: "security",
+ label: "Security",
+ component: Security,
+ },
+ { category: "general", path: "chat", label: "Chat", component: Chat },
+ { category: "general", path: "call", label: "Call", component: Call },
+ { category: "application", path: "cache", label: "Cache", component: Cache },
+ { category: "application", path: "theme", label: "Theme", component: Theme },
+ {
+ category: "application",
+ path: "accessibility",
+ label: "Accessibility",
+ component: Accessibility,
+ },
+ {
+ category: "application",
+ path: "hotkeys",
+ label: "Hotkeys",
+ component: Hotkeys,
+ },
+ {
+ category: "application",
+ path: "licenses",
+ label: "Licenses",
+ component: Licenses,
+ },
] as const;
+
+export const settingsNavigation = settingsPages.filter(
+ (page): page is Exclude<(typeof settingsPages)[number], { path: "/" }> =>
+ page.path !== "/",
+);
diff --git a/packages/settings/src/navigation.ts b/packages/settings/src/navigation.ts
deleted file mode 100644
index b47fae9..0000000
--- a/packages/settings/src/navigation.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-export const settingsNavigation = [
- {
- category: "account",
- path: "profile",
- label: "Profile",
- },
- {
- category: "account",
- path: "security",
- label: "Security",
- },
- { category: "general", path: "chat", label: "Chat" },
- { category: "general", path: "call", label: "Call" },
- { category: "application", path: "cache", label: "Cache" },
- { category: "application", path: "theme", label: "Theme" },
- {
- category: "application",
- path: "accessibility",
- label: "Accessibility",
- },
- {
- category: "application",
- path: "hotkeys",
- label: "Hotkeys",
- },
- {
- category: "application",
- path: "licenses",
- label: "Licenses",
- },
-] as const;
diff --git a/packages/settings/src/pages/index.tsx b/packages/settings/src/pages/index.tsx
index b5d04e3..803a0c1 100644
--- a/packages/settings/src/pages/index.tsx
+++ b/packages/settings/src/pages/index.tsx
@@ -1,4 +1,4 @@
-import { SettingsSidebar } from "../sidebar";
+import { SettingsSidebar } from "../layout";
export default function Page() {
return (
diff --git a/packages/settings/src/sidebar.tsx b/packages/settings/src/sidebar.tsx
deleted file mode 100644
index 3a2155e..0000000
--- a/packages/settings/src/sidebar.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Button, ClearStorageButton, cn } from "@methanium/ui";
-import { useNavigate } from "@tanstack/react-router";
-
-import { settingsNavigation } from "./navigation";
-
-export function SettingsSidebar({
- mobile = false,
- className,
-}: {
- mobile?: boolean;
- className?: string;
-}) {
- const navigate = useNavigate();
- const categories = [
- ...new Set(settingsNavigation.map((page) => page.category)),
- ];
-
- return (
-
- {categories.map((category) => (
-
-
{category}
- {settingsNavigation
- .filter((page) => page.category === category)
- .map((page) => (
-
- ))}
-
- ))}
-
-
-
-
- );
-}
diff --git a/packages/user/src/context.tsx b/packages/user/src/context.tsx
index 8c41aa4..423661c 100644
--- a/packages/user/src/context.tsx
+++ b/packages/user/src/context.tsx
@@ -9,12 +9,13 @@ import {
useState,
useSyncExternalStore,
} from "react";
-import { useMTP } from "@tensamin/mtp";
+import { useMTP, type ProtocolMessage } from "@tensamin/mtp";
import {
clientUserStateSchema,
mtp as schemas,
publicUserStateSchema,
+ userStateEntrySchema,
} from "@tensamin/shared/data";
import type z from "zod";
import { createCache } from "@tensamin/cache";
@@ -88,7 +89,7 @@ export default function UserProvider(props: { children: ReactNode }) {
);
const revisionsRef = useRef(new Map