Stop the sync poll from rebuilding the panel every 5 s
@Published fires even when the assigned value is unchanged, so the poll's unconditional lastError = nil invalidated PanelView — which observes SyncService — every 5 seconds, forever, hidden or visible. Over five days that was ~185 CPU-minutes and ~190 MB, and clicks started to lag. - Route poll state through setError, which skips equal values. - Watch SyncService from a tiny SyncDot view instead of the panel body. - Skip the URL cache on polls and give them timeouts. - Only reassign the composer placeholder when it changed.
This commit is contained in:
@@ -67,7 +67,9 @@ struct ComposerView: NSViewRepresentable {
|
||||
textView.string = text
|
||||
updateHeight(textView)
|
||||
}
|
||||
textView.placeholderText = placeholder
|
||||
if textView.placeholderText != placeholder {
|
||||
textView.placeholderText = placeholder
|
||||
}
|
||||
if isFocused, scrollView.window?.firstResponder != textView {
|
||||
scrollView.window?.makeFirstResponder(textView)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user