Skip to content

Commit f11e994

Browse files
Refine exercise collapsible header in session logger (#117)
## Summary - Updated the exercise card render logic so each collapsible <summary> now shows only the exercise name (no metadata in the header). This also means cards are collapsed by default because the forced details.open = true behavior was removed. - Added an in-body metadata row (.exercise-info-row) inside each exercise collapsible and moved contextual info there: exercise notes, rep range (min_reps–max_reps or AMRAP), plus the previous-session chip when available. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_6996d5a2d1308325858b29cd250f1336)
1 parent 19de96c commit f11e994

1 file changed

Lines changed: 32 additions & 13 deletions

File tree

workout-session-logger.html

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@
113113
font-size: 0.95rem;
114114
}
115115

116+
.exercise-info-row {
117+
display: flex;
118+
flex-wrap: wrap;
119+
gap: 0.5rem;
120+
align-items: center;
121+
}
122+
116123
.template-grid {
117124
display: grid;
118125
gap: 0.75rem;
@@ -462,26 +469,37 @@ <h2 style="margin: 0;">Workout tools</h2>
462469
function renderExercise(block, draft) {
463470
const details = document.createElement('details');
464471
details.className = 'exercise-card';
465-
details.open = true;
466472

467473
const summary = document.createElement('summary');
468-
summary.innerHTML = `
469-
<div>
470-
<div>${block.exercise_name}</div>
471-
<div class="exercise-meta">${block.sets} sets${block.amrap ? ' · AMRAP' : ''}${block.notes ? ` · ${block.notes}` : ''}</div>
472-
</div>
473-
`;
474+
summary.textContent = block.exercise_name;
475+
476+
const repRangeLabel = block.amrap
477+
? 'AMRAP'
478+
: `${block.min_reps ?? 0}${block.max_reps ?? 0} reps`;
474479

475480
const previousChip = renderPreviousChip(block);
476-
if (previousChip) {
477-
const chipRow = document.createElement('div');
478-
chipRow.className = 'chip-row';
479-
chipRow.appendChild(previousChip);
480-
summary.appendChild(chipRow);
481-
}
482481

483482
const body = document.createElement('div');
484483
body.className = 'exercise-body';
484+
485+
const infoRow = document.createElement('div');
486+
infoRow.className = 'exercise-info-row';
487+
488+
const notesMeta = document.createElement('span');
489+
notesMeta.className = 'exercise-meta';
490+
notesMeta.textContent = block.notes || 'No exercise notes';
491+
492+
const repRangeMeta = document.createElement('span');
493+
repRangeMeta.className = 'exercise-meta';
494+
repRangeMeta.textContent = repRangeLabel;
495+
496+
infoRow.appendChild(notesMeta);
497+
infoRow.appendChild(repRangeMeta);
498+
499+
if (previousChip) {
500+
infoRow.appendChild(previousChip);
501+
}
502+
485503
const setsGrid = document.createElement('div');
486504
setsGrid.className = 'stack';
487505

@@ -517,6 +535,7 @@ <h2 style="margin: 0;">Workout tools</h2>
517535
progressionLabel.appendChild(progressionNotes);
518536
rpeLabel.appendChild(rpeInput);
519537

538+
body.appendChild(infoRow);
520539
body.appendChild(setsGrid);
521540
body.appendChild(progressionLabel);
522541
body.appendChild(rpeLabel);

0 commit comments

Comments
 (0)