-
Notifications
You must be signed in to change notification settings - Fork 228
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
fix: Move create new squad to bottom of dropdown #3649
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
remove hack fix jank
@@ -121,6 +121,7 @@ function CreatePost(): ReactElement { | |||
onSuccess: (newSquad) => { | |||
const form = formToJson<CreatePostProps>(formRef.current); | |||
|
|||
setSelected(selected + 1); |
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.
A minor hack for aesthetic purposes.
Moving the "create new squad" option to the bottom created some funky UI behavior. The navigation often takes a second before it happens after the squad is created. This results in the wrong squad being shown as selected for a brief moment as the list grows, but the selected index remains the same:
squadshuffle.mov
There's certainly a root problem that should/could be addressed here, but I think this is an OK quick fix for now.
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.
😬
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 would actually avoid the quick fix and this fix in this case then have something not really stable for solving the issue. 🤔
Also what's also annoying me that I hadn't noticed before is the flickering in the dropdown when u select a value
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.
@nensidosari The potentially wonky incident I can see is if the squad gets created, but post doesn't. In that case if the user clicks post again, he will create a second squad. But yeah, if you want to avoid the hack, or let this issue rest all together for now it's understandable.
The crux of the issue here is that the dropdown uses indexes and not unique identifiers, but refactoring that seemed like way out of the scope of this task. Also I've seen talk about potentially adopting radix in the future, which would make fixing the dropdown redundant.
Also what's also annoying me that I hadn't noticed before is the flickering in the dropdown when u select a value
Yeah, seems to be caused by multiple rerenders. Quite unsightly 😅
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.
Also what's also annoying me that I hadn't noticed before is the flickering in the dropdown when u select a value
That's an on-going issue with our context menu 😅
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.
@AmarTrebinjac the problem we're fixing here, does it mean we fetch squads again in the dropdown now that a new squad is added that causes the weird behaviour?
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.
@AmarTrebinjac I think we can just remove this line. After creation, I think it won't matter whether the label from "Create new Squad" would become "User's private Squad". The intention was to create a new Squad and the label itself displays the accurate value.
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.
Don't have anything blocking here. Looks good to me 🚀
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.
Isn't it more an issue of filtered
not being stale?
@AmarTrebinjac what's the state of this PR? Is it ready for merging? |
Changes
"create new squad" option in the squad dropdown of "new post" is now the last option
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
MI-591
Preview domain
https://mi-591.preview.app.daily.dev