diff --git a/frontend/src/components/settings/AISettingsTab.jsx b/frontend/src/components/settings/AISettingsTab.jsx index 3150f4b8..7156299c 100644 --- a/frontend/src/components/settings/AISettingsTab.jsx +++ b/frontend/src/components/settings/AISettingsTab.jsx @@ -1,5 +1,6 @@ import { useEffect, useState } from 'react'; import api from '../../services/api'; +import useSettingFocus from '../../hooks/useSettingFocus'; import { useAuth } from '../../contexts/AuthContext'; import { Switch } from '@/components/ui/switch'; import { Label } from '@/components/ui/label'; @@ -8,6 +9,7 @@ import { Button } from '@/components/ui/button'; const AI_CONFIG_CHANGED_EVENT = 'serverkit:ai-config-changed'; const AISettingsTab = () => { + const register = useSettingFocus(); const { isAdmin } = useAuth(); const [settings, setSettings] = useState({ enabled: false, provider: '', model: '', endpoint: '', @@ -112,7 +114,7 @@ const AISettingsTab = () => { {message &&
{message.text}
} -
+
diff --git a/frontend/src/components/settings/AboutTab.jsx b/frontend/src/components/settings/AboutTab.jsx index 542e0fca..1c212457 100644 --- a/frontend/src/components/settings/AboutTab.jsx +++ b/frontend/src/components/settings/AboutTab.jsx @@ -6,6 +6,7 @@ import { } from 'lucide-react'; import ServerKitLogo from '../ServerKitLogo'; import { Button } from '@/components/ui/button'; +import useSettingFocus from '../../hooks/useSettingFocus'; const STAR_PROMPT_KEY = 'serverkit-star-prompt-dismissed'; @@ -16,6 +17,7 @@ const AboutTab = () => { const [showStarPrompt, setShowStarPrompt] = useState(() => { return localStorage.getItem(STAR_PROMPT_KEY) !== 'true'; }); + const register = useSettingFocus(); useEffect(() => { const fetchVersion = async () => { @@ -52,7 +54,7 @@ const AboutTab = () => {

Server management made simple

-
+
@@ -162,7 +164,7 @@ const AboutTab = () => {
-
+

Links

diff --git a/frontend/src/components/settings/ActivityTab.jsx b/frontend/src/components/settings/ActivityTab.jsx index 617b9c2d..344247bd 100644 --- a/frontend/src/components/settings/ActivityTab.jsx +++ b/frontend/src/components/settings/ActivityTab.jsx @@ -4,8 +4,10 @@ import ContributionGraph from './ContributionGraph'; import { Search, Filter, X, User as UserIcon } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select'; +import useSettingFocus from '../../hooks/useSettingFocus'; const ActivityTab = () => { + const register = useSettingFocus(); const [summary, setSummary] = useState(null); const [logs, setLogs] = useState([]); const [loading, setLoading] = useState(true); @@ -130,7 +132,7 @@ const ActivityTab = () => { {summary && ( <> -
+
{summary.active_users_today} active today @@ -184,7 +186,7 @@ const ActivityTab = () => { )} -
+

Audit Log

diff --git a/frontend/src/components/settings/ApiSettingsTab.jsx b/frontend/src/components/settings/ApiSettingsTab.jsx index a242a050..699b4308 100644 --- a/frontend/src/components/settings/ApiSettingsTab.jsx +++ b/frontend/src/components/settings/ApiSettingsTab.jsx @@ -1,6 +1,7 @@ import { useState, useEffect, useCallback } from 'react'; import { useAuth } from '../../contexts/AuthContext'; import api from '../../services/api'; +import useSettingFocus from '../../hooks/useSettingFocus'; import ApiKeyModal from './ApiKeyModal'; import WebhookSubscriptionModal from './WebhookSubscriptionModal'; import { @@ -28,6 +29,7 @@ const ApiSettingsTab = () => { // ─── API Keys Section ────────────────────────────────── const ApiKeysSection = () => { + const register = useSettingFocus(); const [keys, setKeys] = useState([]); const [loading, setLoading] = useState(true); const [showModal, setShowModal] = useState(false); @@ -68,7 +70,7 @@ const ApiKeysSection = () => { }; return ( -
+
@@ -184,6 +186,7 @@ const ApiKeysSection = () => { // ─── Rate Limits Section ─────────────────────────────── const RateLimitsSection = () => { + const register = useSettingFocus(); const [limits, setLimits] = useState({ rate_limit_standard: '100 per minute', rate_limit_elevated: '500 per minute', @@ -227,7 +230,7 @@ const RateLimitsSection = () => { }; return ( -
+
@@ -270,6 +273,7 @@ const RateLimitsSection = () => { // ─── Webhook Subscriptions Section ───────────────────── const WebhookSection = () => { + const register = useSettingFocus(); const [subscriptions, setSubscriptions] = useState([]); const [loading, setLoading] = useState(true); const [showModal, setShowModal] = useState(false); @@ -328,7 +332,7 @@ const WebhookSection = () => { }; return ( -
+
@@ -457,6 +461,7 @@ const WebhookSection = () => { // ─── Analytics Section ───────────────────────────────── const AnalyticsSection = () => { + const register = useSettingFocus(); const [overview, setOverview] = useState(null); const [endpoints, setEndpoints] = useState([]); const [timeseries, setTimeseries] = useState([]); @@ -481,7 +486,7 @@ const AnalyticsSection = () => { const maxCount = Math.max(...timeseries.map(d => d.count), 1); return ( -
+
diff --git a/frontend/src/components/settings/AppearanceTab.jsx b/frontend/src/components/settings/AppearanceTab.jsx index 09ee922a..d5d7ae9e 100644 --- a/frontend/src/components/settings/AppearanceTab.jsx +++ b/frontend/src/components/settings/AppearanceTab.jsx @@ -3,6 +3,7 @@ import useDashboardLayout from '../../hooks/useDashboardLayout'; import { ChevronDown, ChevronUp, RotateCcw } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Switch } from '@/components/ui/switch'; +import useSettingFocus from '../../hooks/useSettingFocus'; const ACCENT_PRESETS = [ { label: 'Indigo', color: '#6366f1' }, @@ -18,6 +19,7 @@ const ACCENT_PRESETS = [ const AppearanceTab = () => { const { theme, setTheme, accentColor, setAccentColor } = useTheme(); const { widgets, toggleWidget, moveWidget, resetLayout } = useDashboardLayout(); + const register = useSettingFocus(); return (
@@ -26,7 +28,7 @@ const AppearanceTab = () => {

Customize the look and feel of your dashboard

-
+

Theme

Select your preferred color scheme

@@ -72,7 +74,7 @@ const AppearanceTab = () => {
-
+

Accent Color

Choose the primary accent color used across the interface

@@ -101,7 +103,7 @@ const AppearanceTab = () => {
-
+

Dashboard Widgets

Toggle visibility and reorder widgets on the dashboard

diff --git a/frontend/src/components/settings/MigrationHistoryTab.jsx b/frontend/src/components/settings/MigrationHistoryTab.jsx index 896cde42..6b04f12f 100644 --- a/frontend/src/components/settings/MigrationHistoryTab.jsx +++ b/frontend/src/components/settings/MigrationHistoryTab.jsx @@ -4,6 +4,7 @@ import { Database, Loader, CheckCircle, ArrowUpCircle, ShieldCheck } from 'lucid import { Badge } from '@/components/ui/badge'; import { useToast } from '../../contexts/ToastContext'; import { useConfirm } from '../../hooks/useConfirm'; +import useSettingFocus from '../../hooks/useSettingFocus'; // Revisions in this project are short descriptive slugs (e.g. 016_resource_grants), // so show them in full rather than truncating mid-word. @@ -12,6 +13,7 @@ const short = (rev) => rev || ''; const MigrationHistoryTab = () => { const toast = useToast(); const { confirm } = useConfirm(); + const register = useSettingFocus(); const [revisions, setRevisions] = useState([]); const [status, setStatus] = useState(null); @@ -124,7 +126,7 @@ const MigrationHistoryTab = () => {
{hasPending ? ( -
+