Skip to content

Commit cc91305

Browse files
authored
feature: ⌘K searches pages and settings alongside players, scoped to what each role can open (#881)
1 parent 32e7a02 commit cc91305

32 files changed

Lines changed: 1517 additions & 485 deletions

‎components/GlobalSearch.vue‎

Lines changed: 495 additions & 0 deletions
Large diffs are not rendered by default.

‎components/SpotlightPlayerSearch.vue‎

Lines changed: 0 additions & 299 deletions
This file was deleted.

‎components/settings/ProfileSettingsShell.vue‎

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,10 @@ import {
77
SelectValue,
88
} from "@/components/ui/select";
99
import SettingsSideTabs from "~/components/settings/SettingsSideTabs.vue";
10+
import { useAccountSettingsNav } from "~/composables/useSettingsNav";
11+
import { useSettingsSearchReveal } from "~/composables/useSettingsSearch";
1012
11-
const { t: $t } = useI18n();
12-
13-
const navItems = computed(() => {
14-
const items: { path: string; label: string }[] = [
15-
{
16-
path: "/settings",
17-
label: $t("pages.settings.account.my_account"),
18-
},
19-
{
20-
path: "/settings/matchmaking",
21-
label: $t("pages.settings.account.matchmaking"),
22-
},
23-
{
24-
path: "/settings/linked-accounts",
25-
label: $t("pages.settings.account.linked_accounts"),
26-
},
27-
{
28-
path: "/settings/blocked-players",
29-
label: $t("pages.settings.account.blocked_players"),
30-
},
31-
{
32-
path: "/settings/notifications",
33-
label: $t("pages.settings.notifications.title"),
34-
},
35-
{
36-
path: "/settings/voice",
37-
label: $t("pages.settings.account.voice"),
38-
},
39-
{
40-
path: "/settings/api-keys",
41-
label: $t("pages.settings.account.api_keys"),
42-
},
43-
];
44-
return items;
45-
});
13+
const { items: navItems } = useAccountSettingsNav();
4614
4715
const route = useRoute();
4816
const router = useRouter();
@@ -67,6 +35,7 @@ const selectedPath = computed({
6735
const contentRow = ref<HTMLElement | null>(null);
6836
6937
useScrollIntoViewOnChange(contentRow, () => route.path);
38+
useSettingsSearchReveal(contentRow);
7039
7140
// The content pane owns its own scroll at lg, so a section switch has to be
7241
// sent back to the top by hand -- unlike the application shell, this pane is
@@ -131,6 +100,7 @@ watch(
131100
rather than asking each one to wrap itself in SettingsPage. -->
132101
<div
133102
ref="contentPane"
103+
:data-settings-pane="route.path"
134104
class="settings-measure min-w-0 flex-1 space-y-6 lg:h-full lg:overflow-y-auto lg:overscroll-contain"
135105
>
136106
<slot />

0 commit comments

Comments
 (0)