Skip to content

Conversation

@DXCanas
Copy link

@DXCanas DXCanas commented Jan 26, 2026

WIP, first code contribution! Trying out an idea I had based on need expressed here:

Functionally: I hate wasting a tile on command buttons I use once per training (at a maximum).

#168 (reply in thread)

Also corrected a quirk in heigh calculation that led to the tiniest bit of scrolling.

Testing TBD, will try it on next workout.

Settings & Actions Toolbar

@Abasz
Copy link
Collaborator

Abasz commented Jan 26, 2026

This is brilliant, and its hilarious why I have not thought of this when I worked on the tiles years ago :D We could even hide it dynamically like windows task bar (though this will require some gesture support for touchscreens or we just show it on any click anywhere that also works) on smaller screens.

@DXCanas DXCanas force-pushed the settings-and-actions-dashboard branch from b4dc2c8 to 6bde3fa Compare January 26, 2026 22:24
@DXCanas DXCanas mentioned this pull request Jan 26, 2026
@JaapvanEkris
Copy link
Owner

JaapvanEkris commented Jan 27, 2026

Great work! What a space saver! I'll test this evening and accept the request when no issues are found

@Abasz
Copy link
Collaborator

Abasz commented Jan 27, 2026

Can it be that something is wrong with the slot tracker:

image

I can see that there is no option for action yet its here. I am suspecting we will need to clear (preferably update) local storage where these settings are saved. So we should run a simple migration I suppose where we swap out the actions to something else.

@DXCanas
Copy link
Author

DXCanas commented Jan 27, 2026

I think new defaults are needed. And the local storage carries over. I could have sworn I removed it from the list, and I still haven’t removed the component from the code base 😅

Tested it myself during a workout today and I did notice some quirks. But overall seemed mostly functional! 12x on the tablet was glorious.

@Abasz
Copy link
Collaborator

Abasz commented Jan 27, 2026

You removed it from the defaults but since localStorage has it it will happily load it back:

https://github.com/DXCanas/openrowingmonitor/blob/6bde3fa16425c2c3e07dab39a7069685a214cc79/app/client/components/SettingsDialog.js#L160C4-L160C62

Here basically we just get whatever is in the store.

https://github.com/DXCanas/openrowingmonitor/blob/6bde3fa16425c2c3e07dab39a7069685a214cc79/app/client/index.js#L29

here we load it from the store.

    const config = this._appState.config.guiConfigs
    Object.keys(config).forEach(key => {
      config[key] = JSON.parse(localStorage.getItem(key)) ?? config[key]
    })

We need a settings migration here, namely that if config has actions we need to override it and write this new config back to local storage.

@DXCanas
Copy link
Author

DXCanas commented Jan 27, 2026

Heads up that I am also unhappy with the state of the CSS here; it looks ok but it's not very understandable atm. So I will probably be tinkering and testing that along with the state reset ^

@JaapvanEkris JaapvanEkris added this to the 0.9.7 milestone Jan 27, 2026
@JaapvanEkris
Copy link
Owner

Before I forget: One thing to look at is the update behaviour of the force curve. We only send new data on the flag isRecoveryStart is true (all subsequent updates repeat the same curve), but it keeps drawing CPU cycles when displayed. Perhaps it is redrawing too often?

@DXCanas
Copy link
Author

DXCanas commented Jan 28, 2026

Alright y'all — sorry, I got a little carried away with the CSS. If the changes are out of scope, will happily pull into another PR.

Tried to make the CSS more self explanatory, and addressed an iOS bug I ran into while working on something else.

It's stricter/more defined now, and no longer has what I believe was unintentional overflow/scrolling.

So. Here's the before (Saw this while testing #171 and prior):
IMG_5059

And here it is now (only tested locally):

localhost_8080_(iPad Air) localhost_8080_(Samsung Galaxy S8+) localhost_8080_(iPad Mini) localhost_8080_(iPhone SE)

@DXCanas DXCanas force-pushed the settings-and-actions-dashboard branch from 08936de to 18cda3e Compare January 28, 2026 00:34
@DXCanas DXCanas marked this pull request as ready for review January 28, 2026 00:34
@DXCanas
Copy link
Author

DXCanas commented Jan 28, 2026

Before I forget: One thing to look at is the update behaviour of the force curve. We only send new data on the flag isRecoveryStart is true (all subsequent updates repeat the same curve), but it keeps drawing CPU cycles when displayed. Perhaps it is redrawing too often?

Relying heavily on the AI for this, but the solution makes sense to me!

@JaapvanEkris
Copy link
Owner

