Skip to content

Commit d390eb6

Browse files
committed
refactor(settings): ✨ Remove settings breadcrumb and restructure navigation
- Deleted the `settingsBreadcrumb` function and its usage across various settings pages. - Updated the settings navigation to group items under relevant categories. - Refactored the `PrivacySettings` component to include visibility options and removed unnecessary privacy settings. - Consolidated privacy-related functionality into dedicated components for better organization.
1 parent a7113cd commit d390eb6

25 files changed

Lines changed: 127 additions & 141 deletions

‎apps/web/content/docs/dev/working-with-users/presence.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ Each session expires on its own. A member with a laptop and a phone stays online
5555

5656
## Browse anonymously
5757

58-
Members who'd rather lurk in peace open **Settings → Overview** (`/settings`) and turn on **Browse anonymously** under **Privacy**, as long as their [roles allow it](#role-settings).
58+
Members who'd rather lurk in peace open **Settings → Privacy & data** (`/settings/privacy`) and turn on **Browse anonymously** under **Privacy**, as long as their [roles allow it](#role-settings).
5959

6060
<ImgDocs
6161
withoutBackground
6262
className="*:max-w-full"
6363
src={anonymousImg}
64-
alt="Privacy section in Settings Overview with the Browse anonymously switch turned on"
64+
alt="Privacy section on the Privacy & data settings page with the Browse anonymously switch turned on"
6565
/>
6666

6767
The switch saves `core_users.hideOnlineStatus` through `PUT /users/me/privacy` and takes effect on the next presence read. Everybody else then gets `{ "status": "hidden" }`, with no timestamp at all, and the profile shows **Activity hidden**.

‎apps/web/content/docs/dev/working-with-users/profile-fields.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The **Edit profile** button is the header's action slot and shows only on the ac
5151

5252
## Browse anonymously
5353

54-
The **Privacy** group on **Settings → Overview** holds **Browse anonymously**. Turned on, other members see **Activity hidden** instead of the member's online status and last activity, while staff with `users:can_view_hidden_presence` still see it. A role can take the choice away: the switch then stays visible but disabled, with a tooltip saying why. See [User Presence](/docs/dev/working-with-users/presence#role-settings).
54+
The **Privacy** group on **Settings → Privacy & data** (`/settings/privacy`) holds **Browse anonymously**. Turned on, other members see **Activity hidden** instead of the member's online status and last activity, while staff with `users:can_view_hidden_presence` still see it. A role can take the choice away: the switch then stays visible but disabled, with a tooltip saying why. See [User Presence](/docs/dev/working-with-users/presence#role-settings).
5555

5656
## Who may edit
5757

