Skip to content

feat: add focus workout view - #222

Closed
giulioleuci wants to merge 5 commits into
DuarteSantos8:mainfrom
giulioleuci:feat/card-view
Closed

giulioleuci wants to merge 5 commits into
DuarteSantos8:mainfrom
giulioleuci:feat/card-view

Conversation

@giulioleuci

@giulioleuci giulioleuci commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #221

Implements the Focus workout view — a fourth, purely presentational layout for the active workout screen, one set at a time.

What this adds

  • One set at a time: a large card with the exercise, its preset target (reps / load / RPE / rest / tempo) and big tactile steppers for load (uses the exercise's increment) and reps.
  • Complete / Skip / pager: a full-width Complete button routed through the existing toggle path — sound, haptics, rest timer, progression, high-water protection all shared with the other layouts; Skip advances without completing; a footer pager (chevrons + one dot per set) navigates directly.
  • Supersets: round-by-round flow (A1 → B1 → A2 → B2), one member at a time, with round indicator and in-superset chevrons.
  • Special set types: warm-up, drop-sets, bursts, timed sets, and unilateral L/R sets keep their existing behaviour.
  • Locking: editing a set is disabled until every earlier set in the exercise is complete; finishing the last set auto-advances to the next unfinished exercise.
  • Settings & persistence: "Focus" added to the Settings → Workout view Segmented and to the header ⋮ layout menu; the choice snapshots onto s.active.workoutView and falls back to cards for unknown values.

Not in scope

  • No changes to persisted model, finished-workout data or progression rules — the layout is pure presentation over the existing s.active session.
  • Stepper / Slider gained optional disabled / onStep / ariaLabel props to power the focus card; all existing layouts render as before.

Tests

  • New workout focus view describe block in Workout.test.jsx (focus rendering, set navigation, completion auto-advance, superset round flow, unilateral sets).
  • Updated Settings.workoutview.test.jsx, sheets.workoutview.test.jsx, ui.test.jsx for the 4-way control and the new Stepper/Slider props.
  • Full suite green: 1392 tests passed.
Schermata del 2026-09-20 14-28-26 Schermata del 2026-09-20 14-28-20 Schermata del 2026-09-17 22-13-52 Schermata del 2026-09-17 22-13-40

@giulioleuci

Copy link
Copy Markdown
Contributor Author

Implement #221

@kurktchiev

Copy link
Copy Markdown
Contributor

Do you have screenshots of what this looks like?

@giulioleuci

giulioleuci commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor Author

I added two images to the PR message. In my app, I only have this view because it works well for me. https://github.com/giulioleuci/test-app-workout-alpha

@kurktchiev

Copy link
Copy Markdown
Contributor

How does this work with timed exercises?

@giulioleuci

Copy link
Copy Markdown
Contributor Author

I have updated the screenshots in the PR to visually demonstrate this UI behavior.

In the Focus view for timed sets (mode === 'time'), the interface presents the user with their target hold time (e.g., "45s hold") and a dedicated Start button rather than the standard repetition stepper.

Tapping Start triggers an interactive on-screen countdown timer. Once the timer completes—or if the user stops it early—the app automatically captures and logs the exact duration held (for instance, recording 38 seconds if stopped early instead of the target 45 seconds). Upon logging, a brief "Hold logged" notification appears, and the app smoothly transitions into the standard post-set routine, whether that means initiating the rest timer, advancing to the next exercise in a superset, or prompting workout completion.

Ultimately, timed sets fit right into the existing completion workflow; they simply replace manual rep logging with a guided countdown experience.

@DuarteSantos8

Copy link
Copy Markdown
Owner

Thanks @giulioleuci, and for the screenshots. A focus view makes sense to me. It wasn't in v1.3.9 because the workout screen changed a lot in this release (plan line, keyboard shortcuts, rest pause, per-exercise "Don't count for progression", swipe preview, plate lines), so it needs a rebase onto v1.3.9.

For the next round: every new string in all locale packs (the check fails otherwise), no docs/superpowers spec in the repo, and keyboard Space/Enter should behave the same as in the other views.

@giulioleuci

Copy link
Copy Markdown
Contributor Author

Hi @DuarteSantos8 ,

  • I rebased (but I don't upload the new images).
  • I added the new translation strings (translated by OpenCode Zen).
  • I deleted the superpowers files.

giulioleuci and others added 5 commits October 8, 2026 21:06
…n the focus view

The focus view was missing what the card view already showed: the planned
sets and reps beside today's prescription, the plate stack (and what is short)
under each set, and the per-exercise switch that keeps an exercise out of the
progression. A burst now takes its rest from the exercise's rest-pause setting
when there is one, instead of the global default.

Focus and card views share the key handler, so the Enter/Space case is asserted
in both. Drops the design spec: it is agent scratch, like the gitignored
plans/ folder next to it.
Rest start carries the set it follows, the en dash for an empty value, the
Layout menu test follows the grouped menu, zh-TW gets the focus strings and
the stale em-dash duplicate of the minimum-duration message is dropped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
crstnmac added a commit to crstnmac/openGym that referenced this pull request Oct 9, 2026
# Conflicts:
#	frontend/src/locales/ar.js
#	frontend/src/locales/de.js
#	frontend/src/locales/es.js
#	frontend/src/locales/fr.js
#	frontend/src/locales/hi.js
#	frontend/src/locales/hu.js
#	frontend/src/locales/it.js
#	frontend/src/locales/ko.js
#	frontend/src/locales/pl.js
#	frontend/src/locales/pt-BR.js
#	frontend/src/locales/pt.js
#	frontend/src/locales/ru.js
#	frontend/src/locales/th.js
#	frontend/src/locales/tr.js
#	frontend/src/locales/uk.js
#	frontend/src/locales/zh-TW.js
#	frontend/src/locales/zh.js
#	frontend/src/views/Workout.jsx
crstnmac added a commit to crstnmac/openGym that referenced this pull request Oct 9, 2026
@DuarteSantos8

Copy link
Copy Markdown
Owner

Merged into v1.4.0, thanks @giulioleuci!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Focus workout view — one set at a time

3 participants