-
Notifications
You must be signed in to change notification settings - Fork 48
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
Wizard V2: Custom Repositories refactor #2050
Conversation
Can one of the admins verify this patch? |
3e91383
to
6eb61f0
Compare
f959ea2
to
3b6a168
Compare
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.
Thank you for working on the refactor! The code looks much cleaner ❤️
Looking at this from the user point of view there seems to be considerably more loading as more actions trigger a new API call including search and removing repositories.
This is linked to the question of how many repositories should we initially fetch - previously we fetched all the repositories right from the start which looked a bit more seamless when going through the step. What I mean is this:
-
previously the fetching happened at the initialization of the step, but then there was no further loading / skeletons:
-
now the loading state gets triggered on toggling between all/selected, searching, clearing search input, changing pagination perPage limit and removing a repo
Which might not be necessarily bad, but it might be good to discuss which path to take from this point. What would be the advantages of handling the data via a series of API calls?
src/test/Components/CreateImageWizardV2/CreateImageWizard.content.test.tsx
Show resolved
Hide resolved
src/test/Components/CreateImageWizardV2/CreateImageWizard.content.test.tsx
Show resolved
Hide resolved
src/test/Components/CreateImageWizardV2/steps/Repositories/Repositories.test.tsx
Show resolved
Hide resolved
As for the feedback to removing the modal - I remember adding it for some reason, but can't really remember what the reason was 😅 I guess it was there to make double sure that the user knows they can break their image with the change? Not sure if that's too much safeguarding though. Any thoughts @mmenestr @kelseamann ? edit: it should be this modal if I'm correct Also to check - when removing a repository what would be the desired behaviour? Currently when in the Selected toggle the checkbox gets unchecked, but the repository stays there until the toggle gets toggled to All and retoggled to Selected again. After the changes the repository would disappear from the Selected list as soon as it gets unchecked. I'm aware we're not currently consistent with the behaviour between repos / packages steps, so this might be an issue for a separate PR. |
I feel like we should keep the modal... this is probably a rare scenario anyway. Also, I think that when the user unselects the repo, the packages should automatically get removed from the "selected" toggle. In general - my guidance when it comes to unselected items is this: If the user is in the "selected" toggle, and unchecks something, then the items should remain in the "selected" list, unchecked, until the user toggles back to "All". However, if the user is NOT on the selected toggle, and their actions impact the selected toggle, then the items should automatically go away from the selected toggle. Does that make sense? It basically just depends on whether the user is in the selected toggle while things are unselected or not. |
Agree, alas that's currently not possible as the packages aren't linked to their origin repository. |
Hello! @regexowl 👋 First thanks for the extensive review. The primary reason I am using the API in this way is consistency across our apps. I understand the idea of liking to front-load all data, but in general, it is largely frowned upon as an architectural choice unless there is an inherit slowness with the API. The usual reasons this is sited as not a good pattern in general is you can get to a point where with enough data it becomes a problem, there are also different data limits across browsers and devices, that can lock up/slow-down the web page dramatically (likely not an issue but I digress). On content-sources, we have a front-end cache of sorts that handles the API so the loading state is not really perceived so obviously from the users point of view when looking back at previous data. If there is some way to implement something similar with the redux toolkit that may alleviate some of the perceived slowness, but I would suggest using the API as intended. |
I spoke to @jlsherrill regarding this (SME for content) and he had basically said that the warning should be enough.
Oh hmm, I see what you mean. But with the addition of the remove modal, it may be less obvious as the user will be slowed down further. |
Got it, sounds great!
Fair enough! I don't know how many repositories users usually have, but I admit that relying on the idea that "there can't be that many" is not a good approach. 😅 We can try to figure out if there's a way to cache some data so the loading is less obvious, but I'd say that's out of the scope of this PR for now. Thanks a lot for the explanation! |
Hmm, when you're looking at the debounce would it be possible to make a short screencast with and without the modal? I think there are two open questions regarding the modal:
Since we probably want the newly unchecked repos to stay in Selected for a bit, it may indeed clash with the modal popping out as soon as the repo gets unselected. Maybe we could show the modal just once when the Next button is clicked after the changes were applied? This would probably need to be handled via wizard footer then... 🤔 Or maybe we could display the alert only when a previously used repo was unselected so it pops out more? What do you think @mmenestr? |
Clicked around a bunch - this looks and works great, thank you! Current way of fetching/refreshing feels much better to me! The skeletons were a bit overwhelming 💀 I'd say let's double check the module_hotfixes test, decide on the modal and debounce and then it's good to get merged. We'll need to update msw fixtures and handlers a bit if we want to keep making use of the in-browser mocking, but that's a separate problem. Opened an issue for that: #2107 |
Good sanity check. 🎉 |
/retest |
/retest |
1 similar comment
/retest |
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.
Found one bug and a tiny nitpick, but otherwise looks great to me!
src/Components/CreateImageWizardV2/steps/Repositories/Repositories.tsx
Outdated
Show resolved
Hide resolved
src/Components/CreateImageWizardV2/steps/Repositories/components/BulkSelect.tsx
Show resolved
Hide resolved
Okay, so I fixed the bug above, and looked into cacheing here. |
I have added the "search" field to the repositories mock function to get around the test failures. |
Fixed lint and flattened merge history. |
/retest |
/retest |
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.
Looks awesome and works like magic! 🧙 Thanks for all your work on this!!
One design change:
My pm suggested removing the confirmation modal on deletion during the edit screen, I have commented that out and will ask for feedback from all of you. We believe the warning below should be sufficient.
Also updated the empty state screen: