惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Last Week in AI
Last Week in AI
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
宝玉的分享
宝玉的分享
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
博客园 - 聂微东
S
SegmentFault 最新的问题
博客园 - 司徒正美
罗磊的独立博客
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
小众软件
小众软件
Jina AI
Jina AI

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(mac): keep settings panes warm · openclaw/openclaw@1f...
steipete · 2026-05-17 · via Recent Commits to openclaw:main

@@ -7,15 +7,18 @@ struct SettingsRootView: View {

77

private let permissionMonitor = PermissionMonitor.shared

88

@State private var monitoringPermissions = false

99

@State private var selectedTab: SettingsTab = .general

10+

@State private var cachedTabs: Set<SettingsTab>

1011

@State private var snapshotPaths: (configPath: String?, stateDir: String?) = (nil, nil)

1112

let updater: UpdaterProviding?

1213

private let isPreview = ProcessInfo.processInfo.isPreview

1314

private let isNixMode = ProcessInfo.processInfo.isNixMode

14151516

init(state: AppState, updater: UpdaterProviding?, initialTab: SettingsTab? = nil) {

17+

let initial = initialTab ?? .general

1618

self.state = state

1719

self.updater = updater

18-

self._selectedTab = State(initialValue: initialTab ?? .general)

20+

self._selectedTab = State(initialValue: initial)

21+

self._cachedTabs = State(initialValue: [initial])

1922

}

20232124

var body: some View {

@@ -37,7 +40,7 @@ struct SettingsRootView: View {

3740

if self.isNixMode {

3841

self.nixManagedBanner

3942

}

40-

self.detailView(for: self.selectedTab)

43+

self.cachedDetailViews

4144

}

4245

.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)

4346

.padding(.horizontal, 22)

@@ -49,14 +52,15 @@ struct SettingsRootView: View {

4952

.onReceive(NotificationCenter.default.publisher(for: .openclawSelectSettingsTab)) { note in

5053

if let tab = note.object as? SettingsTab {

5154

withAnimation(.spring(response: 0.32, dampingFraction: 0.85)) {

52-

self.selectedTab = tab

55+

self.selectedTab = self.validTab(for: tab)

5356

}

5457

}

5558

}

5659

.onAppear {

5760

if let pending = SettingsTabRouter.consumePending() {

5861

self.selectedTab = self.validTab(for: pending)

5962

}

63+

self.cacheSelectedTab()

6064

self.updatePermissionMonitoring(for: self.selectedTab)

6165

}

6266

.onChange(of: self.state.debugPaneEnabled) { _, enabled in

@@ -65,6 +69,7 @@ struct SettingsRootView: View {

6569

}

6670

}

6771

.onChange(of: self.selectedTab) { _, newValue in

72+

self.cachedTabs.insert(newValue)

6873

self.updatePermissionMonitoring(for: newValue)

6974

}

7075

.onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in

@@ -86,6 +91,11 @@ struct SettingsRootView: View {

8691

SettingsTabGroup.defaultGroups(showDebug: self.state.debugPaneEnabled)

8792

}

889394+

private var cachedDetailTabs: [SettingsTab] {

95+

let cached = self.cachedTabs.union([self.selectedTab])

96+

return self.visibleGroups.flatMap(\.tabs).filter { cached.contains($0) }

97+

}

98+8999

private var nixManagedBanner: some View {

90100

// Prefer gateway-resolved paths; fall back to local env defaults if disconnected.

91101

let configPath = self.snapshotPaths.configPath ?? OpenClawPaths.configURL.path

@@ -116,13 +126,27 @@ struct SettingsRootView: View {

116126

.cornerRadius(10)

117127

}

118128129+

private var cachedDetailViews: some View {

130+

ZStack(alignment: .topLeading) {

131+

ForEach(self.cachedDetailTabs) { tab in

132+

self.detailView(for: tab)

133+

.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)

134+

.opacity(tab == self.selectedTab ? 1 : 0)

135+

.allowsHitTesting(tab == self.selectedTab)

136+

.disabled(tab != self.selectedTab)

137+

.accessibilityHidden(tab != self.selectedTab)

138+

}

139+

}

140+

.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)

141+

}

142+119143

@ViewBuilder

120144

private func detailView(for tab: SettingsTab) -> some View {

121145

switch tab {

122146

case .general:

123-

GeneralSettings(state: self.state, page: .general)

147+

GeneralSettings(state: self.state, page: .general, isActive: self.selectedTab == tab)

124148

case .connection:

125-

GeneralSettings(state: self.state, page: .connection)

149+

GeneralSettings(state: self.state, page: .connection, isActive: self.selectedTab == tab)

126150

case .permissions:

127151

PermissionsSettings(

128152

status: self.permissionMonitor.status,

@@ -131,17 +155,17 @@ struct SettingsRootView: View {

131155

case .voiceWake:

132156

VoiceWakeSettings(state: self.state, isActive: self.selectedTab == .voiceWake)

133157

case .channels:

134-

ChannelsSettings()

158+

ChannelsSettings(isActive: self.selectedTab == tab)

135159

case .skills:

136160

SkillsSettings(state: self.state)

137161

case .cron:

138-

CronSettings()

162+

CronSettings(isActive: self.selectedTab == tab)

139163

case .execApprovals:

140164

ExecApprovalsSettings()

141165

case .sessions:

142166

SessionsSettings()

143167

case .instances:

144-

InstancesSettings()

168+

InstancesSettings(isActive: self.selectedTab == tab)

145169

case .config:

146170

ConfigSettings()

147171

case .debug:

@@ -156,6 +180,10 @@ struct SettingsRootView: View {

156180

return requested

157181

}

158182183+

private func cacheSelectedTab() {

184+

self.cachedTabs.insert(self.selectedTab)

185+

}

186+159187

@MainActor

160188

private func refreshSnapshotPaths() async {

161189

let paths = await GatewayConnection.shared.snapshotPaths()