Skip to content

feat: add extra workspace actions in the workspaces table #17775

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 15 commits into from
May 13, 2025
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
Minor visual fixes
  • Loading branch information
BrunoQuaresma committed May 12, 2025
commit d5ae7e148fda1970be3e01592982b3afe1c4bd07
2 changes: 1 addition & 1 deletion site/src/components/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const DropdownMenuItem = forwardRef<
[
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-2 text-sm text-content-secondary font-medium outline-none transition-colors",
"focus:bg-surface-secondary focus:text-content-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"[&>svg]:size-4 [&>svg]:shrink-0",
"[&>svg]:size-4 [&>svg]:shrink-0 no-underline",
inset && "pl-8",
],
className,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export type ChangeWorkspaceVersionDialogProps = DialogProps & {
export const ChangeWorkspaceVersionDialog: FC<
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's worth blocking on this, but I think it's worth thinking about for the future: do we want to limit the number of versions we show by default? Right now, we're loading everything, which makes the UI chug for a second, and I think that realistically, most users aren't going to be switching to anything that's more than 10 versions older than the most recent one

We have a lot of versions from the past two years, and I could see some customers having more than us, just because their companies are so much bigger

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I totally agree with you, but I have to say it is not on the scope for this PR. Feel free to open an issue tho

ChangeWorkspaceVersionDialogProps
> = ({ workspace, onClose, onConfirm, ...dialogProps }) => {
const { data: versions } = useQuery(templateVersions(workspace.template_id));
const { data: versions } = useQuery({
...templateVersions(workspace.template_id),
select: (data) => data.reverse(),
Copy link
Member

Choose a reason for hiding this comment

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

This is a bug: we don't want the mutate any data that we select. Normally I'd recommend that we use data.toReversed, but since we just had a customer complain about their browsers not being recent enough to support it, we should swap to [...data].reverse()

});
const [isAutocompleteOpen, setIsAutocompleteOpen] = useState(false);
const activeVersion = versions?.find(
(v) => workspace.template_active_version_id === v.id,
Expand Down