-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: button component #1318
Conversation
Looks really nice @afonsojramos - just played around with it locally. A few small suggestions
Really good stuff! |
Was also just thinking of what this might look like using our existing RadioGroup component (used by Theme and Group By) |
Unless that radio button is 5 buttons wide (which looks bad imo 😬) I don't see it as being a good alternative here.
That's fair, I'll add that!
🤔 I'll check |
Should be good now @setchy |
@adufr does this serve your goals? Or do you need extra zoom to either side? |
Looks great @afonsojramos, thank you! What's your thoughts on if the slider should reflect the manually set zoom level via |
It already does, just not "live" because the zoom doesn't trigger a rerender of react. |
Managed to find a way to do it 🤓 |
Just checked, I really like how the control looks and feels, but I'm used to unzoom even more than the 0% setting 😅 Also, the setting doesn't seem to be preserved across restarts..? |
Also, a while ago I introduced this related change: #1035 I'll let you check but it might not be required anymore, idk |
@setchy @adufr I've been trying to set that up (even with the settings, with no success), but considering that that is supposed to be working, let's just say that it is a bug to be fixed separately.
Regarding this, I'll try to adjust the scale to meet that |
I'm away from my computer ATM, which check later, but I suspect you may need to add special handling when the settings are first loaded after opening, like we do for the "open on startup" setting. |
Implemented a 1.85 multiplier so this should simplify the calculations and reach your zoom level @adufr. PS: If you're asking why a 1.85 multiplier and not the 2... Because a 2x multiplier would make the 150% go out of bound a bit in the 150% zoom. Edit: Nevermind, I want the 2x multiplier, so I reduced the max zoom to 120%. I doubt anyone is going to zoom in. |
You made me think? Should we only allow zoom out? |
I noticed some odd slider behavior under the following conditions:
|
The zoom out now meets my needs 👍
It glitches because it's resizing instantaneously so the mouse gets out of the slider 😅
Well, it's visually annoying but I deem it acceptable
Yup that's why I pointed the PR #1035, I think the following line needs to be adjusted: Lines 67 to 68 in c86e7fd
|
@setchy I fixed this by making the step smaller, which was more work than expected, wasted a couple of hours on this 💀 Hope you like it more like this 🔫 This does mean that keyboard navigation now only jumps steps of 1, BUT you can just press for longer I suppose, it isn't too bad.
It also solves this I suppose ✅ |
Appreciate the time spent @afonsojramos. 🙏 I hope this is user error on my part, but, I cannot get the zoom settings to load on app restart... Sometimes it works, but shows the zoom at 100% in the UI, other times it doesnt set the zoom level at all... I was also able to get the zoom out of sync quit easily with the 1% increments. What if to simplify the whole impl it was:
Alternatively, what if we:
|
So, is this currently working? Because I can't get it to work outside of this PR either, so it feels like out of scope for the pr itself, as it is supposedly working (just not something that I had tested before)
Do you mean with the mouse? That's okay I'd say! |
To be honest I like this approach, but am sad to trash it all 😓 |
I'm right there with you. The life of a developer 🥹 |
@setchy updated this PR to be a refactor of the button component. Will do a stacked PR to add in the controls for the zoom. |
This PR now aims to refactor the button component to make it more modular and reusable.