‎packages/vitnode/src/locales/en.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,11 @@
12251225
"standing": "Account status",
12261226
"privacy": "Privacy & data"
12271227
},
1228+
"nav_groups": {
1229+
"account": "Account",
1230+
"preferences": "Preferences",
1231+
"safety": "Privacy & safety"
1232+
},
12281233
"overview": {
12291234
"desc": "Your avatar and the details on your account.",
12301235
"profileTitle": "Profile",
@@ -1665,7 +1670,7 @@
16651670
},
16661671
"privacy": {
16671672
"title": "Privacy & data",
1668-
"desc": "Download a copy of your data or delete your account.",
1673+
"desc": "Choose who sees your activity, download a copy of your data, or delete your account.",
16691674
"export": {
16701675
"title": "Download your data",
16711676
"desc": "A JSON file with everything this site stores about you: your profile, devices, sign-in methods, files, payments and what plugins keep.",

‎packages/vitnode/src/pages/settings/ai.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { PluginRoutePageProps } from "@/routing";
44

55
import { defineAuthenticatedRoute } from "@/tanstack/plugin-routes";
66
import { AiUsagePanelContent } from "@/tanstack/settings-ai/panel";
7-
import { settingsBreadcrumb } from "@/tanstack/settings/breadcrumb";
87
import {
98
aiUsageQueryOptions,
109
hasAiFeatures,
@@ -34,8 +33,6 @@ export const route = defineAuthenticatedRoute<AiUsageData>({
3433
head: ({ t }) => ({
3534
title: `${t("core.auth.settings.nav.ai")} - ${t("core.auth.settings.title")}`,
3635
}),
37-
38-
breadcrumb: settingsBreadcrumb("ai"),
3936
});
4037

4138
export default AiUsagePage;

‎packages/vitnode/src/pages/settings/devices.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { PluginRoutePageProps } from "@/routing";
22

33
import { DevicesPanelContent } from "@/tanstack/devices/panel";
44
import { defineAuthenticatedRoute } from "@/tanstack/plugin-routes";
5-
import { settingsBreadcrumb } from "@/tanstack/settings/breadcrumb";
65
import { devicesQueryOptions } from "@/views/auth/settings/devices/devices-query";
76

87
interface DevicesData {
@@ -27,8 +26,6 @@ export const route = defineAuthenticatedRoute<DevicesData>({
2726
head: ({ t }) => ({
2827
title: `${t("core.auth.settings.nav.devices")} - ${t("core.auth.settings.title")}`,
2928
}),
30-
31-
breadcrumb: settingsBreadcrumb("devices"),
3229
});
3330

3431
export default DevicesPage;

‎packages/vitnode/src/pages/settings/layout.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { PluginRoutePageProps } from "@/routing";
44

55
import { middlewareConfigQueryOptions } from "@/tanstack/auth/middleware-config";
66
import { defineAuthenticatedRoute } from "@/tanstack/plugin-routes";
7-
import { settingsBreadcrumb } from "@/tanstack/settings/breadcrumb";
87
import { SettingsLayoutContent } from "@/tanstack/settings/layout";
98
import { loadPageWidgets } from "@/tanstack/widgets";
109
import { aiUsageQueryOptions } from "@/views/auth/settings/ai/ai-usage-query";
@@ -43,9 +42,6 @@ export const route = defineAuthenticatedRoute<SettingsLayoutData>({
4342
return { userId };
4443
},
4544
head: () => ({ robots: "noindex, nofollow" }),
46-
47-
/** The first crumb of the trail; each panel adds its own after it. */
48-
breadcrumb: settingsBreadcrumb(),
4945
});
5046

5147
export default SettingsLayout;

‎packages/vitnode/src/pages/settings/notifications.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { PluginRoutePageProps } from "@/routing";
22

33
import { NotificationSettingsPanel } from "@/tanstack/notifications/settings-screen";
44
import { defineAuthenticatedRoute } from "@/tanstack/plugin-routes";
5-
import { settingsBreadcrumb } from "@/tanstack/settings/breadcrumb";
65
import { notificationPreferencesQueryOptions } from "@/views/notifications/notifications-query";
76

87
interface NotificationSettingsData {
@@ -29,8 +28,6 @@ export const route = defineAuthenticatedRoute<NotificationSettingsData>({
2928
head: ({ t }) => ({
3029
title: `${t("core.auth.settings.nav.notifications")} - ${t("core.auth.settings.title")}`,
3130
}),
32-
33-
breadcrumb: settingsBreadcrumb("notifications"),
3431
});
3532

3633
export default NotificationSettingsPage;

‎packages/vitnode/src/pages/settings/privacy.tsx‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PluginRoutePageProps } from "@/routing";
22

33
import { defineAuthenticatedRoute } from "@/tanstack/plugin-routes";
4-
import { settingsBreadcrumb } from "@/tanstack/settings/breadcrumb";
4+
import { personalInfoPolicyQuery } from "@/tanstack/settings/personal-policy";
55
import { PrivacyPanelContent } from "@/tanstack/settings/privacy-panel";
66
import { accountDeletionQueryOptions } from "@/views/auth/settings/privacy/privacy-query";
77

@@ -21,18 +21,19 @@ export const route = defineAuthenticatedRoute<PrivacyData>({
2121
load: async ({ context }) => {
2222
const { id: userId, name: userName } = context.auth.user;
2323

24-
await context.queryClient.query({
25-
...accountDeletionQueryOptions({ userId }),
26-
staleTime: "static",
27-
});
24+
await Promise.all([
25+
context.queryClient.query({
26+
...accountDeletionQueryOptions({ userId }),
27+
staleTime: "static",
28+
}),
29+
context.queryClient.query(personalInfoPolicyQuery()),
30+
]);
2831

2932
return { userId, userName };
3033
},
3134
head: ({ t }) => ({
3235
title: `${t("core.auth.settings.nav.privacy")} - ${t("core.auth.settings.title")}`,
3336
}),
34-
35-
breadcrumb: settingsBreadcrumb("privacy"),
3637
});
3738

3839
export default PrivacyPage;

‎packages/vitnode/src/pages/settings/security.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
} from "@/tanstack/auth/middleware-config";
99
import { PasskeysPanelContent } from "@/tanstack/passkeys/panel";
1010
import { defineAuthenticatedRoute } from "@/tanstack/plugin-routes";
11-
import { settingsBreadcrumb } from "@/tanstack/settings/breadcrumb";
1211
import { passkeysQueryOptions } from "@/views/auth/settings/passkeys/passkeys-query";
1312
import { SecuritySettings } from "@/views/auth/settings/security/security";
1413

@@ -43,8 +42,6 @@ export const route = defineAuthenticatedRoute<SecurityData>({
4342
head: ({ t }) => ({
4443
title: `${t("core.auth.settings.nav.security")} - ${t("core.auth.settings.title")}`,
4544
}),
46-
47-
breadcrumb: settingsBreadcrumb("security"),
4845
});
4946

5047
export default SecurityPage;

‎packages/vitnode/src/pages/settings/sso.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
MiddlewareConfigUnknownError,
99
} from "@/tanstack/auth/middleware-config";
1010
import { defineAuthenticatedRoute } from "@/tanstack/plugin-routes";
11-
import { settingsBreadcrumb } from "@/tanstack/settings/breadcrumb";
1211
import { SsoConnectionsPanelContent } from "@/tanstack/sso-connections/panel";
1312
import { ssoConnectionsQueryOptions } from "@/views/auth/settings/sso/sso-connections-query";
1413

@@ -51,8 +50,6 @@ export const route = defineAuthenticatedRoute<SsoData, SsoSettingsSearch>({
5150
head: ({ t }) => ({
5251
title: `${t("core.auth.settings.nav.sso")} - ${t("core.auth.settings.title")}`,
5352
}),
54-
55-
breadcrumb: settingsBreadcrumb("sso"),
5653
});
5754

5855
export default SsoPage;

0 commit comments

Comments
 (0)