-
Notifications
You must be signed in to change notification settings - Fork 955
feat(site): support icon and description in preset #19063
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the workspace creation UI to support icon and description display for presets by replacing the SelectFilter
component with the more feature-rich Combobox
component.
- Replaces
SelectFilter
withCombobox
in the workspace creation form - Updates preset option structure to include icon and description fields
- Modifies
Combobox
to render preset icons usingExternalImage
instead ofAvatar
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx | Replaces SelectFilter with Combobox and updates preset options to include icon/description |
site/src/components/Combobox/Combobox.tsx | Updates icon rendering to use ExternalImage instead of Avatar |
@@ -103,7 +103,8 @@ export const SearchAndFilter: Story = { | |||
screen.queryByRole("option", { name: "Kotlin" }), | |||
).not.toBeInTheDocument(); | |||
}); | |||
await userEvent.click(screen.getByRole("option", { name: "Rust" })); | |||
// Accessible name includes both image alt text and text content: "Rust Rust" | |||
await userEvent.click(screen.getByRole("option", { name: "Rust Rust" })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we changed the icon image to be an ExternalImage with alt={option.displayName}
https://github.com/coder/coder/pull/19063/files#diff-f7c0d4d4c43b6dd17458ff44a1a0dfdccfae367b09ffe41fdbe09c48c151e466R126
The name includes both the image alt text (Rust
) + the text content (Rust
). Let me know if this is ok, or if there is a better way to filter out this element.
Description
This PR updates the
CreateWorkspacePageView
to use theCombobox
React component instead ofSelectFilter
for the Preset selection.Changes
CreateWorkspacePageView
to use theCombobox
component in place ofSelectFilter
.Combobox
component to render preset icons usingExternalImage
instead ofAvatar
.Follow-up from: #18977