From 44d93569859fa9040bafe9583c1c12c6dfa7c84e Mon Sep 17 00:00:00 2001 From: Susana Ferreira Date: Wed, 30 Jul 2025 09:54:43 +0100 Subject: [PATCH 1/3] fix(site): remove redundant alt text to prevent duplicated accessible names (#19087) ## Description Removes the redundant `alt` text in the `Combobox` component to prevent screen readers from announcing duplicated names (e.g. "Rust Rust"). ## Changes * Remove redundant `alt` text from `Combobox` `ExternalImage` * Update `Combobox` tests accordingly Related to: https://github.com/coder/coder/pull/19063#discussion_r2240459424 --- site/src/components/Combobox/Combobox.stories.tsx | 9 +++------ site/src/components/Combobox/Combobox.tsx | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/site/src/components/Combobox/Combobox.stories.tsx b/site/src/components/Combobox/Combobox.stories.tsx index 075a57261e536..2207f4e64686f 100644 --- a/site/src/components/Combobox/Combobox.stories.tsx +++ b/site/src/components/Combobox/Combobox.stories.tsx @@ -103,8 +103,7 @@ export const SearchAndFilter: Story = { screen.queryByRole("option", { name: "Kotlin" }), ).not.toBeInTheDocument(); }); - // Accessible name includes both image alt text and text content: "Rust Rust" - await userEvent.click(screen.getByRole("option", { name: "Rust Rust" })); + await userEvent.click(screen.getByRole("option", { name: "Rust" })); }, }; @@ -138,11 +137,9 @@ export const ClearSelectedOption: Story = { await userEvent.click(canvas.getByRole("button")); // const goOption = screen.getByText("Go"); // First select an option - // Accessible name includes both image alt text and text content: "Go Go" - await userEvent.click(await screen.findByRole("option", { name: "Go Go" })); + await userEvent.click(await screen.findByRole("option", { name: "Go" })); // Then clear it by selecting it again - // Accessible name includes both image alt text and text content: "Go Go" - await userEvent.click(await screen.findByRole("option", { name: "Go Go" })); + await userEvent.click(await screen.findByRole("option", { name: "Go" })); await waitFor(() => expect(canvas.getByRole("button")).toHaveTextContent("Select option"), diff --git a/site/src/components/Combobox/Combobox.tsx b/site/src/components/Combobox/Combobox.tsx index 6ef29cade0390..f2db25b1ef31c 100644 --- a/site/src/components/Combobox/Combobox.tsx +++ b/site/src/components/Combobox/Combobox.tsx @@ -124,7 +124,7 @@ export const Combobox: FC = ({ ) : ( /* Placeholder for missing icon to maintain layout consistency */ From 101351f50224f223b40d2100d106ab6a976404a2 Mon Sep 17 00:00:00 2001 From: Susana Ferreira Date: Wed, 30 Jul 2025 11:00:33 +0100 Subject: [PATCH 2/3] chore: update dogfood coder template presets with description and icon (#19084) ## Description This PR updates the dogfood template presets to include a description and a icon. Requires [terraform-provider-coder v2.9.0](https://github.com/coder/terraform-provider-coder/releases/tag/v2.9.0). Related to: * https://github.com/coder/coder/pull/18977 * https://github.com/coder/coder/pull/19063 --- dogfood/coder/main.tf | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/dogfood/coder/main.tf b/dogfood/coder/main.tf index b5c974efab1ad..3531257565f6b 100644 --- a/dogfood/coder/main.tf +++ b/dogfood/coder/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "~> 2.5" + version = "~> 2.9" } docker = { source = "kreuzwerker/docker" @@ -41,7 +41,9 @@ locals { } data "coder_workspace_preset" "cpt" { - name = "Cape Town" + name = "Cape Town" + description = "Development workspace hosted in South Africa with 1 prebuild instance" + icon = "/emojis/1f1ff-1f1e6.png" parameters = { (data.coder_parameter.region.name) = "za-cpt" (data.coder_parameter.image_type.name) = "codercom/oss-dogfood:latest" @@ -56,7 +58,9 @@ data "coder_workspace_preset" "cpt" { } data "coder_workspace_preset" "pittsburgh" { - name = "Pittsburgh" + name = "Pittsburgh" + description = "Development workspace hosted in United States with 2 prebuild instances" + icon = "/emojis/1f1fa-1f1f8.png" parameters = { (data.coder_parameter.region.name) = "us-pittsburgh" (data.coder_parameter.image_type.name) = "codercom/oss-dogfood:latest" @@ -71,7 +75,9 @@ data "coder_workspace_preset" "pittsburgh" { } data "coder_workspace_preset" "falkenstein" { - name = "Falkenstein" + name = "Falkenstein" + description = "Development workspace hosted in Europe with 1 prebuild instance" + icon = "/emojis/1f1ea-1f1fa.png" parameters = { (data.coder_parameter.region.name) = "eu-helsinki" (data.coder_parameter.image_type.name) = "codercom/oss-dogfood:latest" @@ -86,7 +92,9 @@ data "coder_workspace_preset" "falkenstein" { } data "coder_workspace_preset" "sydney" { - name = "Sydney" + name = "Sydney" + description = "Development workspace hosted in Australia with 1 prebuild instance" + icon = "/emojis/1f1e6-1f1fa.png" parameters = { (data.coder_parameter.region.name) = "ap-sydney" (data.coder_parameter.image_type.name) = "codercom/oss-dogfood:latest" @@ -101,7 +109,9 @@ data "coder_workspace_preset" "sydney" { } data "coder_workspace_preset" "saopaulo" { - name = "São Paulo" + name = "São Paulo" + description = "Development workspace hosted in Brazil with 1 prebuild instance" + icon = "/emojis/1f1e7-1f1f7.png" parameters = { (data.coder_parameter.region.name) = "sa-saopaulo" (data.coder_parameter.image_type.name) = "codercom/oss-dogfood:latest" From 26d232da6f23c37730fc06034680b52d13799b24 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 30 Jul 2025 11:18:12 +0100 Subject: [PATCH 3/3] fix(site): hide preset selector in TasksPage if no presets available (#19099) --- site/src/pages/TasksPage/TasksPage.tsx | 82 +++++++++++++------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/site/src/pages/TasksPage/TasksPage.tsx b/site/src/pages/TasksPage/TasksPage.tsx index 4866dbfb49222..68ec93e736fe7 100644 --- a/site/src/pages/TasksPage/TasksPage.tsx +++ b/site/src/pages/TasksPage/TasksPage.tsx @@ -386,55 +386,53 @@ const TaskForm: FC = ({ templates, onSuccess }) => { -
- - {isLoadingPresets ? ( - - ) : ( - + setSelectedPresetId(value || null) + } + > + + + + + {sortedPresets(presetsData).map((preset) => ( {preset.Name} {preset.Default && "(Default)"} - )) - ) : ( - - - No presets available - - - )} - - - )} -
+ ))} + + + + ) + )}