Workout Creator Integration/Standardization#225
Conversation
New <workout-dialog> component wrapping <app-dialog> for the workout goal picker. Manages distance/time/calories workout types with increment buttons and running total. Uses CSS variables for proper theming support. AI-assisted-by: Claude (Anthropic)
Route workout interval settings through the shared WebSocket connection instead of creating a separate socket per command. AI-assisted-by: Claude (Anthropic)
Add _dialog state and workout-open event listener following the connectedCallback/disconnectedCallback pattern for retile-mode branch compatibility. AI-assisted-by: Claude (Anthropic)
Metric tile clicks now dispatch proper DOM events that bubble through shadow DOM boundaries instead of bypassing the component tree via window-level events. AI-assisted-by: Claude (Anthropic)
Replaced by the WorkoutDialog Lit component with proper AppDialog integration, event bubbling, and theme support. AI-assisted-by: Claude (Anthropic)
|
@JaapvanEkris I will test this new, can we include it in 0.9.7 please? |
Rework the dialog structure and CSS for better responsiveness and
cleaner markup. Use CSS grid for button layout (to ensure euqal size) with automatic wrapping
on small screens, and simplify the HTML by removing wrapper elements.
Key changes:
- Add :host { position: absolute } for proper dialog positioning
- Switch increment buttons from flexbox to CSS grid with 4-column layout
- Add responsive 2-column grid for screens below 425px
- Replace popup-title div with semantic legend element
- Remove wrapper div, flatten dialog content structure
- Move reset button into grid with full-row span
- Apply button styles via element selector instead of classes
- Add hover and active states to all buttons
- Add user-select: none and white-space: nowrap to buttons
No problem. 0.9.7 is closing Sunday evening, and this seems a good idea to include. Can wait a day or two if needed, but Abasz also wants to move to the new CI/CD pipeline. For me 0.9.7 will close with a large addittion to the fit-files. End this year RowsAndAll will close (the only site capable of showing all our metrics) and intervals.icu will take over (RowsAndAll's owner is porting the functionality) As that creates an externally imposed deadline to keep data flowing, I want to make sure that we are 99% ready for that move now, as it otherwise would put a lot of pressure on 0.9.8 to be ready when RowsAndAll really pulls the plug. The FIT definition had a lot of moving parts on all side, but it seems to have come together yesterday (already got a working prototype). |
|
I made some changes this is how this looks like:
Small screen
Button hover and click:
Unless @DXCanas or @NickOldfield has any comments this can be merged tomorrow. |
Always a fan of less wrappers, personally. Lgtm 😊 |
|
It looks good! Thanks for fine tuning and the improvements. |
|
Guys, one kind of bug: when you set a time/distance/calorie target, the large number line has a unit (m/m/kcal), but this unit is also noted below it. I propose to remove it from the number-line, and onlu show it below the number line, |
Ha, I just caught that while trying it out yesterday during a workout. I’m running around most of today but I’ll try and get that in before EOD |
|
@JaapvanEkris Actually, I'm seeing the reasoning there's logic in place to change between "m" and "k" once the workout goes hits 10k: If we want to keep that logic, we could just remove the "m" and keep "metres". Going to stick with "metres" to keep the standard going -- kcal and minutes don't have units in the number display. |
Replace manual CustomEvent dispatching with handler function passed through template factory. Now follows the same pattern as DashboardForceCurve where click handlers are methods, not inline event creation. - Handler passed as third parameter to metric templates - Clean @click syntax: @click=${() => onWorkoutOpen?.('distance')} - Removes connectedCallback/disconnectedCallback event listeners AI-assisted-by: Claude (Anthropic)
Change distance display from 99999.5m to 999.5m threshold for switching to kilometer notation. Now displays "1K" instead of "1000m" consistency with the rest of the UI and general rowing parlance. AI-assisted-by: Claude (Anthropic)
df28e6f to
ec345bb
Compare
In rowing people generally talk about meters. Even on large distances like the marathon or the half century, it is still displayed in meters by design. Our GUI starts switching to kilometers above 99,999.5 meters.... |
|
Yeah — so the unit below is always going to say meters below the number line, as described. And the metric square will also always say it in raw meters. I think the “k” behavior was intended for visual space saving for kcal or when the number gets up there (100,000m vs 100k) You would rather leave it as the raw number no matter what? |
That is the behaviour of every monitor on the market today, including ORM. We only start trimming at 100K as it physically doesn't fit the tile. |
Per Jaap feedback, large numbers now show raw values only with units displayed separately below (except for 100k+). Matches standard behaviour. AI-assisted-by: Claude (Anthropic)
c4c05fc to
af34e30
Compare
af34e30 to
de9cc05
Compare






First off, thank you @NickOldfield for this contribution! 🎉 The workout goal feature is a great addition to the UI, and we (all users as well as the excellent maintainers) really appreciate you taking the time to implement it. This was clearly a thoughtful piece of work.
What this PR does
This PR refactors the contributed workout goal popup from
workout-bar.jsinto the project's Lit component architecture. The functionality remains identical—users can still click Distance/Timer/Calories tiles to set workout goals with the same increments and behavior.Why the refactor?
While the original implementation worked, integrating it into the existing component patterns should help with long-term maintainability. Here's what changed and why:
1. Component architecture alignment
document.createElement()calls<workout-dialog>) extendingAppElementSettingsDialog,DashboardToolbar, etc.Even if we eventually drop lit as a framework, the standardization of each component would make it much easier to port.
2. Event flow standardization
window.dispatchEvent()bypassing the component treebubbles: true, composed: true) that traverse shadow DOM3. Centralized WebSocket communication
handleAction()inapp.jshandleActionpattern used by other features (reset, upload, shutdown, etc.), simplifies things with standards.4. Dialog reuse
<app-dialog>component5. Theme compatibility
--theme-font-color,--theme-widget-color, etc.)6. Future compatibility
retile-modebranch (commit7bfbb31) that adds interactive dashboard customization. This refactor places dialog management onPerformanceDashboardusing the same pattern (_dialogstate +connectedCallbacklisteners), which should make that merge nearly conflict-free.What stayed the same
✅ All 3 workout types (distance, time, calories)
✅ All increment values and formatting
✅ User-facing behavior and UX
✅ WebSocket message format (
updateIntervalSettings)Technical changes
app/client/components/WorkoutDialog.js— Lit component with reactive stateapp/client/components/PerformanceDashboard.js— Dialog host with event listenerapp/client/lib/app.js— AddedupdateIntervalSettingstohandleActionapp/client/store/dashboardMetrics.js— Bubbling events instead of window eventsapp/client/workout-bar.js— Replaced by WorkoutDialog componentRelevant Notes
Again, huge thanks for the contribution!