fix(macos): keep menu width stable while open

This commit is contained in:
Peter Steinberger
2025-12-26 22:27:24 +01:00
parent c10a386d17
commit 1f25e38c2d
2 changed files with 2 additions and 11 deletions

View File

@@ -66,6 +66,7 @@
- Chat UI polish: tool call cards + merged tool results, glass background, tighter composer spacing, visual effect host tweaks.
- OAuth storage moved; legacy session syncing metadata removed.
- Remote SSH tunnels now get health checks; Debug → Ports highlights unhealthy tunnels and offers Reset SSH tunnel.
- Menu bar session/node sections no longer reflow while open, keeping hover highlights aligned.
### Nodes & Canvas
- Debug status overlay gated and toggleable on macOS/iOS/Android nodes.

View File

@@ -52,27 +52,17 @@ final class MenuSessionsInjector: NSObject, NSMenuDelegate {
self.inject(into: menu)
self.injectNodes(into: menu)
// Refresh in background for the next open (but only when connected).
// Refresh in background for the next open (but do not re-inject while open).
self.loadTask?.cancel()
self.loadTask = Task { [weak self] in
guard let self else { return }
await self.refreshCache(force: false)
await MainActor.run {
guard self.isMenuOpen else { return }
// SwiftUI might have refreshed menu items; re-inject once.
self.inject(into: menu)
self.injectNodes(into: menu)
}
}
self.nodesLoadTask?.cancel()
self.nodesLoadTask = Task { [weak self] in
guard let self else { return }
await self.nodesStore.refresh()
await MainActor.run {
guard self.isMenuOpen else { return }
self.injectNodes(into: menu)
}
}
}