Settings and Actions Toolbar#170
Settings and Actions Toolbar#170JaapvanEkris merged 16 commits intoJaapvanEkris:0.9.7-(under-construction)from
Conversation
|
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. |
b4dc2c8 to
6bde3fa
Compare
|
Great work! What a space saver! I'll test this evening and accept the request when no issues are found |
|
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. |
|
You removed it from the defaults but since localStorage has it it will happily load it back: Here basically we just get whatever is in the store. 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. |
|
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 ^ |
|
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? |
|
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): And here it is now (only tested locally):
|
08936de to
18cda3e
Compare
Relying heavily on the AI for this, but the solution makes sense to me! |
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? |
I think that is a bit heavy. I like the current migration. I think it is sufficient.
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). |
|
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. |
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
|
Forgot about that one. Thanks! |
|
Alright, given how much back and forth is going on after trying to address this:
I think 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.
41b22f9 to
8db0227
Compare
|
Side note, just to note while I'm thinking about it: the toolbar has the added benefit of giving us that blank space in the center for some more interface; I was thinking maybe segment information for workouts? "Just Row" by default? We'll cross that bridge when we get there. But I was reflecting while testing another PR without the UI updates. |
It is a bit more subtle than that. In essence, the force curve represents force over distance (the X axis is actually the drive length). The "volume under the curve" is the work done (essentially Joules). If you divide it by the stroke time, you get the power. So there are some parameters in between. Looking at the force curve, a high peak in the force curve is actually quite inefficient. Most efficient is a flatter curve where the force peak is close to the average.
It isn't a bad assumption. When you look at RP3's force curve they actually display that alongside the peak force: the percentage where the peak is. The position of the peak is actually relevant for the type of boat.
Pretty good point. Perhaps remove the labels completely? |
I think that keeping a lot of whitespace is more beneficial: people move up and down the slide, and that makes text pretty hard to read. On the standard setup (integrated 7" display) most text aside the large metrics isn't too readable. An extra icon that opens the workout schedule would be usefull, but we borrowed a trick from Concept2: metrics that are set as a (time/distance/calories) target in the interval will start at their target and count down. This has the huge benefit that this is displayed in a large font, provides a clear indication that the workout is loaded and active (this is something that went wrong quite often when not doing that), and people are mentally more inclined to count down to a finish anyways. |
Oh, interesting. I never really understood the numbers here, but this makes sense. I would just use the peak "relatively"; is it higher or lower than the last time I did something like this workout?
sure 🤷 I lean toward keeping it in some way just because removal would be feature removal which… is a law my workplaces historically don't like breaking lol.
I did remove it, and brought it back as evidenced in the commits. It will dissapear once data starts getting populated into the chart. I thought it might be confusing to sit down at your rower and just see a large blank rectangle after update. So it will show at start, and dissapear as the data starts getting populated. Another tangent:
Should this also be theoretically be possible? |
All chart.js rendered labels already gone. This removes the standard markup text as well.
For start, mostly. To prevent confusion.
56e4b00 to
c2cb4c2
Compare
…ning on battery icon.
|
Heads up that this should be ready for testing again @JaapvanEkris — Adding some uniform padding to the tiles (so that the chart isn't right up against the bottom), made the appearance of the title dyamic (so that it's only visible when data isn't; mostly a UX thought for when someone hasn't started rowing and loads up the GUI), and kept the expanded height of the chart. The layout of the titles, and the 2-tile length of the chart actually sets an uninstentional little "halfway" marker right above (or below) the chart, making it easier to identify what "side" of the force curve you're on. Personally found this really nice! Also found a bug during my own test session having to do with the battery icon (removed a seemingly useless line of styles earlier). That's fixed now too. |
|
I'll start testing tomorrow (have to complete some tests for the CyclicErrorCorrection filter) |
|
Sorry for being late to this party FY closing is very busy. I have been also experimenting with changing (removing/swapping) the title on the force chart as well and I think:
Alternatively we can have the option to completely remove the peak but that cannot be done easily with a checkbox (drop down maybe with options: off, title, chart?) What do you think? I will actually do the same for ESPRM GUI (I realised that on my phone I dont see the peak too small, jumping is irritating indeed. but sometimes I am interested about this) |
|
So right now the behaviour is that there's a title at the very start, before any data is picked up. Just for clarity on the layout before a workout is begun. Once data starts coming in, title goes away. I like the idea of including peak, but maybe placing it somewhere consistent, and other than where title was. Settings would be a bit more work, and we'd have to think through where that config would live. I'm inclined towards a sane fixed setting (top right aligned?), but open to the idea of config if we can settle on the design. But if there are no objections with the current behaviour, can we save any big changes for a followup PR? To be worked on/discussed after #171 and #176? |
Limits overlap. See conversations on JaapvanEkris#170
c14b90c to
2591a05
Compare
Limits overlap. See conversations on JaapvanEkris#170 Partially reverts 1eebf78
2591a05 to
27e1b9e
Compare
|
Guys, Ket's not go this route. It is quite cramped and on a decent force curve this will overlap. Why not remove the peak force from the graph and give it its own tile. That is most consistent from a GUI perspective, and prevents overlap. I would keep the axis. As a side note: the settings for this machine need some attention: 4kw power 3kN force and a spikey force curve suggest something is way off. Jaap |
|
Agreed! Will revert to dd47014 tomorrow Curves are not from a real machine. Just commented out the replay line in server.js 🤷 |
I think this is just a font size matter and alignment. I mean we can have the
I mean we can have a peak tile but that will take a space of a tile. I think this is a decision of the user whether it accepts a slightly smaller peak font (that does not overlap) or sacrifice as full tile for something that is readable.
I would also keep the axis. For instance on kayak sometimes one applies greater force on one side than the other. And the fact that the axis re-scales is visible. Yes peek would help here (substitute to some extent) too as that would increase and decrease but if someone uses it to improve technique it helps. I mean this is again something that may be controlled from the settings if you want to give the option.
Yes. I agree with this. I was planning to the same in ESPRMGUI
Yes sure, I think implementing settings and stuff (if this is the way) is the next step PR. |
The key issue is that on a really efficient stroke, you have a significant flat area on top of the curve. And if you want text to be readable on a 7" screen while people are moving up andd down the slide, it is pretty hard to read if the font becomes smaller. It gets in the way of that curve and distracts. There are more key indicators here that are relevant. RP3 and EXR show the drive length on the X-axis. Physically correct, but for our current GUI not ideal. So it is an additional tile. I think when you want to really do a nice job, you'd make the force curve even bigger, put the peak force on the y-axis and the drive distance on the x-axis, and show what the peak is in percentage on the x-axis as well. But I think that should be part of a fundamental rethink how the GUI is designed, as you want a more integrated (but more flexible) approach. As @DXCanas rightfully indicated, it is about the shape itself, so it should focus on that. Making that as easily readible as possible is key. Adding large readible text in the same tile would go against that. So removing large texts that block that hopefully smooth curve is a good step in my book. I guess perhaps a slightly smaller font on the axis might also be appropriate.
We just saved them a tile as well by this PR. In essence, if people are keen to see it, they can do now for "free". Key thing here is being able to read it when returning to the catch. The old solution was interesting but never good to read (in all honesty, as my PM5 still is connected as well, I read that data via the PM5-ErgData interface). On ErgData it has its own tile. I think having it on a place where people can see it without obstruction from other elements (a curve intersecting) would make it a cleaner interface. I actually would introduce two tiles: Peak Force and Average Force, as their combination essentially determines the stroke efficiency (the closer they are together, the better). If people really are focussed on stroke efficiency I would put the force curve the Peak and Average force tiles next to each other. Especially on a larger tablet with 12 rows, that would work well. If you look at more elaborate setups (i.e. using EXR) pace, distance, time, strokerate, force curve, drive distance etc.. is all in the HUD, essentially offloading them from the monitor. This would free up the monitor's tiles to show the more detailed metrics. So I would focus more on that scenario. |
27e1b9e to
dd47014
Compare
|
Alright: reverted, as promised! So we are at the no-peak + no-title while rowing setup, with Y axis scale visible. As far as the new tile, etc, I am thinking that's a followup PR :) I'd like to clear out my current PR queue before taking it on, if y'all don't mind! Also probably best to get a new conversation thread going; this one is rather long haha. |
No problem. I'll test tomorrow. I want to make some progress as well. I have to reinstall my Pi, as I FUBARed my test machine (some issue with HCI socket not being found, which I hope is not OS or hardware related...). |
i had the same issue!!! You need to enable Bluetooth if disabled. |
Interesting. Hope this helps in my case (saves me setting up a new test environment). |










WIP, first code contribution! Trying out an idea I had based on need expressed here:
#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.