Deduplicate high-frequency socket metadata updates

This commit is contained in:
Lawrence Chen 2026-02-20 23:30:59 -08:00
parent 021cc05cf3
commit 68cf29cd2d
3 changed files with 161 additions and 12 deletions

View file

@ -559,7 +559,7 @@ final class Workspace: Identifiable, ObservableObject {
panelDirectories[panelId] = trimmed
}
// Update current directory if this is the focused panel
if panelId == focusedPanelId {
if panelId == focusedPanelId, currentDirectory != trimmed {
currentDirectory = trimmed
}
}
@ -616,7 +616,10 @@ final class Workspace: Identifiable, ObservableObject {
func recomputeListeningPorts() {
let unique = Set(surfaceListeningPorts.values.flatMap { $0 })
listeningPorts = unique.sorted()
let next = unique.sorted()
if listeningPorts != next {
listeningPorts = next
}
}
// MARK: - Panel Operations