diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx index e4877c89..1f049ce2 100644 --- a/apps/mobile/src/screens/WorkspaceScreen.tsx +++ b/apps/mobile/src/screens/WorkspaceScreen.tsx @@ -157,7 +157,7 @@ const MOBILE_LOCALE_OPTIONS: Array<{ label: string; value: MobileLocalePreferenc { label: "English", value: "en-US" }, ]; type MobileView = "notes" | "settings"; -type SettingsTab = "general" | "account"; +type SettingsTab = "general" | "account" | "system"; type MemoView = "notebook" | "trash"; type NotebookOption = { notebook: Notebook; @@ -1895,7 +1895,11 @@ const SettingsView = ({ { key: "general", label: "常规设置", icon: }, { key: "account", label: "登录设置", icon: }, ]; - const title = tabs.find((tab) => tab.key === activeTab)?.label ?? "我的"; + const systemInfoCopy = getMobileSystemInfoText(localePreference); + const activeTabItem = activeTab === "system" + ? { label: systemInfoCopy.title, icon: } + : tabs.find((tab) => tab.key === activeTab); + const title = activeTabItem?.label ?? "我的"; const activeLocaleLabel = MOBILE_LOCALE_OPTIONS.find((option) => option.value === localePreference)?.label ?? "跟随系统"; const openLocalePicker = () => { localeSelectRef.current?.measureInWindow((left, top, width, height) => { @@ -1921,6 +1925,13 @@ const SettingsView = ({ }, [activeTab, onClose]); const renderContent = () => { + if (activeTab === "system") { + return ( + + + + ); + } if (activeTab === "general") { return ( @@ -1948,7 +1959,6 @@ const SettingsView = ({ - ); @@ -1987,7 +1997,7 @@ const SettingsView = ({ - {activeTab ? tabs.find((tab) => tab.key === activeTab)?.icon : } + {activeTab ? activeTabItem?.icon : } {title} - + setActiveTab("system")} style={styles.settingsMenuRow}> + + + + {systemInfoCopy.title} + {systemInfoCopy.description} + + + + + @@ -2523,9 +2543,9 @@ const CreateMemoModal = ({ ); }; -const SystemInfoCard = ({ embedded = false }: { embedded?: boolean }) => { +const SystemInfoCard = ({ defaultExpanded = false }: { defaultExpanded?: boolean }) => { const [copied, setCopied] = useState(false); - const [expanded, setExpanded] = useState(false); + const [expanded, setExpanded] = useState(defaultExpanded); const { checkForUpdate, hasUpdate, status } = useMobileUpdate(); const localePreference = useMobileLocalePreference(); const copy = getMobileSystemInfoText(localePreference); @@ -2538,7 +2558,7 @@ const SystemInfoCard = ({ embedded = false }: { embedded?: boolean }) => { }; return ( - + setExpanded((value) => !value)} style={styles.settingsAccordionHeader}> @@ -5068,14 +5088,6 @@ const baseWorkspaceStyles = StyleSheet.create({ borderTopColor: "#f1f5f9", borderTopWidth: 1, }, - settingsEmbeddedSection: { - borderBottomWidth: 0, - borderLeftWidth: 0, - borderRadius: 0, - borderRightWidth: 0, - borderTopColor: "#f1f5f9", - borderTopWidth: 1, - }, settingsGroupHeader: { alignItems: "center", flexDirection: "row", diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx index edbcdd41..cfc03b97 100644 --- a/apps/web/src/components/SettingsPane.tsx +++ b/apps/web/src/components/SettingsPane.tsx @@ -2,6 +2,7 @@ import { ChevronLeft, ChevronRight, Database, + Info, LayoutTemplate, Shield, SlidersHorizontal, @@ -11,6 +12,7 @@ import { } from "lucide-react"; import { useState, type ReactNode } from "react"; import { useTranslation } from "react-i18next"; +import { SystemInfoDialog } from "@/components/SystemInfoDialog"; import { Button } from "@/components/ui/button"; import type { ShortcutSettings } from "@/lib/app-helpers"; import { WORKSPACE_PAGE_TITLE_CLASSNAME } from "@/lib/workspace-ui"; @@ -85,6 +87,7 @@ export const SettingsPane = ({ const { t } = useTranslation(); const [activeTab, setActiveTab] = useState("general"); const [activeMobileTab, setActiveMobileTab] = useState(null); + const [systemInfoOpen, setSystemInfoOpen] = useState(false); const tabItems: TabItem[] = [ { @@ -320,7 +323,23 @@ export const SettingsPane = ({ ); })} - + + setSystemInfoOpen(true)} + className="flex min-h-16 w-full items-center justify-between gap-3 px-4 py-2.5 text-left text-slate-600 transition-colors hover:bg-slate-200/50 hover:text-slate-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500/70" + > + + + + + + {t("systemInfo.title")} + {t("systemInfo.description")} + + + + @@ -332,6 +351,7 @@ export const SettingsPane = ({ )} + ); };