diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d6cfea..824758a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,10 @@ newest release first. The app and release workflow read these version headings. - Sign releases with kururu's Apple Developer ID and notarize them through GitHub Actions. - Enable in-app updates from PathGao/kururu with Apple team and application identity verification. +### Fixed +- Place the disk trend toggle beside live activity and hide the trend when live activity is hidden. +- Keep display and keyboard backlight shortcut groups independently expandable. + ## [0.1.1] - 2026-09-15 ### Added diff --git a/Sources/Vorssaint/UI/MenuPanel/DiskSection.swift b/Sources/Vorssaint/UI/MenuPanel/DiskSection.swift index a42560c..54481a5 100644 --- a/Sources/Vorssaint/UI/MenuPanel/DiskSection.swift +++ b/Sources/Vorssaint/UI/MenuPanel/DiskSection.swift @@ -26,7 +26,7 @@ struct DiskSection: View { PanelSection(.disk, title: AppFeature.monitorDisk.name(l10n.s, language: l10n.language), collapsible: collapsible, supportsEditing: true, resetAction: resetPanelDefaults) { editing in - if !editing { MonitorTrendView(metrics: [.diskRead, .diskWrite]) } + if !editing && diskActivity { MonitorTrendView(metrics: [.diskRead, .diskWrite]) } VStack(alignment: .leading, spacing: 12) { if disks.isEmpty { Text(l10n.s.diskNoDisks) diff --git a/Sources/Vorssaint/UI/Settings/MonitorPanelConfig.swift b/Sources/Vorssaint/UI/Settings/MonitorPanelConfig.swift index 27e58ce..ec7da58 100644 --- a/Sources/Vorssaint/UI/Settings/MonitorPanelConfig.swift +++ b/Sources/Vorssaint/UI/Settings/MonitorPanelConfig.swift @@ -102,9 +102,9 @@ struct MonitorPanelConfig: View { } } if AppFeature.monitorDisk.isAvailable { - block(.disk, title: AppFeature.monitorDisk.name(l10n.s, language: l10n.language), master: $showDisk, graphKey: DefaultsKey.monitorGraphDisk) { + block(.disk, title: AppFeature.monitorDisk.name(l10n.s, language: l10n.language), master: $showDisk) { MonitorGraphVisibilityRow(title: l10n.s.monitorItemDiskUsage, visible: $diskUsage) - MonitorGraphVisibilityRow(title: l10n.s.monitorItemDiskActivity, visible: $diskActivity) + MonitorGraphVisibilityRow(title: l10n.s.monitorItemDiskActivity, visible: $diskActivity, graphKey: DefaultsKey.monitorGraphDisk, sectionVisible: showDisk) MonitorGraphVisibilityRow(title: l10n.s.monitorItemDiskSMART, visible: $diskSMART) MonitorGraphVisibilityRow(title: l10n.s.monitorItemDiskProtection, visible: $diskProtection) MonitorGraphVisibilityRow(title: l10n.s.monitorItemDiskTools, visible: $diskTools) @@ -172,7 +172,6 @@ struct MonitorPanelConfig: View { private func block(_ id: PanelSectionID, title: String, master: Binding, - graphKey: String? = nil, @ViewBuilder _ items: @escaping () -> Content) -> some View { HStack(spacing: 12) { DisclosureHeaderRow(isExpanded: expansionBinding(for: id)) { @@ -183,10 +182,6 @@ struct MonitorPanelConfig: View { Text(title).font(.system(size: 13, weight: .medium)) Spacer() } - if let graphKey { - MonitorGraphSwitch(title: title, key: graphKey) - .disabled(!master.wrappedValue) - } Toggle(l10n.s.monitorShowInPanel, isOn: master) .toggleStyle(.switch).controlSize(.small) .labelsHidden() diff --git a/Sources/Vorssaint/UI/Settings/ShortcutsSettings.swift b/Sources/Vorssaint/UI/Settings/ShortcutsSettings.swift index 89bae9c..c44f703 100644 --- a/Sources/Vorssaint/UI/Settings/ShortcutsSettings.swift +++ b/Sources/Vorssaint/UI/Settings/ShortcutsSettings.swift @@ -13,7 +13,7 @@ struct ShortcutsSettings: View { @ObservedObject private var superKey = SuperKeyService.shared @AppStorage(DefaultsKey.keyboardBrightnessShortcutsEnabled) private var keyboardBrightnessShortcutsEnabled = false @AppStorage(BrightnessShortcutPreferenceKey.enabled) private var displayBrightnessShortcutsEnabled = false - @State private var expandedFeatures: Set = [.screenshot] + @State private var expandedFeatures: [FeatureGroup: Set] = [.capture: [.screenshot]] @State private var showsAppShortcuts = false @State private var historyRevision = 0 @State private var failedRoles: Set = [] @@ -117,8 +117,8 @@ struct ShortcutsSettings: View { symbolName: AppFeature.screenshot.symbolName, isActive: featureHasActiveShortcut(.screenshot, roles: roles), count: roles.count, - isExpanded: expansionBinding(for: .screenshot)) - if expandedFeatures.contains(.screenshot) { + isExpanded: expansionBinding(for: .screenshot, in: .capture)) + if expandedFeatures[.capture, default: []].contains(.screenshot) { ForEach(roles) { role in roleRow(role, showsFeatureContext: false) .disclosureIndent() @@ -136,8 +136,8 @@ struct ShortcutsSettings: View { symbolName: featureSymbol(feature, roles: roles), isActive: featureHasActiveShortcut(feature, roles: roles), count: count, - isExpanded: expansionBinding(for: feature)) - if expandedFeatures.contains(feature) { + isExpanded: expansionBinding(for: feature, in: group)) + if expandedFeatures[group, default: []].contains(feature) { if feature == .brightness { if roles.allSatisfy(\.isKeyboardBrightness) { KeyboardBrightnessShortcutToggle(isEnabled: $keyboardBrightnessShortcutsEnabled) @@ -223,14 +223,14 @@ struct ShortcutsSettings: View { ) } - private func expansionBinding(for feature: AppFeature) -> Binding { + private func expansionBinding(for feature: AppFeature, in group: FeatureGroup) -> Binding { Binding { - expandedFeatures.contains(feature) + expandedFeatures[group, default: []].contains(feature) } set: { expanded in if expanded { - expandedFeatures.insert(feature) + expandedFeatures[group, default: []].insert(feature) } else { - expandedFeatures.remove(feature) + expandedFeatures[group, default: []].remove(feature) } } } diff --git a/Tests/MetricsTests.swift b/Tests/MetricsTests.swift index 0cd6d95..3bc33d9 100644 --- a/Tests/MetricsTests.swift +++ b/Tests/MetricsTests.swift @@ -24168,7 +24168,7 @@ UninstallerSelectionTests.run { expect($0, $1) } // Display controls belong to the panel page; collection stays in monitoring. let panelConfigCode = codeLines("Sources/Vorssaint/UI/Settings/MonitorPanelConfig.swift") let trendCode = codeLines("Sources/Vorssaint/UI/MenuPanel/MonitorTrendView.swift") - expect(occurrences("MonitorGraphSwitch", panelConfigCode) == 4 + expect(occurrences("MonitorGraphSwitch", panelConfigCode) == 3 && occurrences("selection: $historyMinutes", panelPageCode) == 1 && occurrences("monitorGraph", monitorPageCode) == 0 && occurrences("Picker(", trendCode) == 0,