Parlellsession- Plan #35

Merged
Lars merged 34 commits from develop into main 2026-05-15 22:04:53 +02:00
2 changed files with 34 additions and 3 deletions
Showing only changes of commit 4902771772 - Show all commits

View File

@ -1173,8 +1173,28 @@ export default function TrainingUnitSectionsEditor({
enableParallelPhaseControls &&
pl?.phaseKind === 'parallel' &&
(pl.parallelStreamOrderIndex ?? 0) !== activeParallelStream
const firstGlobalIdxThisPhase =
parallelPhaseOrder != null
? firstSectionIndexByParallelPhase.get(parallelPhaseOrder)
: null
const firstVisibleIdxActiveStream =
parallelPhaseOrder != null && streamOrdersForParallelPhase.length
? sectionIndicesForParallelStream(
list,
parallelPhaseOrder,
activeParallelStream
)[0]
: null
const hideDropBandBeforeOrphanFirstVisible =
parallelPhaseOrder != null &&
firstVisibleIdxActiveStream != null &&
sIdx === firstVisibleIdxActiveStream &&
firstGlobalIdxThisPhase != null &&
sIdx !== firstGlobalIdxThisPhase
const showSectionDropBandBefore =
pl?.phaseKind !== 'parallel' || !hideParallelSection
(pl?.phaseKind !== 'parallel' || !hideParallelSection) &&
!hideDropBandBeforeOrphanFirstVisible
const bandActiveBefore = (bx) =>
enableSectionDragReorder &&

View File

@ -814,7 +814,19 @@ export function reorderBlocksImmutableWithPlanLoc(prev, fromI, toBeforeIdx) {
const above = insertAt > 0 ? arr[insertAt - 1] : undefined
let planLocNext = null
if (below?.planLoc?.phaseKind) {
const belowKind = below?.planLoc?.phaseKind
const aboveKind = above?.planLoc?.phaseKind
if (
belowKind === 'parallel' &&
(!above || aboveKind === 'whole_group')
) {
if (aboveKind === 'whole_group') {
planLocNext = { ...above.planLoc }
} else {
planLocNext = defaultPlanLocWholeGroup(0)
}
} else if (belowKind) {
planLocNext = { ...below.planLoc }
} else if (insertAt === arr.length) {
if (!above) {
@ -875,7 +887,6 @@ export function reorderBlockIntoParallelStreamEnd(prev, fromI, phaseOrderIndex,
insertAt = phaseIdx[phaseIdx.length - 1] + 1
}
if (fromI < insertAt) insertAt -= 1
insertAt = Math.max(0, Math.min(insertAt, arr.length))
arr.splice(insertAt, 0, { ...moved, planLoc: { ...planLocTemplate } })
return arr