Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(site): show favorite workspaces in ui#11875

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 9 commits intomainfromcj/ui-favorite-workspace
Jan 29, 2024

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedJan 29, 2024
edited
Loading

Screenshot 2024-01-29 at 10 30 09

Screenshot 2024-01-29 at 10 30 52

Screenshot 2024-01-29 at 10 30 55

matifali and MrPeacockNLB reacted with hooray emoji
@johnstcnjohnstcn changed the title[wip] feat(site): show favorite workspaces in uifeat(site): show favorite workspaces in uiJan 29, 2024
@johnstcnjohnstcn marked this pull request as ready for reviewJanuary 29, 2024 11:21
queryClient.setQueryData(
workspaceByOwnerAndNameKey(workspace.owner_name, workspace.name),
{ ...workspace, favorite: !workspace.favorite },
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You also may want to invalidate the "workspace list" query data.

johnstcn reacted with thumbs up emoji
}

export const FavoriteButton: FC<FavoriteButtonProps> = ({
handleAction,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's an implicit convention, but when dealing with event handlers, we usually name them using theon prefix likeonSomething instead ofhandleSomething. So instead ofhandleActions, I think a better name would beonToggle.

Also, you can move the query inside this button 😁. We're trying to put things close to where they're used.

johnstcn reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Also, you can move the query inside this button 😁. We're trying to put things close to where they're used.

I'm not quite sure how to accomplish this; React doesn't seem to like me puttinguseMutation inside a component.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Created#11892 to follow-up.

startIcon={isFavorite ? <Star /> : <StarBorder />}
onClick={() => handleAction(workspaceID)}
>
{isFavorite ? "Unfavorite" : "Favorite"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this button can have two states, favorite and unfavorite, I would create a story in a storybook for both scenarios.

johnstcn reacted with thumbs up emoji
Copy link
Collaborator

Choose a reason for hiding this comment

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

One small thing about the design is that I don't think it should be a primary action, located in the same place as workspace actions like start, stop, refresh, etc. I think it should be in the "more options" menu.

johnstcn reacted with thumbs up emoji
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think@matifali ?

Copy link
Member

@matifalimatifaliJan 29, 2024
edited
Loading

Choose a reason for hiding this comment

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

Hmm. I like it on the front page, but what about making a filled vs. an empty star only and removing the text altogether?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'd prefer to leave the text on, as a button should show what will happen when you click it.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@BrunoQuaresma I think we have enough space to leave the button up top for now; hiding it in the menu makes it less discoverable.

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

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

I think you did a really good job on this 🙏. I just left some comments but any of them are blockers.

@BrunoQuaresma
Copy link
Collaborator

@johnstcn don't forget to review things in Chromatic 🙏

johnstcn reacted with thumbs up emoji

@johnstcnjohnstcn merged commit9abf6ec intomainJan 29, 2024
@johnstcnjohnstcn deleted the cj/ui-favorite-workspace branchJanuary 29, 2024 13:39
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 29, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@matifalimatifalimatifali left review comments

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@BrunoQuaresma@matifali

[8]ページ先頭

©2009-2025 Movatter.jp