We need a settings migration here, namely that if config has actions we need to override it and write this new config back to local storage.

Or we need to clear the browser cache on update.

There are some PR's regarding the cache and the browser anyway (if the user isn't named 'pi' there are install issues, and we might switch browser to something lighter as on the Zero2W there are memory issues), so clearing it will kill any CSS and caching issues?

@Abasz
Copy link
Collaborator

Abasz commented Jan 28, 2026

Or we need to clear the browser cache on update.

I think that is a bit heavy. I like the current migration. I think it is sufficient.

We only send new data on the flag isRecoveryStart is true (all subsequent updates repeat the same curve),

So this is one of the things that proper data layer would solve. When I was experimenting with rxjs it has distintcUntilChanged which is a breez (so I was checking data on each tile for changes and only update/render).

Actually you should not worry about this for now, as I will review the updates to the lit framework and rework this data layer which will improve change detection (and trigger less rendering). I did more reading and it is going to be gradual but still robust. It will remove this passing down global state and make it more focused, that will reduce re-rendering.

The issue currently is that we use the global state which is fully replaced on every new incoming data packet (250ms as per default gui update interval I think), hence triggering all components update. I think moving to update() will not help but you can check that with a logging statement (i.e. how many times the update() method runs).

@JaapvanEkris
Copy link
Owner

A practical remark/question: currently we have lit pinned to 2.8, as upgrading to 3.x will break the FE. If you want a higher version, just drop a line. If we can uograde to 3.x pkease also tell as it might unlock a bunch of dependent package updates.

@JaapvanEkris
Copy link
Owner

Or we need to clear the browser cache on update.

I think that is a bit heavy. I like the current migration. I think it is sufficient.

You realize we might change browser or cach store completely due to the outstanding issues (thus clearing any cache anyway)?

@Abasz
Copy link
Collaborator

Abasz commented Jan 28, 2026

Or we need to clear the browser cache on update.

I think that is a bit heavy. I like the current migration. I think it is sufficient.

You realize we might change browser or cach store completely due to the outstanding issues (thus clearing any cache anyway)?

Yes that is true and essentially it will result in the same effect for those that use a screen with the Pi. But we need to keep it mind that

  1. this migration code will remain there for later and potentially be extended with other migration
  2. what if someone would already use the GUI on a phone and access it via wifi (i.e. not locally), or from another devices. For them full clear is total overkill.

@JaapvanEkris
Copy link
Owner

  1. what if someone would already use the GUI on a phone and access it via wifi (i.e. not locally), or from another devices. For them full clear is total overkill.

Forgot about that one. Thanks!

@DXCanas
Copy link
Author

DXCanas commented Jan 30, 2026

Alright, given how much back and forth is going on after trying to address this:

One thing to look at is the update behaviour of the force curve. We only send new data on the flag isRecoveryStart is true (all subsequent updates repeat the same curve), but it keeps drawing CPU cycles when displayed. Perhaps it is redrawing too often?
#170 (comment)

I thing we should just tighten the scope here and pull out all of that code for another PR. Seems like there are lots of things that need to be validated or confirmed, including what constitutes "fighting the framework" and benchmarking performance.

…onent

Extracted toolbar functionality from PerformanceDashboard into new DashboardToolbar component.
Removed 'actions' from default dashboard metrics.
 Updated layout to use flexbox with separate toolbar and metrics grid sections.
… in localStorage.

Remove deprecated DashboardActions component and migrate saved metrics

Deleted DashboardActions.js component as functionality has been moved to DashboardToolbar.
Replaced dynamic inline style injection with CSS class-based approach for grid row configuration.

Changed metrics container from div to semantic section element.

Updated grid layout to use explicit grid-template-rows and added .rows-3 modifier class for 12-tile configuration.
…vements

Reorganized CSS properties for better readability and consistency.
Simplified button styles by removing redundant properties and using flex instead of inline-flex.
Changed fullscreen/windowed icon containers from div with IDs to span with classes.
Consolidated media query icon display rules into single-line declarations.
Added explicit grid-template-areas to PerformanceDashboard for clearer layout structure.
Added min-height: 0 to metrics-grid and metric-tile to prevent grid blowout issues.
…rt legend.

More reliable - Avoids Chart.js legend bugs on iOS and autoscaling issues
Better for responsive design - HTML text naturally inherits the fluid typography
Added host flex container styles and title styling at 80% font size with center alignment.
@DXCanas DXCanas force-pushed the settings-and-actions-dashboard branch from 41b22f9 to 8db0227 Compare January 30, 2026 16:46
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.

3 participants