Skip to content

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

Merged
merged 12 commits into from
Jul 29, 2025

Conversation

ssncferreira
Copy link
Contributor

@ssncferreira ssncferreira commented Jul 28, 2025

Description

This PR updates the CreateWorkspacePageView to use the Combobox React component instead of SelectFilter for the Preset selection.

Changes

  • Updated CreateWorkspacePageView to use the Combobox component in place of SelectFilter.
  • Modified the Combobox component to render preset icons using ExternalImage instead of Avatar.
Screenshot 2025-07-29 at 12 27 14 Screenshot 2025-07-29 at 12 27 21

Follow-up from: #18977

@ssncferreira ssncferreira changed the title feat: UI create workspace page with preset's icon and description feat(site): support icon and description in preset Jul 28, 2025
@bpmct bpmct requested a review from Copilot July 28, 2025 19:22
Copy link
Contributor

@Copilot Copilot AI left a 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 with Combobox in the workspace creation form
  • Updates preset option structure to include icon and description fields
  • Modifies Combobox to render preset icons using ExternalImage instead of Avatar

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

@ssncferreira ssncferreira marked this pull request as ready for review July 29, 2025 09:21
@ssncferreira ssncferreira requested a review from jaaydenh July 29, 2025 09:22
@@ -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" }));
Copy link
Contributor Author

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.

Copy link
Member

@Parkreiner Parkreiner Jul 29, 2025

Choose a reason for hiding this comment

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

Sorry to come in at the last minute (after things have been merged), but these test changes are papering over accessibility problems that the new code introduced. This is especially relevant, as there's a good chance that I'm going to be submitting a VPAT (Voluntary Product Accessibility Template) audit for coder/coder sometime in H2 for Marketing/GTM

There's a reason why the testing library changed the accessible name to "Rust Rust" – because that's the value that a screen reader will read out to a user who can't see. It's going to be super annoying for the user if they get doubled-up announcements as they cycle through every item in the options list

In my mind, what we can do instead is:

  1. Revert the accessible names for the test selectors to remove the duplicated values (so just Rust and just Go, rather than Rust Rust and Go Go)
  2. Set the alt text to an empty string

Alt text is only valuable if the content of the image isn't strictly decorative, and actually has semantic meaning that other content in the UI isn't capturing. Because we have the name right next to the image, we don't need the alt text. And or UI programming specifically, you can get away with empty alt text more often than you would think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Parkreiner Thank you for letting me know about this, this is really helpful context 👍

You're right: this PR introduced alt={option.displayName}, which led to the repeated accessible name (e.g. "Rust Rust"). I hadn’t realized that would have a direct impact on screen readers, that's super useful to know.

I’ll go ahead and:

  • Revert the alt attribute to use an empty string.
  • Update the tests to reflect the correct accessible names without duplication.

Appreciate you taking the time to call this out 🙂

@ssncferreira ssncferreira merged commit 71738f6 into main Jul 29, 2025
32 checks passed
@ssncferreira ssncferreira deleted the ssncferreira/feat-ui-preset-icon-description branch July 29, 2025 16:45
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy