Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename field
  • Loading branch information
johnstcn committed Jan 29, 2024
commit c46832ced5c3136e9f5013d124dbb2e30041d2e0
6 changes: 3 additions & 3 deletions site/src/pages/WorkspacePage/WorkspaceActions/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,20 @@ export const RetryButton: FC<RetryButtonProps> = ({
};

interface FavoriteButtonProps {
handleAction: (workspaceID: string) => void;
onToggle: (workspaceID: string) => void;
workspaceID: string;
isFavorite: boolean;
}

export const FavoriteButton: FC<FavoriteButtonProps> = ({
handleAction,
onToggle: onToggle,
workspaceID,
isFavorite,
}) => {
return (
<TopbarButton
startIcon={isFavorite ? <Star /> : <StarBorder />}
onClick={() => handleAction(workspaceID)}
onClick={() => onToggle(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.

</TopbarButton>
Expand Down
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.

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

@matifali matifali Jan 29, 2024

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
Member Author

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
Member Author

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.

Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const WorkspaceActions: FC<WorkspaceActionsProps> = ({
<FavoriteButton
workspaceID={workspace.id}
isFavorite={workspace.favorite}
handleAction={handleToggleFavorite}
onToggle={handleToggleFavorite}
/>
),
};
Expand Down