From 00b22a756ffc661f660b0834fac79469e947b2c5 Mon Sep 17 00:00:00 2001 From: Lars Date: Wed, 6 May 2026 07:55:35 +0200 Subject: [PATCH] feat: refactor TrainingUnitSectionsEditor and enhance TrainingPlanningPage layout - Replaced the tu-ex-run-block with a new tu-ex-debrief layout using CSS Grid for improved structure and responsiveness. - Updated the TrainingUnitSectionsEditor component to utilize the new layout, enhancing the user experience for inputting modifications and actual durations. - Introduced a sectionsEditMode state in TrainingPlanningPage to manage different editing modes (planning, refine, debrief) for better user guidance. - Adjusted the visibility of execution extras based on the current editing mode, streamlining the interface for users. --- frontend/src/app.css | 54 ++++++++++++--- .../components/TrainingUnitSectionsEditor.jsx | 36 +++++----- frontend/src/pages/TrainingPlanningPage.jsx | 68 ++++++++++++++++++- 3 files changed, 133 insertions(+), 25 deletions(-) diff --git a/frontend/src/app.css b/frontend/src/app.css index 4ebd9a0..f916c44 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -3445,22 +3445,60 @@ a.analysis-split__nav-item { white-space: nowrap; } -.tu-ex-run-block { - display: block; +.tu-ex-debrief { + display: grid; + grid-template-columns: minmax(0, 1fr) 4.75rem; + gap: 10px 14px; + align-items: start; width: 100%; margin-top: 10px; - font-size: 0.78rem; + padding-top: 10px; + border-top: 1px solid var(--border2, rgba(0, 0, 0, 0.08)); + box-sizing: border-box; } -.tu-ex-run-block__controls { +.tu-ex-debrief__grow { + min-width: 0; display: flex; flex-direction: column; - gap: 6px; - margin-top: 5px; + gap: 5px; } -.tu-ex-run-block__controls .form-input:first-of-type { - max-width: 120px; +.tu-ex-debrief__textarea { + width: 100%; + max-width: 100%; + box-sizing: border-box; + min-height: 4.75rem; + resize: vertical; + font-size: 0.88rem; + line-height: 1.45; +} + +.tu-ex-debrief__ist { + display: flex; + flex-direction: column; + gap: 5px; + align-items: stretch; + justify-self: end; + width: 4.75rem; + flex-shrink: 0; +} + +.tu-ex-debrief__ist .tu-ex-duration { + width: 100%; + margin: 0; +} + +@media (max-width: 520px) { + .tu-ex-debrief { + grid-template-columns: 1fr; + } + + .tu-ex-debrief__ist { + width: 100%; + max-width: 10rem; + justify-self: start; + } } .tu-textedit-backdrop { diff --git a/frontend/src/components/TrainingUnitSectionsEditor.jsx b/frontend/src/components/TrainingUnitSectionsEditor.jsx index c355446..31daf70 100644 --- a/frontend/src/components/TrainingUnitSectionsEditor.jsx +++ b/frontend/src/components/TrainingUnitSectionsEditor.jsx @@ -763,30 +763,34 @@ export default function TrainingUnitSectionsEditor({ {showExecutionExtras ? ( -