File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ final class CloudTreeNode: NSObject {
9696 case . placeholder: return " placeholder "
9797 }
9898 }
99-
99+ /// Port discovery is demand-driven when the user opens the Ports group.
100+ var refreshesOnExpansion : Bool { if case . portsGroup = kind { true } else { false } }
100101 /// Copies the values of an equal-structure rebuild into this node (NSOutlineView keeps
101102 /// the object it was handed; updating it in place keeps rows, expansion and the
102103 /// selection untouched). Children are adopted pairwise — callers guarantee the
@@ -108,7 +109,6 @@ final class CloudTreeNode: NSObject {
108109 child. adopt ( from: replacement)
109110 }
110111 }
111-
112112 var machine : SurfaceMachineID {
113113 switch kind {
114114 case . machine( let snapshot, _) : return . cloud( snapshot. id)
Original file line number Diff line number Diff line change @@ -369,7 +369,6 @@ struct CloudTreeOutlineView: NSViewRepresentable {
369369 func outlineView( _ outlineView: NSOutlineView , shouldSelectItem item: Any ) -> Bool {
370370 true
371371 }
372-
373372 func outlineViewSelectionDidChange( _ notification: Notification ) {
374373 guard !isUpdatingProgrammatically, let outlineView else { return }
375374 selectedNodeID = outlineView. selectedRow >= 0
@@ -380,6 +379,7 @@ struct CloudTreeOutlineView: NSViewRepresentable {
380379 func outlineViewItemDidExpand( _ notification: Notification ) {
381380 guard !isUpdatingProgrammatically, let node = notification. userInfo ? [ " NSObject " ] as? CloudTreeNode else { return }
382381 expansionStore. setExpanded ( true , node: node)
382+ if node. refreshesOnExpansion { nodeActions. refresh ( ) }
383383 }
384384
385385 func outlineViewItemDidCollapse( _ notification: Notification ) {
You can’t perform that action at this time.
0 commit comments