diff --git a/CHANGELOG.md b/CHANGELOG.md index aacc8f6..f6a513f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ Squid 的重要变更记录在这里。版本号使用语义化版本,日期 - 重复文件支持“本组一份不剩”,删除仍走回收站并可撤销。 - 保留并接入安全扫描、隔离区与白名单机制;安全入口位于“安全”分组。 - 概览页采用新的三列指标布局,所有页面一级标题下不再重复二级描述。 +- 主界面的更新提示现在直接打开“设置 → 更新”分区。 +- macOS 隐藏仅依赖 Windows 服务的“系统维护”,权限管理只保留开机启动项页签。 ## [0.1.11] - 2026-11-22 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8180fbf..56a7bb1 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,5 +7,7 @@ Squid 0.1.13 - 右键菜单扩展按软件分组,重复文件支持“本组一份不剩”,删除均走回收站。 - 保留安全扫描、隔离区与白名单机制,可在“安全扫描”页和设置的安全分区管理。 - 所有页面一级标题下不再显示二级描述,标题末尾不再带句号。 +- 点击主界面的更新提示会直接打开“设置 → 更新”分区。 +- macOS 版隐藏仅支持 Windows 的系统维护模块;权限管理保留开机启动项。 macOS 与 Windows 安装包均为未签名构建。macOS 首次打开请在访达中右键选择“打开”;Windows SmartScreen 提示时选择“更多信息” > “仍要运行”。 diff --git a/src/App.tsx b/src/App.tsx index 3f1bde6..129b5f9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -39,7 +39,7 @@ import { MaintenanceHubPage, type MaintTab } from "./pages/MaintenanceHubPage"; import { OverviewPage } from "./pages/OverviewPage"; import { PermissionsPage } from "./pages/PermissionsPage"; import { SecurityPage } from "./pages/SecurityPage"; -import { SettingsPage } from "./pages/SettingsPage"; +import { SettingsPage, type SettingsTab } from "./pages/SettingsPage"; import { SpaceHubPage, type SpaceTab } from "./pages/SpaceHubPage"; import { SystemPage } from "./pages/SystemPage"; import { WidgetPage } from "./pages/WidgetPage"; @@ -52,6 +52,7 @@ const NAV_GROUPS: { labelEn: string; labelZh: string; icon: typeof LayoutDashboard; + windowsOnly?: boolean; }[]; }[] = [ { @@ -81,6 +82,7 @@ const NAV_GROUPS: { labelEn: "System maintenance", labelZh: "系统维护", icon: Wrench, + windowsOnly: true, }, ], }, @@ -221,6 +223,7 @@ export default function App() { // tab; the selection resets on every navigate so a later click re-arms it. const [spaceTab, setSpaceTab] = useState("junk"); const [maintTab, setMaintTab] = useState("repair"); + const [settingsTab, setSettingsTab] = useState("general"); const [autostart, setAutostart] = useState(false); // A process row can ask "where did this come from"; the monitor opens the // process tab already filtered to that path. @@ -332,7 +335,7 @@ export default function App() { }, [security]); useEffect(() => { - const order: PageId[] = [ + const order: PageId[] = ([ "overview", "space", "applications", @@ -342,12 +345,15 @@ export default function App() { "system", "widget", "history", - ]; + ] as PageId[]).filter( + (id) => id !== "maintenance" || bootstrap?.platform === "windows", + ); // Ctrl/Cmd+1..9 follow the sidebar; 0 opens settings. const onKey = (event: KeyboardEvent) => { if (!(event.metaKey || event.ctrlKey) || event.altKey || event.shiftKey) return; if (event.key === "0") { event.preventDefault(); + setSettingsTab("general"); setPage("settings"); return; } @@ -358,7 +364,7 @@ export default function App() { }; window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); - }, []); + }, [bootstrap?.platform]); const changeLanguage = useCallback( async (nextLanguage: Language) => { @@ -396,6 +402,11 @@ export default function App() { } }, [push]); + const openSettings = useCallback((tab: SettingsTab = "general") => { + setSettingsTab(tab); + setPage("settings"); + }, []); + if (bootError) return ; if (!bootstrap || !settings) return ; @@ -411,6 +422,7 @@ export default function App() { bootstrap={bootstrap} page={page} setPage={setPage} + onOpenSettings={openSettings} updateVersion={activeUpdate?.availableVersion ?? null} security={security.status} > @@ -440,12 +452,19 @@ export default function App() { {page === "applications" ? ( setPage("history")} /> ) : null} - {page === "permissions" ? : null} + {page === "permissions" ? ( + + ) : null} {page === "security" ? ( setPage("permissions")} /> ) : null} {page === "widget" ? : null} - {page === "maintenance" ? : null} + {page === "maintenance" ? ( + + ) : null} {page === "system" ? ( void; + onOpenSettings: (tab?: SettingsTab) => void; updateVersion: string | null; security: SecurityStatus | null; children: ReactNode; @@ -530,7 +552,11 @@ function AppChrome({ {lang === "zh" ? group.labelZh : group.labelEn} - {group.items.map((item) => { + {group.items + .filter( + (item) => !item.windowsOnly || bootstrap.platform === "windows", + ) + .map((item) => { const Icon = item.icon; return ( diff --git a/src/pages/MaintenanceHubPage.tsx b/src/pages/MaintenanceHubPage.tsx index a0ebde9..df28198 100644 --- a/src/pages/MaintenanceHubPage.tsx +++ b/src/pages/MaintenanceHubPage.tsx @@ -1,7 +1,7 @@ import { EyeOff, SlidersHorizontal, Wrench } from "lucide-react"; import { useEffect, useState } from "react"; import { useI18n } from "../i18n"; -import { PageHeader } from "../components/ui"; +import { EmptyState, PageHeader } from "../components/ui"; import { MaintenancePage } from "./MaintenancePage"; import { PrivacyPage } from "./PrivacyPage"; import { OptimizationPage } from "./OptimizationPage"; @@ -18,7 +18,13 @@ const TABS: { id: MaintTab; icon: typeof Wrench; en: string; zh: string }[] = [ { id: "optimize", icon: SlidersHorizontal, en: "System optimisation", zh: "系统优化" }, ]; -export function MaintenanceHubPage({ initialTab = "repair" }: { initialTab?: MaintTab }) { +export function MaintenanceHubPage({ + initialTab = "repair", + platform, +}: { + initialTab?: MaintTab; + platform?: string; +}) { const { t } = useI18n(); const [tab, setTab] = useState(initialTab); useEffect(() => setTab(initialTab), [initialTab]); @@ -26,6 +32,25 @@ export function MaintenanceHubPage({ initialTab = "repair" }: { initialTab?: Mai const report = (id: MaintTab) => (value: string | null) => setBadges((current) => (current[id] === value ? current : { ...current, [id]: value })); + // Repairs, privacy traces and optimisation switches are all Windows + // registry / command surfaces. Say so instead of offering buttons that + // can only answer "not available on this platform". + if (platform !== "windows") { + return ( +
+ + } + title={t("Windows only", "目前仅支持 Windows")} + description={t( + "Repairs, privacy traces and optimisation switches rely on Windows services and the registry. macOS keeps the security scan, startup items and cleanup tools.", + "一键修复、隐私清理与系统优化依赖 Windows 服务与注册表。macOS 版保留安全扫描、启动项与清理工具。", + )} + /> +
+ ); + } + return (
>(new Set()); @@ -114,9 +120,8 @@ export function PermissionsPage({ workspace }: { workspace: PermissionsWorkspace const [removingIds, setRemovingIds] = useState(null); const view = workspace.view; - const tabs = useMemo( - () => - [ + const tabs = useMemo(() => { + const all = [ { id: "startup" as const, label: t("Startup items", "开机启动项"), @@ -141,9 +146,11 @@ export function PermissionsPage({ workspace }: { workspace: PermissionsWorkspace count: view?.rules.length ?? 0, fresh: false, }, - ], - [t, view, workspace.advanced], - ); + ]; + // Context menus, advanced autostart hooks and the popup blocker are + // Windows shell surfaces; macOS only has login/background startup items. + return platform === "windows" ? all : all.filter((item) => item.id === "startup"); + }, [platform, t, view, workspace.advanced]); if (!view && workspace.scanning) { return ( diff --git a/src/pages/SettingsPage.tsx b/src/pages/SettingsPage.tsx index ec9dcf1..dc4407e 100644 --- a/src/pages/SettingsPage.tsx +++ b/src/pages/SettingsPage.tsx @@ -41,7 +41,7 @@ import { useToast, } from "../components/ui"; -type SettingsTab = "general" | "cleanup" | "security" | "updates" | "about"; +export type SettingsTab = "general" | "cleanup" | "security" | "updates" | "about"; const SETTINGS_TABS: { id: SettingsTab; @@ -62,6 +62,7 @@ export function SettingsPage({ flow, autoCheck, security, + initialTab = "general", onSettingsChange, onLanguageChange, onAutoCheckChange, @@ -71,13 +72,14 @@ export function SettingsPage({ flow: UpdateFlow; autoCheck: boolean; security: SecurityWorkspace; + initialTab?: SettingsTab; onSettingsChange: (settings: SettingsView) => void; onLanguageChange: (language: Language) => Promise; onAutoCheckChange: (enabled: boolean) => void; }) { const { t, lang, bin } = useI18n(); const { push } = useToast(); - const [tab, setTab] = useState("general"); + const [tab, setTab] = useState(initialTab); const [whitelistInput, setWhitelistInput] = useState(""); const [saving, setSaving] = useState(false); const [error, setError] = useState(null); @@ -90,6 +92,12 @@ export function SettingsPage({ const [audit, setAudit] = useState | null>(null); const [auditing, setAuditing] = useState(false); + // The sidebar/topbar update prompt opens Settings on its Updates section; + // a later plain Settings click asks for General and lands there. + useEffect(() => { + setTab(initialTab); + }, [initialTab]); + const runAudit = useCallback(async () => { setAuditing(true); try {