Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

AmarTrebinjac
Copy link
Contributor

@AmarTrebinjac AmarTrebinjac commented Oct 10, 2024

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

Copy link

vercel bot commented Oct 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 7:36am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
storybook ⬜️ Ignored (Inspect) Nov 22, 2024 7:36am

@@ -121,6 +121,7 @@ function CreatePost(): ReactElement {
onSuccess: (newSquad) => {
const form = formToJson<CreatePostProps>(formRef.current);

setSelected(selected + 1);
Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬

Copy link
Contributor

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

Copy link
Contributor Author

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 😅

Copy link
Member

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 😅

Copy link
Contributor

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?

Copy link
Member

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.

@AmarTrebinjac AmarTrebinjac marked this pull request as ready for review October 10, 2024 09:01
@AmarTrebinjac AmarTrebinjac requested a review from a team as a code owner October 10, 2024 09:01
Copy link
Member

@sshanzel sshanzel left a 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 🚀

Copy link
Contributor

@rebelchris rebelchris left a 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?

@sshanzel
Copy link
Member

@AmarTrebinjac what's the state of this PR? Is it ready for merging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants