fix(settings): navigate to About tab when clicking update badge

- Add defaultTab prop to SettingsPage for external tab control
- UpdateBadge click now opens settings directly to About tab
- Settings button still opens to General tab (default behavior)
- Change update badge text from version number to "Update available"
This commit is contained in:
Jason
2026-01-06 11:27:32 +08:00
parent 0020889a8f
commit 2c4c2ce83d
6 changed files with 18 additions and 5 deletions
+10 -2
View File
@@ -70,6 +70,7 @@ function App() {
const [activeApp, setActiveApp] = useState<AppId>("claude");
const [currentView, setCurrentView] = useState<View>("providers");
const [settingsDefaultTab, setSettingsDefaultTab] = useState("general");
const [isAddOpen, setIsAddOpen] = useState(false);
const [editingProvider, setEditingProvider] = useState<Provider | null>(null);
@@ -411,6 +412,7 @@ function App() {
open={true}
onOpenChange={() => setCurrentView("providers")}
onImportSuccess={handleImportSuccess}
defaultTab={settingsDefaultTab}
/>
);
case "prompts":
@@ -610,14 +612,20 @@ function App() {
<Button
variant="ghost"
size="icon"
onClick={() => setCurrentView("settings")}
onClick={() => {
setSettingsDefaultTab("general");
setCurrentView("settings");
}}
title={t("common.settings")}
className="hover:bg-black/5 dark:hover:bg-white/5"
>
<Settings className="w-4 h-4" />
</Button>
</div>
<UpdateBadge onClick={() => setCurrentView("settings")} />
<UpdateBadge onClick={() => {
setSettingsDefaultTab("about");
setCurrentView("settings");
}} />
</>
)}
</div>