-
Notifications
You must be signed in to change notification settings - Fork 85
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
Farm Addon & Partner visual adjustments #3700
Farm Addon & Partner visual adjustments #3700
Conversation
This is the flashing of 1) the form buttons and 2) the org_id input when the connection is active but the RTK query cache is cleared, e.g. on first login. useEffect() also solves Warning: Cannot update a component ('AddSensor') while rendering a different component ('Partners').
…layout shift focus > hover
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fixes, thank you! ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your fixes work well! And useState is good!... I just was trying to figure if using setState in the top level function body was "wrong" but I couldn't find anything.
Also I am maybe confused about how the button styling works. Is it supposed to be active after first click moving forward? Or should the active state clear? The same thing happens with the form buttons in addAnimals.
Screen.Recording.2025-02-28.at.9.40.38.AM.mov
@Duncan-Brain it's not an active state, it's a focus state. And yup it's correct for that to stay applied until you tab or click elsewhere -- you should see the same behaviour if you tab to or long-click any button in app. Screen.Recording.2025-02-28.at.9.28.24.AM.movWe aren't the ones applying those |
@kathyavini Yeah its the modal and form navigation transitions where I sort of expected the focus state to reset/unfocus/blur whatever haha. Not familiar with native browser behaviour but wondering if we missed something. Screen.Recording.2025-02-28.at.9.37.10.AM.mov |
@Duncan-Brain for that particular transition in your video maybe it's the fact that the inner text of the button changes but in fact it's the same button (hasn't remounted) so it keeps focus state which feels particularly wrong? Although yeah I guess even if the text didn't change it should feel like a new "next" button 🤔 Let's give it a quick view in tech daily with Anto next week, but for a two step form like that it's a one-line fix with a remounting key on that right-hand button : |
Description
This is the PR to address visual issues described in #3696 that weren't strictly related to the delete functionality. Addressed:
<Partners />
which I'll demostrate here with 4x cpu throttling for clarity -- both the text input and the form buttons are showing momentarily if the connection is active and the RTK query cache is missing (e.g. on first login). Within the PR code,useEffect()
address the buttons while the conditional rendering is for the text input flash. Both make use ofisLoading
which it was my mistake to not include originally!4x.cpu.throttle.mov
The solution for the flash of buttons also fixes the console warning:
Cannot update a component ('AddSensor') while rendering a different component ('Partners').
:Thank you @Duncan-Brain for suggesting a
useEffect()
yesterday although maybe today you weren't into it 😂 (I think it's a good suggestion though!)Jira link: none
Type of change
How Has This Been Tested?
Checklist: