Skip to content

Conversation

@jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented Nov 25, 2025

Screenshot 2025-12-10 at 20 37 38

@jaaydenh jaaydenh self-assigned this Nov 25, 2025
{...props}
>
<span className="absolute right-2 flex items-center justify-center">
<span className="absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Vertically center the checkmark when the select takes up more vertical space

htmlProps: HTMLAttributes<HTMLLIElement>;
}

export const UserOrGroupOption = ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extracted from UserOrGroupAutocomplete

@jaaydenh
Copy link
Contributor Author

jaaydenh commented Dec 10, 2025

Not really happy with UserOrGroupAutocomplete.tsx and I would really prefer to replace it then add yet another variation but I think that is better saved for a separate PR.

Also, stories for WorkspaceSharingPageView coming in a separate PR.

@jaaydenh jaaydenh marked this pull request as ready for review December 10, 2025 22:33
@jaaydenh jaaydenh requested a review from aslilac December 10, 2025 22:33
<p className="flex flex-row gap-1 text-sm text-content-secondary font-medium m-0">
Workspace sharing allows you to share workspaces with other users
and groups.
{/* TODO: ADD DOCS LINK HERE <Link href={docs("/admin/users/idp-sync")}>View docs</Link> */}
Copy link
Member

Choose a reason for hiding this comment

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

just fyi, the current url proposed by jiachen is docs("/user-guides/workspaces-shared") but I proposed some alternatives that I think are a bit better

I imagine that pr will probably be merged soon one way or another

https://github.com/coder/coder/pull/21214/changes#r2611975329

const permissionsQuery = useQuery({
...checkAuthorization({ checks }),
});
const permissions = permissionsQuery.data as WorkspacePermissions | undefined;
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
const permissions = permissionsQuery.data as WorkspacePermissions | undefined;
const permissions = permissionsQuery.data;

casts bad 🙅


const workspaceACLQuery = useQuery(workspaceACL(workspace.id));
const checks = workspaceChecks(workspace);
const permissionsQuery = useQuery({
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
const permissionsQuery = useQuery({
const permissionsQuery = useQuery<WorkspacePermissions>({

I think narrowing the type here is gonna be less error prone

Comment on lines +75 to +77
displayError(
getErrorMessage(error, "Failed to add user to workspace"),
);
Copy link
Member

Choose a reason for hiding this comment

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

I imagine it was already like this on the template sharing page, but I really dislike the ux of error toasts :\

workspaceACL={workspaceACL}
isLoading={isAddingUser || isAddingGroup}
onSubmit={(value, role, resetAutocomplete) =>
"members" in value
Copy link
Member

Choose a reason for hiding this comment

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

this feels typo prone 😬 but I see that this is yet another thing taken from the old page. dang.

Comment on lines +177 to +181
onAddUser: (
user: WorkspaceUser | ({ role: WorkspaceRole } & User),
role: WorkspaceRole,
reset: () => void,
) => void;
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
onAddUser: (
user: WorkspaceUser | ({ role: WorkspaceRole } & User),
role: WorkspaceRole,
reset: () => void,
) => void;
onAddUser: (
user: WorkspaceUser,
role: WorkspaceRole,
reset: () => void,
) => void;

what are the odds this still just works if we make this type less obnoxious? 💀

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.

3 participants