From 48f521e5515bc556eaddadaa93065be1ac52dd12 Mon Sep 17 00:00:00 2001 From: benya Date: Sun, 8 Mar 2026 11:09:36 +0300 Subject: [PATCH] feat(web): upgrade settings UX to telegram-like structure - redesign settings main/general/notifications/privacy screens - add status subtitles and structured rows - improve privacy and notifications sections --- web/src/components/SettingsPanel.tsx | 89 ++++++++++++++++++---------- 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/web/src/components/SettingsPanel.tsx b/web/src/components/SettingsPanel.tsx index 20a43bf..b52e877 100644 --- a/web/src/components/SettingsPanel.tsx +++ b/web/src/components/SettingsPanel.tsx @@ -83,6 +83,8 @@ export function SettingsPanel({ open, onClose }: Props) { setPrefs(updateAppPreferences(patch)); } + const notificationStatus = "Notification" in window ? Notification.permission : "denied"; + return createPortal(
@@ -106,9 +108,9 @@ export function SettingsPanel({ open, onClose }: Props) {
{page === "main" ? ( <> -
-

Profile

-
+
+

Profile

+
-
+ - setPage("general")} /> - setPage("notifications")} /> - setPage("privacy")} /> +
+ setPage("general")} /> + setPage("notifications")} + /> + setPage("privacy")} + /> +
) : null} {page === "general" ? (
-

Message Font Size

+

Settings

+

Message Font Size

updatePrefs({ messageFontSize: Number(e.target.value) })} /> - {prefs.messageFontSize} + {prefs.messageFontSize}
-

Theme

+

Theme

updatePrefs({ theme: "light" })} /> updatePrefs({ theme: "dark" })} /> updatePrefs({ theme: "system" })} />
-

Keyboard

- updatePrefs({ sendMode: "enter" })} /> - updatePrefs({ sendMode: "ctrl_enter" })} /> +

Keyboard

+ updatePrefs({ sendMode: "enter" })} /> + updatePrefs({ sendMode: "ctrl_enter" })} />
) : null} @@ -193,9 +206,10 @@ export function SettingsPanel({ open, onClose }: Props) { {page === "notifications" ? (
+

Web Notifications

{ updatePrefs({ webNotifications: checked }); if (checked && "Notification" in window && Notification.permission === "default") { @@ -203,17 +217,14 @@ export function SettingsPanel({ open, onClose }: Props) { } }} /> - updatePrefs({ messagePreview: checked })} - /> + updatePrefs({ messagePreview: checked })} />
+
-

Chats

- updatePrefs({ privateNotifications: checked })} /> - updatePrefs({ groupNotifications: checked })} /> - updatePrefs({ channelNotifications: checked })} /> +

Chats

+ updatePrefs({ privateNotifications: checked })} /> + updatePrefs({ groupNotifications: checked })} /> + updatePrefs({ channelNotifications: checked })} />
) : null} @@ -221,13 +232,16 @@ export function SettingsPanel({ open, onClose }: Props) { {page === "privacy" ? (
-

Blocked Users

-

{blockedCount}

+

Privacy

+ + + +
{ setAllowPrivateMessages(checked); setSavingPrivacy(true); @@ -250,14 +264,27 @@ export function SettingsPanel({ open, onClose }: Props) { ); } -function MenuItem({ label, onClick }: { label: string; onClick: () => void }) { +function SettingsRow({ label, value, onClick }: { label: string; value: string; onClick: () => void }) { return ( - ); } +function SettingsTextRow({ label, value }: { label: string; value: string }) { + return ( +
+

{label}

+

{value}

+
+ ); +} + function RadioOption({ checked, label, onChange }: { checked: boolean; label: string; onChange: () => void }) { return (