@@ -131,8 +131,21 @@ struct ActionsTab: View {
131131 return ( rowIndex, actionIndex)
132132 }
133133 let actionIndexByRow = Dictionary ( uniqueKeysWithValues: actionIndices. map { ( $0. rowIndex, $0. actionIndex) } )
134- let actionSource = IndexSet ( source. compactMap { actionIndexByRow [ $0] } )
135- let actionDestination = actionIndices. prefix { $0. rowIndex < destination } . count
134+ var actionSource = IndexSet ( source. compactMap { actionIndexByRow [ $0] } )
135+ // Expand: if a group parent is being moved, include its sub-actions
136+ let sourceIDs = Set ( actionSource. map { coordinator. actions [ $0] . id } )
137+ for (index, action) in coordinator. actions. enumerated ( ) {
138+ if sourceIDs. contains ( where: { action. id. hasPrefix ( $0 + " . " ) } ) {
139+ actionSource. insert ( index)
140+ }
141+ }
142+ guard !actionSource. isEmpty else { return }
143+ let actionDestination : Int
144+ if let firstAtOrAfter = actionIndices. first ( where: { $0. rowIndex >= destination } ) {
145+ actionDestination = firstAtOrAfter. actionIndex
146+ } else {
147+ actionDestination = coordinator. actions. count
148+ }
136149 coordinator. moveActions ( from: actionSource, to: actionDestination)
137150 }
138151
@@ -152,6 +165,7 @@ struct ActionsTab: View {
152165 case . packageHeader( let packageID, let title, let gatedReason) :
153166 PackageHeaderRowView ( packageID: packageID, title: title, gatedReason: gatedReason, disabledPackages: $disabledPackages)
154167 . tag ( row. id)
168+ . moveDisabled ( true )
155169 case . groupParent( let action) :
156170 ActionRowView (
157171 action: action,
0 commit comments