Skip to content

Conversation

@jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented Dec 18, 2025

Also, adds built-in required and error text

Screenshot 2025-12-19 at 16 27 32

@jaaydenh jaaydenh self-assigned this Dec 18, 2025
@jaaydenh jaaydenh marked this pull request as ready for review December 19, 2025 17:14
getOptionLabel={(option) => option.email}
onOpen={() => {
setOpen(true);
setFilter(value?.email ?? "");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Im not sure why setFilter was previously set to value?.email, this made it very difficult to choose a different value for the owner on the Create workspace page

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example, try out the existing owner autocomplete dropdown vs the one in this PR, I cant think of a reason why the existing one is difficult to use.

@jaaydenh jaaydenh force-pushed the jaaydenh/migrate-autocomplete branch from 418bd76 to d99aee4 Compare December 22, 2025 11:59
@jaaydenh jaaydenh requested review from aslilac and jakehwll December 22, 2025 18:22
* Container element to portal the dropdown into. Use this when rendering
* inside a Dialog to avoid scroll lock issues.
*/
popoverContainer?: HTMLElement | null;
Copy link
Member

Choose a reason for hiding this comment

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

passing an element as a prop feels like a smell to me. I notice tho that the one place we're using this is to pull an element out of the ref.

can we just pass the ref instead?

Comment on lines +136 to +140
if (isOpen) {
setFilter("");
} else {
setFilter(undefined);
}
Copy link
Member

Choose a reason for hiding this comment

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

you could also just do setFilter(isOpen ? "" : undefined)

<Avatar
src={option.created_by.avatar_url}
fallback={option.name}
<Dialog open={open} onOpenChange={(isOpen) => !isOpen && onClose()}>
Copy link
Member

Choose a reason for hiding this comment

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

I really am not a fan of the readability of using && short circuiting this way, and would rather just make this an if

getOptionValue={(option) => option.name}
getOptionLabel={(option) => option.name}
renderOption={(option) => (
<span className="flex-1">{`${option.flag} ${option.name}`}</span>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<span className="flex-1">{`${option.flag} ${option.name}`}</span>
<span className="flex-1">{option.flag} {option.name}</span>

<span className="flex-1">{`${option.flag} ${option.name}`}</span>
)}
label={Language.countryLabel}
placeholder={"Select a country"}
Copy link
Member

Choose a reason for hiding this comment

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

could remove the {}

export const ChangeWorkspaceVersionDialog: FC<
ChangeWorkspaceVersionDialogProps
> = ({ workspace, onClose, onConfirm, ...dialogProps }) => {
> = ({ open, workspace, onClose, onConfirm }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason we wouldn't want the rest of these ...dialogProps here?

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