mirror of
https://github.com/coder/coder.git
synced 2026-12-01 19:08:01 +08:00
970ec0ccd3fca7106b92ca2ccfe7b6eedeeb634a
18167
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
970ec0ccd3 |
fix: drop gated Azure claude-mythos-5 from the known models catalog (#32781)
The scheduled `aigateway-prices-refresh` workflow [failed](https://github.com/coder/coder/actions/runs/45788506647/job/139801293933) with `azure/claude-mythos-5: model missing from upstream`. models.dev removed the model from its Azure provider because it is a gated research preview in the Foundry partner catalog ([anomalyco/models.dev#14607](https://github.com/anomalyco/models.dev/pull/14607)), but `curation.json` still listed it. This removes the Azure entry from `curation.json` and from the generated known-models catalog, which `TestCurationMatchesGeneratedCatalog` requires to stay in sync. The Anthropic `claude-mythos-5` entry is unchanged. The price update itself will be handled by the `aigateway-prices-refresh` workflow, which will be rerun manually after this PR is merged. > [!NOTE] > Generated with Coder Agents on behalf of @ssncferreira. |
||
|
|
d783c6c48d |
fix(site/src): reconcile the scroll position before paint when the timeline regroups (#32546)
With collapsed assistant steps, when a turn that has a reply between its
steps ends, the grouping folds the turn's blocks and the reply into one
block in a single commit. The timeline shrinks, the browser clamps the
scroll position, and the anchored prompt drops until the scroller's
resize pass runs, which its ResizeObservers defer to a later animation
frame. In a Chromium Storybook probe on current main (600px transcript,
about 2,000 characters of reply between two steps), the prompt sat 118px
low in the commit and in the first animation frame, and was back in
place by the second. With a one-line reply the drop was 10px.
`ConversationTimeline` now runs the scroller's resize pass, the
context's `handleResize`, from a layout effect, before paint, when a
commit removes or replaces a timeline item key. The vendored scroller
exports `useMessageScrollerContext` for it, a LOCAL CHANGE.
The sync is limited to removals because an append cannot shrink the
timeline, and in following mode the resize pass scrolls to the end: on
an append it would scroll to the end before the scroller anchors a newly
sent prompt. `SendingFromHistoryDoesNotSnapToBottom` passed 10 of 10
runs.
Refs CODAGT-1586
> 🤖 This PR was created with the help of Coder Agents.
|
||
|
|
3fea25447a | test(coderd): deflake queued reasoning effort test (#32782) | ||
|
|
a81eecdb71 |
fix(site/src): name MultiSelectCombobox remove and clear-all buttons (#32763)
The per-badge remove button and the clear-all button in
`MultiSelectCombobox` rendered only an `XIcon`, so they had no
accessible name and axe reported `button-name` (WCAG 4.1.2). They are
now named "Remove <option label>" and "Clear all", matching `TagInput`
and `FilterCombobox`. The `data-testid` attributes are removed, and
every caller now queries the buttons by role and name.
Enter already activates each button once, not twice as the ticket
suspected: cmdk's root `onKeyDown` prevents the default of Enter, so the
native click never fires and the button's own Enter handler is the only
path. A short comment now explains why those handlers must stay, and a
new test guards it.
Closes DEQ-664
| Ticket | UI surface |
|---|---|
| DEQ-664 | `MultiSelectCombobox` badge remove and clear-all buttons:
IdP organization, group, and role sync; OAuth2 app form scopes;
multi-select dynamic parameters. Accessible names only, no visual
change. |
**Dropped review findings**
- Focus is lost after a keyboard removal (frontend-accessibility manual
focus check, SA6). When Enter removes a badge or clears all, the focused
button unmounts and focus falls to `<body>`. This happens on `main` too
and is not caused by this diff. Fixing it would mean new focus
management (for example, moving focus to the input), which is a behavior
change outside this ticket. It should be its own ticket.
<details>
<summary>Decision log</summary>
- **Names:** I followed the existing `Remove ${value}` pattern
(`TagInput`, `FilterCombobox` chips) and the "Clear all" copy
(`FilterCombobox`). `aria-label` is correct here because the buttons
have no visible text.
- **Enter behavior:** In jsdom and in real Chromium (Vitest browser
mode), Enter on either button calls `onChange` exactly once on `main`.
Removing the button's Enter handler makes Enter do nothing (0 calls),
because cmdk calls `preventDefault()` on Enter. So the handlers stay.
Space and Backspace/Delete in the input are unchanged.
- **Tests:** They extend the existing "Multi-Select Parameter" block in
`DynamicParameter.test.tsx`, which renders `MultiSelectCombobox` (same
place as #32678). "handles option deselection" now clicks "Remove Option
1" and expects `onChange` exactly once. A new `it.each` presses Enter on
"Remove Option 1" and "Clear all" and expects one call with
`["option2"]` and `[]`. All three fail on `main` (no named buttons). The
Enter cases also fail with 0 calls when the Enter handlers are removed.
- **Callers:** `OAuth2AppForm.test.tsx` and the `OAuth2AppForm` and
`MultiSelectCombobox` stories now use the role queries. The clicked
badge is the same one as before, so screenshots are unchanged. Nothing
under `site/e2e` used the test IDs.
- **Story cleanup:** `ClearAllComboboxItems` no longer ends with a
`waitFor(... toBeInTheDocument())` assertion, because play functions
must not assert (FE1) and this diff edits that play.
- **Commit scope:** The scope is `site/src` because the changed tests
live under `modules/` and `pages/`.
- **Self-review:** frontend-review (FE1 to FE10 pass);
frontend-deep-review (two findings fixed, the story assertion and the
Enter rationale comment, then a clean second pass);
frontend-accessibility: a full axe run in Chromium on the component with
badges selected, closed and open, gives `button-name` 3 violations on
`main` and 0 on this branch.
- **Pre-existing, untouched:** axe reports `aria-valid-attr-value` on
the closed cmdk input (`aria-controls` points at the unmounted list) on
both `main` and this branch.
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
4e82a34246 |
fix(site/src/modules/dashboard/DeploymentBanner): let pointer input reach the health tooltip (#32762)
The deployment banner's health tooltip set `pointer-events-none` on its content. Once #32747 caps tooltips to the viewport height and lets them scroll, a long list of health errors gets clipped, and with that class the wheel and pointer can't reach the list. Low-vision users at 400% zoom can't read the hidden errors. This PR removes the class. Radix tooltips are hoverable by default, so the tooltip stays open while the pointer moves from the trigger into the content (WCAG 1.4.13). The class dates back to the original MUI styles (#10193), carried over unchanged in #19477. No reason is recorded, and nothing in the current Radix tooltip depends on it. The redundant `border` class goes too, because the base tooltip styles already include it. The `WithHealthIssues` story now moves the pointer onto the tooltip content after opening it. That step throws "element has `pointer-events: none`" on the old code, so the story guards the fix. It replaces a play-function `toBeInTheDocument` assertion (FE1). A Vitest test can't catch this regression, because jsdom doesn't load Tailwind CSS. Depends on #32747 for the short-viewport scroll. This PR is the last piece of the ticket. Closes DEQ-660 | Ticket | UI surface | Screenshots | |---|---|---| | DEQ-660 | Deployment banner health tooltip (`modules/dashboard/DeploymentBannerView`, `WithHealthIssues`) | pending | **Dropped review findings** - Make the tooltip `interactive`: dropped. The trigger is a RouterLink to `/health`, and an interactive tooltip's trigger click calls `preventDefault` and pins the tooltip open. `Tooltip.tsx` documents not to use it on link triggers. The content has nothing focusable, so `interactive` wouldn't help keyboard users either. - Add a health fixture with several errors and a short-viewport story: dropped. This PR doesn't change the rendered UI, and #32747's `TallerThanViewport` story already covers the capped, scrolling tooltip. - Vitest test for hovering the content: dropped. It would pass on the old code (test-audit gate), because jsdom doesn't apply `pointer-events`. **Notes (pre-existing, out of scope)** - axe `link-name` (serious): the health trigger link with errors is icon-only and has no accessible name. - Once #32747 is merged, a clipped health tooltip becomes a scroll region with no focusable content (`scrollable-region-focusable`). Keyboard users can still reach the full list through the trigger, which links to `/health`. <details> <summary>Decision log</summary> - Based on `main` rather than stacked on #32747: removing `pointer-events-none` is correct on its own, and together with #32747 the clipped list becomes scrollable. - Kept the plain Radix tooltip instead of `<Tooltip interactive>` or a Popover. That keeps the `/health` link on the trigger and its focus-shows-description behavior, and Radix already keeps the content open on hover. - Verified: the `WithHealthIssues` story fails with `pointer-events-none` restored and passes without it. With the pointer resting on the content, the tooltip is still open 1 s later, so Pixel still captures it. An axe-core 4.11.1 run on the hovered state found only the pre-existing `link-name` note above. - Checks: `pnpm check`, `pnpm lint`, `pnpm format`, `pnpm lint:types`, Vitest and story tests for `DeploymentBanner`. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
deadf82295 |
fix(site/src): return focus after workspace error and cancel build dialogs close (#32761)
When a workspace action fails, or after a build cancel, the follow-up dialog sent focus to `<body>` on close (WCAG 2.4.3). These dialogs render no `DialogTrigger`, so Radix has nothing to return focus to. #32682 fixed the confirm dialogs in the "Workspace actions" menu with `onCloseAutoFocus`; this extends the same pattern to the dialogs it missed. `WorkspaceErrorDialog`, `UpdateBuildParametersDialog`, and `WorkspaceBuildCancelDialog` now accept an optional `onCloseAutoFocus` and forward it to Radix. `WorkspaceMoreActions` passes its existing `returnFocusToTrigger` to the delete error dialog and the update parameters dialog. In the Workspaces table, the "Cancel build" button records itself in the existing `confirmReturnFocusElement` state, and its dialog uses the existing `returnFocusFromConfirm`. Closes DEQ-662 Closes DEQ-663 | Ticket | UI surface | |---|---| | DEQ-662 | "Workspace actions" menu (Workspaces table and workspace page): "Error deleting workspace" dialog and "Update workspace parameters" dialog. Focus returns to the menu trigger (not visible) | | DEQ-663 | Workspaces table row "Cancel build" button: "Cancel workspace build" dialog. Focus returns to the button on Cancel or Escape (not visible) | Review findings dropped: none. Known gaps, left out of scope: - After you confirm a build cancel, focus still lands on `<body>`. The "Cancel build" button becomes disabled and then unmounts, and the row's "Workspace actions" trigger is disabled while the build is still running, so nothing in the row can take focus. The Stop and Restart confirms in #32682 behave the same way. - The workspace page renders `WorkspaceBuildCancelDialog`, its restart `WarningDialog`, and its own `WorkspaceErrorDialog` from `WorkspaceReadyPage` without focus return. The Workspaces table's update and start `WorkspaceUpdateDialogs` also lack it. Fixing those means passing the trigger through `Workspace`, `WorkspaceTopbar`, and `WorkspaceActions`, which is a separate change. <details> <summary>Grouping and decision log</summary> - DEQ-662 and DEQ-663 share one root cause: these dialogs have no `DialogTrigger` and no `onCloseAutoFocus`. That is why they ship in one PR. - I fixed each caller instead of the shared `Dialog` primitive, as #32682 did. A primitive-level fix would change focus behavior for every dialog in the app. Each new prop is optional because other callers still omit it (`WorkspaceReadyPage`, `WorkspaceUpdateDialogs`). - `PrimaryAction`'s `onClick` type now receives the click event, so the "Cancel build" handler can read `event.currentTarget`. `Button` already passed the event, so the other callers are unchanged. - Tests: I added three cases next to the #32682 focus test in `WorkspacesPageView.test.tsx`: - focus returns after Escape on the delete error dialog; - focus returns after Cancel on the update parameters dialog; - focus returns after Cancel on the cancel build dialog. With the production changes reverted, all three fail with focus on `<body>`. - Self-review: frontend-review (FE1 to FE10), frontend-deep-review (all eight roles, sequential), and frontend-accessibility (code audit plus manual focus check). The only finding was TS3: a test fixture variant was inlined, so I made it a named `mockCancelableWorkspace` constant. I skipped the Storybook axe pass because the diff changes no markup or ARIA, only focus handlers. - Checks: `pnpm test` (`WorkspacesPage`, `WorkspacePage`, `modules/workspaces`), `pnpm check`, `pnpm lint`, `pnpm format`, `pnpm lint:types`. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
3ba7199fde |
fix(site/src/pages/CreateUserPage): show and link the organization field error (#32768)
On Create user, the Organization field was a hand-built `Label` and
`OrganizationAutocomplete`, so validation errors were never shown next
to it or linked to it. This PR routes the field through `FormField` with
a `control` render prop, the same pattern `TemplateCustomizationsStep`
and `ChatProjectDialog` use:
- The trigger gets `aria-invalid` and an `aria-describedby` that points
at the current error.
- The error text renders under the field, and the trigger gets the
destructive border like the other fields.
- A client-side `required` rule shows "Please select an organization."
when the user submits without one. Before, the request went to the
server with an empty ID.
- Backend `organization_ids` validation errors map to the field.
- The label shows the required asterisk like the other required fields.
The e2e `createUser` helper already looks up `getByLabel("Organization
*")`.
Closes DEQ-658
| Ticket | UI surface | Screenshots |
|---|---|---|
| DEQ-658 | `/deployment/users/create` with multiple organizations,
story `pages/CreateUserPage` | [DEQ-658
screenshots](https://linear.app/codercom/issue/DEQ-658#comment-a0c5d533)
|
Changes:
- `CreateUserForm.tsx`: use `FormField` for the organization field, add
the `required` rule, and map the `organization_ids` backend field.
- `CreateUserForm.test.tsx`: submitting without an organization
describes the trigger with the error and does not call `onSubmit`. This
test fails on `main`.
- `CreateUserForm.stories.tsx`: add an `OrganizationRequired` story for
the error state. The `WithOrganizations` combobox query becomes
`/^Organization/`, because the accessible name now includes the
asterisk.
<details>
<summary>Decision log and notes</summary>
- `FormField` with `control` was chosen over hand-wiring `aria-*`. It is
the existing primitive, and two other organization pickers already use
it.
- The hard-coded `id="organization"` was dropped in favor of the ID that
`FormField` generates. Nothing referenced it.
- Dropped review findings:
- DF5 nit: when the permitted organizations query fails, the field shows
the required error over an empty picker. That load-error handling is
pre-existing and out of scope for this ticket.
- TS1 nit: `WithOrganizations` still has two `aria-expanded` assertions
in its `play`. They are pre-existing, and this diff only changes the
query.
- axe on the error state finds no violations.
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
0fc090ae40 |
fix(site/src): remove the undefined highlight-grey theme color (#32767)
`@theme` mapped `--color-highlight-grey` to
`hsl(var(--highlight-grey))`, but no theme block defines
`--highlight-grey`, so any `*-highlight-grey` utility would render no
color. Nothing in `site/` uses it, so this PR removes the entry.
Closes DEQ-657
| Ticket | UI surface |
|---|---|
| DEQ-657 | None. `site/src/index.css` theme tokens, with no rendered
change |
<details>
<summary>Decision log and notes</summary>
- Removal was chosen over defining `--highlight-grey` in every theme.
The token has no users and no design value to match, and inventing
per-theme values would need contrast review for a color nothing renders.
- `grep -rn highlight-grey site/` (excluding `node_modules`) returns
nothing on this branch.
- No screenshots, because nothing renders differently.
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
51676cbc2d |
fix(site/src/pages/CliInstallPage): use the theme text color for the link underline (#32766)
The CLI install page's "Go to workspaces" link set its underline to a hardcoded `hsla(0,0%,100%,0.7)`, which is almost invisible on the light theme background. This PR drops the override, so the underline uses the link's `text-content-primary` color in every theme. `underline-offset-[3px]` also becomes the equivalent `underline-offset-3`. Closes DEQ-656 | Ticket | UI surface | Screenshots | |---|---|---| | DEQ-656 | `/cli-install` page, story `pages/CliInstallPage` | [DEQ-656 screenshots](https://linear.app/codercom/issue/DEQ-656#comment-076ff66c) | <details> <summary>Decision log and notes</summary> - The link's own text color was chosen over a separate `border-*` token. The underline then always matches the link text, and the link stays distinguishable in every theme with no new token. - Self-review: frontend-review, frontend-deep-review, and frontend-accessibility found no blocking or should-fix issues. axe on the story finds no violations on `main` or this branch. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
4e45baa790 |
fix(site/src/modules): keep one scroll region in the user menu org list and port forward popover (#32765)
The user menu's organization list (`max-h-64 overflow-y-auto`) and the port forward popover's listening-ports section (`max-h-80 overflow-y-auto`) each had a fixed-height scroll box inside a popup that already caps at `--radix-popper-available-height` and scrolls. At 200% zoom or on short viewports this nested a second scroll region in the first. This PR removes the inner caps, so the popup is the only scroll region. The approach matches the Proxy menu fix in #32746. Closes DEQ-659 | Ticket | UI surface | Screenshots | |---|---|---| | DEQ-659 | Navbar user menu organization picker, workspace port forward popover | [DEQ-659 screenshots](https://linear.app/codercom/issue/DEQ-659#comment-4fe7d972) | Measured in Storybook at 720x450 (`desktopZoom200` size) with 20 listening ports and 14 organizations: - Port forward popover: on `main`, a 320px inner scroller sits inside the 380px popover. On this branch the only scroller is the popover. - User menu: on `main`, a 256px inner scroller sits inside the 388px menu, and axe reports `scrollable-region-focusable` on it. On this branch the menu is the only scroller and that violation is gone. Arrow keys move through the organizations and scroll the menu. The `PortForwardButton.tsx` diff is mostly re-indentation from removing the wrapper (`git diff -w` shows 2 lines). <details> <summary>Decision log and notes</summary> - Removing the cap was chosen over a flex `min-h-0` layout. Both popups already scroll, and the Proxy menu fix used the same approach, so the user menu and port forward popover now behave alike. - Trade-off: on a tall viewport, a long listening-ports list now grows the popover up to the available height instead of 320px, so "Shared ports" can sit below the fold until the user scrolls. One scroll region beats a nested one for keyboard and low-vision users, and the popover still never overflows the viewport. - axe reports `aria-dialog-name` on the port forward popover on both `main` and this branch. That is pre-existing and not touched here. - No new tests. The change is layout only and jsdom can't measure it. Existing PortForwardButton and UserDropdown tests pass. - Self-review: frontend-review, frontend-deep-review (8 roles), and frontend-accessibility found no blocking or should-fix issues. One reviewer asked whether this should match DEQ-661's approach, which keeps a capped list inside a flex tooltip. The two differ on purpose. Tooltips have a heading and a footer link that must stay visible, while these popups are menus and forms, where the whole surface should scroll. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
f65ff35c48 |
fix(site/src): give the spend page organization picker a visible label (#32698)
On AI settings > AI spend with more than one organization, the organization picker in the page header showed only the selected organization's name. Its purpose existed only in `aria-label`, so sighted users had no visible label (WCAG 3.3.2). `OrganizationAutocomplete` gets an optional `label` prop. It renders a visible `Label:` prefix before the value, like `DateTimeRangePicker`'s `valuePrefix`. Unless `ariaLabel` is set, it also names the trigger "Label: value" (or "Label" with nothing selected), so the visible label is part of the accessible name (2.5.3). The value and the placeholder both truncate, so the prefix never pushes the chevron out of the trigger. `AISpendPageView` passes `label="Organization"` instead of its hand-built `ariaLabel`, and the trigger widens from `w-60` to `w-80 max-w-full` so the prefix fits next to the name or the placeholder. Closes DEQ-649 | Ticket | UI surface | |---|---| | DEQ-649 | AI settings > AI spend, organization picker in the page header (2+ organizations, or an unavailable organization). [Screenshots](https://linear.app/codercom/issue/DEQ-649#comment-06c5f38c) | Verification: - **Rendering (Storybook `AISpendPageView`):** Overview reads "Organization: My Organization", and the accessible name is the same. OrganizationUnavailable reads "Organization: Select an organization…" and is named "Organization". At 1280px neither is truncated. - **320px:** in both Overview and OrganizationUnavailable, the trigger stays inside the viewport (273px), its content fits (`scrollWidth` equals `clientWidth`) and the chevron stays inside the border. The organization name or placeholder truncates by a few characters; the full name stays in the accessible name. The page's horizontal overflow at 320px comes from the overview cards and also happens on `main`. - **Tests:** `AISpendPage.test.tsx` now finds the trigger as "Organization: My Organization". The AI spend and `OrganizationAutocomplete` tests pass. - **Checks:** pre-commit (`lint/ts`, `pnpm check`) passes. <details> <summary>Decision log</summary> - **Moved to the redesign by a merge from `main`:** #32686 deleted `SpendPage`, `SpendFilters` and their tests, which this PR first changed. The deletions are kept; the same `label` prop now applies to the redesigned page's single picker. The earlier `SpendFilters` flex-basis change went away with that file. - **Prefix inside the trigger, not a separate `<Label>`:** this keeps the header layout, and it matches `DateTimeRangePicker`'s `valuePrefix`, the closest existing visible-prefix API. `OrganizationField`'s stacked label is meant for forms. - **Name built from `label`:** callers that pass `ariaLabel` are unchanged, and callers that pass neither still get no `aria-label`. - **`w-80`:** at `w-60`, "Organization:" plus "Select an organization…" didn't fit. That was the reason the first round left the old fallback picker alone. The redesign uses one picker for both states, so it is widened instead. `max-w-full` keeps it inside narrow viewports. - **Size:** about 20 non-test lines. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
1bba8b7089 |
fix(site/src/components/Filter): name the select filter dropdown dialog (#32693)
When a `SelectFilter` opens, its popover renders `role="dialog"` with no
accessible name, so screen readers announce an unnamed dialog. axe
reports `aria-dialog-name` (serious). This passes the filter's `label`,
already the trigger's accessible name (for example "Select provider"),
to the dropdown as `aria-label`. Radix puts it on the dialog element.
Closes DEQ-636
| Ticket | UI surface |
|---|---|
| DEQ-636 | Every `SelectFilter` dropdown: audit log, AI Gateway
sessions, AI spend provider, model and client filters |
No screenshots: the change only adds an accessible name, so nothing
changes visually.
Verification:
- **Unit test:** a new `SelectFilter` test checks the dialog's
accessible name. It fails without the change.
- **Storybook axe (Spend page "Select provider" dropdown):**
`aria-dialog-name` fails on `main` and passes on this branch.
- **`components/SelectFilter` stories:** their meta args now pass the
required `label` ("Select an option"), as real callers do, so the story
the ticket cites opens a named dialog. The label is only an
`aria-label`, so nothing changes visually.
- **Checks:** `pnpm check` and `pnpm lint` pass.
Notes (pre-existing, not changed here):
- **`scrollable-region-focusable`**, which the ticket mentions, still
fires on the no-search list. Keyboard users can still scroll it: focus
moves into the list on open, and cmdk handles the arrow, Home and End
keys.
- **The other 8 `ComboboxContent` callers** also render unnamed dialogs
(for example `WorkspacesButton`, `ChangeWorkspaceVersionDialog`, the IdP
sync forms). Review filed DEQ-653 for them.
<details>
<summary>Decision log</summary>
- **Fix in `SelectFilter`, not `ComboboxContent`:** `ComboboxContent`'s
only `label` prop names the search input, and its other callers have
different triggers. Changing the primitive would touch 8 more surfaces
beyond this ticket. A follow-up could have `Combobox` generate a trigger
id and default `aria-labelledby` to it.
- **`aria-label` vs `aria-labelledby`:** the trigger is named by its own
`aria-label`, not visible text, so there is no element to reference.
Reusing the same string keeps the trigger and dialog names identical.
- **Size:** 1 source line plus a comment fix and 1 story arg; the rest
is test.
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
b922c9db92 |
fix(site/src): raise light theme error text contrast (#32692)
In the light theme, `--content-destructive` (red-600, `#DC2626`) is 4.83:1 on white but 4.39:1 on `--surface-secondary`, under the WCAG 1.4.3 minimum of 4.5:1. Error text on highlighted or secondary rows failed, for example a critical latency in the highlighted row of the navbar region menu. In the `light-protan-deuter` theme the token was orange-500, which fails even on white (2.85:1). This raises the text token only, the same split #32047 made for warnings: | Theme | Before | After | On primary / secondary / tertiary / surface-red | |---|---|---|---| | light | red-600 `0 72.2% 50.6%` | red-700 `0 73.7% 41.8%` | 6.46 / 5.89 / 5.09 / 5.27 | | light-protan-deuter | orange-500 `24 95% 53%` | `17 88% 37%` (`#B13A0B`) | 6.01 / 5.48 / 4.73 / 5.26 | - `light-tritan` inherits the light value. The dark themes already passed and are unchanged. - `--border-destructive` (icons, borders) is unchanged. - In `light-protan-deuter`, the new value is a shade darker than the light theme's orange-700 warning text, but that theme's warning is fuchsia, so destructive and warning stay distinct. - The existing warning contrast test in `theme/cssVariables.test.ts` now also checks `--content-destructive` at 4.5:1 on the primary, secondary, tertiary and red surfaces in every theme. It fails on the old values. Tertiary covers error text in tertiary chips, such as the upload error in `WorkspaceUploadPreview`. Closes DEQ-631 | Ticket | UI surface | |---|---| | DEQ-631 | All light-theme error text (`text-content-destructive`), e.g. navbar region menu critical latency, form field errors. [Screenshots](https://linear.app/codercom/issue/DEQ-631#comment-17f5637a) | Verification: Storybook axe on `modules/dashboard/ProxyMenu` (critical latency, highlighted row, light theme) reports `color-contrast` (serious, 4.39:1) on `main` and passes on this branch. The pixel diff of that menu changes only the latency text and icon color (`#DC2626` to `#B91C1C`). `FormField` WithError changes only the error line. `pnpm check` and `pnpm lint` pass. Notes (pre-existing, not changed here): - `DeploymentBannerView` draws a near-black icon on `bg-content-destructive`. The darker red lowers that to 3.07:1 (light) and 3.31:1 (light-protan-deuter), still above the 1.4.11 minimum of 3:1. - Filed by review: DEQ-654 (`--content-success` under 3:1 in the protan-deuter and tritan light themes) and DEQ-655 (protan-deuter destructive border and badge contrast). <details> <summary>Decision log</summary> - **Red-700:** the closest Tailwind red that passes on every surface error text renders on, including `--surface-red` (alerts, log error rows). Red-650 would pass secondary (5.30) but leave little margin. - **Protan-deuter:** the variant overrode the token with orange-500, which failed everywhere. Orange-700 (`17 88% 40%`) was the first choice, but review found it is 4.18:1 on `--surface-tertiary`, so it is darkened to `17 88% 37%`, as the reviewer suggested. The theme moves warning to fuchsia, so the two states stay apart by hue. - **Graphics token untouched:** following #32047, only text needs 4.5:1. Icons and borders use `--border-destructive` and need 3:1. That holds in light, but in `light-protan-deuter` it is 2.85:1 on white, a pre-existing gap tracked in DEQ-655. - **Test:** merged into the existing parametrized contrast table instead of a near-duplicate block, per review. - **Size:** 2 CSS lines; the rest is test. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
74a77063a1 |
fix(site): announce the highlighted inline autocomplete option (#32691)
In inline search mode, `Autocomplete` points the input's `aria-controls`
and `aria-activedescendant` at ids it passes to `CommandList` and
`CommandItem`. cmdk writes its own generated `id` after spreading props,
so neither id ever rendered. Screen readers announced nothing as the
user arrowed through suggestions (AI settings > Models > Add model,
model identifier field).
The repository already patches cmdk 1.1.1 so an Item's `aria-selected`
prop wins. This extends that patch so an `id` prop on `Command.List` and
`Command.Item` replaces cmdk's generated id. An Item uses that id
internally too, so cmdk's highlight recovery and score sort keep
working. `Autocomplete` now derives each option id from the option value
rather than its index, because cmdk requires an Item id to stay the same
while the item is mounted.
`ModelSelector` was the only other caller passing an `id` to
`CommandList`. cmdk used to drop it, so the trigger's `aria-controls`
pointed nowhere. With the patch, that id would also break
`CommandInput`'s own `aria-controls`. The trigger now points at its
popover instead, the same as `OrganizationAutocomplete`, and no longer
overrides Radix's `aria-haspopup="dialog"` with `"listbox"`, so the
announced popup type matches the popup.
Closes DEQ-627
| Ticket | UI surface |
|---|---|
| DEQ-627 | AI settings > Models > Add model, model identifier
suggestions (and any `inlineSearch` `Autocomplete`); `ModelSelector`
trigger `aria-controls` |
No screenshots: the change only fixes ARIA id references, so nothing
changes visually.
Verification:
- **Unit tests:** the new `Autocomplete` tests fail without the patch
and pass with it. One checks that `aria-controls` and
`aria-activedescendant` resolve to the listbox and the highlighted
option. The other is an `it.each` that keeps a highlighted match after
typing filters options out; it caught a regression in an earlier,
index-based version of this fix. A new `ModelSelector` test checks that
the trigger's `aria-controls` and `aria-haspopup` match the opened
popup; it fails on `main`.
- **Storybook axe (`components/Autocomplete` InlineSearch, AI Models add
form):** `aria-valid-attr-value` (critical) fails on `main` and passes
on this branch. `scrollable-region-focusable` on the model identifier
listbox is also gone, because the listbox is now owned by the combobox.
- **Checks:** `pnpm check` and `pnpm lint` pass.
Dropped review findings:
- **Drop `ModelSelector`'s own `aria-controls` and let Radix wire it:**
`aria-haspopup="listbox"` is removed as suggested, but the explicit
`aria-controls` and `PopoverContent` id stay. oxlint's
`jsx-a11y/role-has-required-aria-props` requires `aria-controls` on
`role="combobox"` and can't see the one Radix adds at runtime. Our props
override Radix's on both elements, so the reference still resolves
(covered by the new test).
- **`encodeURIComponent` throws on a lone UTF-16 surrogate:** option
values are catalog model ids, so this is not reachable today.
<details>
<summary>Decision log</summary>
- **Root cause:** cmdk 1.1.1 renders `{...props, id: generatedId}` on
both List and Item, so any `id` prop is silently overwritten. FE6
already warns about cmdk overwriting `aria-*` props.
- **Chosen fix: extend the existing pnpm patch.** It is the smallest
change at the source, and the repo already uses this patch for the same
kind of override. Alternatives rejected:
- Reading cmdk's generated ids back from the DOM: needs refs and effects
(FE8) and races cmdk's own rendering.
- Rendering a separate listbox outside cmdk: duplicates the primitive
(FE3).
- **Item id is also cmdk's internal id:** the first version only
replaced the DOM id. A reviewer traced that cmdk's unmount cleanup
compares the DOM id with its registration id, so filtering out the
highlighted option left nothing highlighted and Enter did nothing. The
patch now feeds the prop into cmdk's own `useId` slot.
- **Value-based option ids:** index-based ids changed when an earlier
option was filtered out while the option stayed mounted. cmdk registers
an item only once, so its bookkeeping went stale ("No results found"
next to a live option, lost highlight). The ids now come from
`encodeURIComponent(optionValue)`; values are already unique React keys.
- **List id override:** a List with its own id no longer matches
`Command.Input`'s `aria-controls`. The patch header says to give a List
an id only when it has no `Command.Input`. `ModelSelector` was the only
caller doing both, and it was updated. Per review, the `CommandList` and
`CommandItem` wrappers in `Command.tsx` now document these caller rules
too.
- **Size:** about 30 non-test lines plus the regenerated patch and
lockfile hash.
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
8b112f3748 |
fix(site): standardize keyboard shortcut hints (#32776)
> 🤖 This PR was written by Coder Agents on behalf of Jake Howell. Stacked on #32655. Review this PR against that rule branch. - Use shared `Kbd` and `KbdGroup` in the agent send tooltip/menu and inline diff-comment footer. - Match Command/Control and Option/Alt labels to the platform, including the native template Build title. - Make the queued-message hint follow the existing send preference and coarse-pointer behavior without changing key bindings or mobile visibility. <details> <summary>Audit and validation</summary> A fresh agent received the new rule and production frontend scope, without the known candidate files. It found all three previously identified cases and a fourth: the queued-message hint incorrectly advertised Enter when the handler required a modifier. The cleanup reuses the shared key primitives, platform helpers, and send-preference helper. Native titles and accessibility metadata remain strings. Four visual stories cover default, modifier, coarse-pointer, and macOS states. The queue hint owns its media-query subscription in a small child component. Validation completed: frontend lint, 185 focused unit tests, and 135 Storybook tests passed before the final component-boundary cleanup. The final diff passes `pnpm check`, TypeScript, and `git diff --check`. Eight frontend review roles and the test-value audit ran; their code findings were addressed. No public docs change is needed because keyboard behavior is unchanged and the existing agent guide describes these bindings. The browser/accessibility comparison was interrupted by a workspace disconnect and is not claimed complete. No screenshots are uploaded in this PR. </details> |
||
|
|
2b777a99d1 |
docs(.claude): standardize keyboard shortcut hints (#32655)
> 🤖 This PR was written by Coder Agents on behalf of Jake Howell. Add an FE3 rule for keyboard shortcut hints and wire it into both frontend review checklists. Require shared key badges and platform-aware labels that match the actual bindings, while preserving native string attributes, accessibility metadata, and shortcut behavior. Refs #32654. <details> <summary>Rule validation</summary> Ran an independent read-only audit of `site/src` using the new rule without supplying candidate files. It identified the send-button tooltip/menu, diff comment Esc hint, incorrect macOS Build tooltip, and a queued-message hint that ignores the send preference. Product fixes are kept in a separate stacked PR. Markdown lint, table formatting, rule links, punctuation, and diff checks passed. </details> |
||
|
|
856a8684cb |
fix: prevent channel shutdown send races (#29658)
Workspace update subscriptions and VPN tunnels could close a channel
while another goroutine was still sending on it, panicking with `send on
closed channel`. VPN senders could also block forever once nothing read
the channel.
- `coderd`: `sub.Close` no longer closes the updates channel, so a
pubsub callback still running cannot send on a closed channel.
- `vpn`: after Stop, the tunnel no longer closes the shared send
channel. The writer exits after writing the Stop response, so Stop is
the final frame, and its exit is what ends the senders below.
- `vpn`: a speaker send context ends when the speaker is canceled or the
writer exits, for example on a write error. RPCs, RPC replies, updates
and logs wait on it, so they return instead of blocking on a channel
nothing reads. Before, an update holding the updater mutex could block a
Stop the tunnel had already read. The updater context derives from it,
so the updater also stops after Stop when Start never succeeded.
- `vpn`: RPC response channels are buffered, so delivering a response no
longer deadlocks against a caller canceled at the same moment. That
deadlock exists on main for a canceled caller context, and the send
context adds a cancellation at shutdown. A response received before EOF
or writer exit is returned instead of an error.
<details>
<summary>Decisions and regression evidence</summary>
- Nothing observes the subscription channel closing: its only reader,
`WorkspaceUpdates` in `tailnet/service.go`, also stops on its stream
context and calls `Close` itself.
- The tunnel does not cancel its speaker after Stop. Senders return once
the writer has finished the Stop response rather than when it is handed
over, and a request the manager sends after Stop stays parked until
`Tunnel.Close`, as on main.
- `updater.stop` is unchanged: it cancels after closing the conn, so
logs the conn emits while closing reach the manager (the tunnel is the
only log sink with `UseAsLogger` on macOS).
`TestTunnel_StopForwardsCloseLogs` guards that ordering.
- RPCs wait on the send context directly instead of relying on
`recvLoopDone`. The receive loop cannot exit while it is handing a
request to a busy `requestLoop`, and closing a blocking file descriptor
may not interrupt its read. `recvFromSerdes` still delivers requests
after the writer exits, so a Stop it has already read is not dropped.
When only the writer has exited, RPCs return `io.ErrUnexpectedEOF`, as
for EOF. Every RPC return removes its response channel, so RPCs that
fail after the writer exits do not accumulate entries.
- Against main's production code:
- `TestWorkspaceUpdatesClose/{QueryInFlight,CallbackAfterClose}` and
`TestTunnel_StopConcurrentSenders` panic with `send on closed channel`.
- `TestSpeaker_ResponseDuringCancellation` deadlocks.
- `TestSerdes_StopClosesAfterResponse` receives a frame after Stop.
- `TestTunnel_StopAfterWriterExits` and
`TestSpeaker_RPCAfterWriterExits` stay blocked after the writer exits.
- `TestSpeaker_ResponseBeforeEOF`,
`TestSpeaker_ResponseBeforeWriterExits` and
`TestTunnel_StopForwardsCloseLogs` pass on main. They guard ordering the
fix depends on: each fails when that ordering is changed or the matching
part of the fix is removed.
- The regression tests pass 50 runs with `-race`. The `vpn` and
`tailnet` race suites pass.
</details>
> This PR was created with the help of Coder Agents for @mafredri and
will be reviewed by a human.
|
||
|
|
f6fe51a852 |
docs: warn that chats sharing a workspace are not isolated (#32754)
Chats attached to the same workspace share its files and don't know about each other. If two chats use the same path, one overwrites the other, so content from a private repository can end up in another repository, including a public one. This adds a short section on the risk and how to avoid it to the Coder Agents architecture page, and links to it from the overview where it mentions choosing a workspace. |
||
|
|
78f744c959 |
chore(site): enable no-autofocus oxlint rule (#32740)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell. Moves [no-autofocus](https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/no-autofocus.html) out of the Oxlint migration backlog and sets it to `error`. Disables the equivalent Biome rule in `site/`. Removes autofocus from page forms and lets Radix handle initial focus in dialogs where the intended field is already first. Keeps targeted suppressions for focus restoration and deliberate focus moves after user interaction. Related to #31146 and #31148. |
||
|
|
a5367f6a2e |
chore(site): enable iframe-has-title oxlint rule (#32741)
> 🤖 This PR was written by Codex on behalf of Jake Howell. Moves [iframe-has-title](https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/iframe-has-title.html) out of the Oxlint migration backlog and sets it to `error`. Disables Biome’s equivalent for `site/`. Both callers already supply titles. The shared workspace iframe now requires the title prop and passes it explicitly to the native iframe. Related to #31148 and #32740. |
||
|
|
f2b60844c5 |
fix: verify bundled terraform against a checksum file in the Coder repo (#31600)
`scripts/Dockerfile.base` and `install.sh --with-terraform` download the
bundled Terraform zip from `releases.hashicorp.com` and use it without
checking it. This verifies that zip against a checksum file kept in the
Coder repo. The only thing trusted is the Coder repo, which is where the
`Dockerfile` and `install.sh` themselves come from. Everything fetched
from HashiCorp is checked against it.
The other download paths are already covered:
`provisioner/terraform/install.go` uses `hc-install`, which checks the
GPG-signed SHA256SUMS, and `mise.lock` / `flake.nix` already carry
per-platform hashes.
## Source of truth
`provisioner/terraform/terraform_SHA256SUMS` is a verbatim copy of
HashiCorp's `terraform_1.17.2_SHA256SUMS`, the version `main` ships,
verified against their signing key (`C874 011F 0AB4 0511 0D02 1055 3436
5D94 72D7 468F`). Being verbatim, you can diff it against the published
file or check it with the published `.sig`. Its hashes match the
Terraform entries in `mise.lock` on `main`. Both the Terraform version
and the checksums are read from it, so neither consumer pins a version.
## Consumers
* `scripts/Dockerfile.base` copies the file in and reads the version and
its architecture's checksum from it. It checks the zip with `sha256sum
-c` before unzipping. The build fails if there's no entry for the
architecture or the download doesn't match. All three build contexts
include the file: `docker-base.yaml`, `release.yaml` and
`scripts/build_docker.sh`. `docker-base.yaml` also runs when the file
changes.
* `install.sh` no longer has a `TERRAFORM_VERSION` or any hashes.
`--with-terraform` downloads `terraform_SHA256SUMS` from the Coder repo
at `refs/tags/v${VERSION}`, the tag of the release being installed. Only
if that tag doesn't have the file (a 404, for releases from before it
existed) does it fall back to `refs/heads/main`, with a note in the
output. Any other error fails. Fully qualified refs mean a branch named
like the tag, or a tag named `main`, can't be read instead. It then:
* only accepts lines with exactly two fields: 64 lowercase hex
characters and `terraform_X.Y.Z_<os>_<arch>.zip`. It picks the line for
`${OS}_${TERRAFORM_ARCH}`, validates the Terraform version and builds
the zip name from validated parts rather than using the one in the file.
It refuses to install if there's no such line;
* downloads the zip from HashiCorp and checks it with `sha256sum`,
`shasum -a 256` or `sha256`, including a zip reused from the cache. On a
mismatch it deletes the zip so a rerun downloads it again;
* skips the check under `--dry-run`, since nothing is downloaded. The
checksum file is still fetched so the version can be printed.
* `install.sh` **command handling** (security review): `sh_c` runs its
arguments directly instead of re-parsing them with `sh -c`, and
`sudo_sh_c` passes them to `sudo` or `doas` as-is. The `su` fallback
single-quotes every argument (`quote_args`). The resolved Coder version
must be `X.Y.Z` or `X.Y.Z-rc.N` before it's used in URLs, file names or
commands. As a side effect, install prefixes and cache paths with spaces
now work.
* `provisioner/terraform/checksums_test.go` fails if the file isn't in
SHA256SUMS format, is for a different version than `TerraformVersion`,
or lacks the `linux_{amd64,arm64,arm}` entries that `Dockerfile.base`
needs.
Also fixes `install.sh` unzipping `${ARCH}` instead of
`${TERRAFORM_ARCH}`, which broke `--with-terraform` on armv7 (`armv7` vs
`arm`).
## Bumping after this
Replace `terraform_SHA256SUMS` with the new verified file and update
`TerraformVersion` (plus `mise.toml`, `mise.lock`, `flake.nix` and the
airgap doc, as today). `Dockerfile.base` and `install.sh` need no edits.
`scripts/update_terraform_version.sh` (coder/coder#31463) does all of
this, and the `TerraformVersion` note in `install.go` points at it.
`main` is merged into this branch, including coder/coder#31438
(Terraform 1.17.1) and coder/coder#32110 (Terraform 1.17.2), so the
checksum file and `TerraformVersion` are at 1.17.2.
## Testing
After merging `main` (Terraform 1.17.2), I re-ran the Go test, `go vet`,
`gofmt`, `shellcheck`, `shfmt` and `actionlint`, and checked that the
`Dockerfile.base` extraction resolves 1.17.2 for amd64, arm64 and arm.
The `docker-base` build and the `install.sh` and `Dockerfile.base` runs
below were done before that merge, against 1.16.7 and 1.17.1, and I
haven't repeated them at 1.17.2. The `docker-base` workflow rebuilds the
image from the 1.17.2 file in CI.
* The `docker-base` workflow built all three platforms from the checksum
file: `terraform_1.16.7_linux_{amd64,arm64,arm}.zip: OK`, then Terraform
v1.16.7 on each.
* Ran the `Dockerfile.base` Terraform step under BusyBox 1.35 `sh`. It
fails with a changed hash or no entry for the architecture. With the
verified 1.17.1 file it installs 1.17.1 with no Dockerfile edit.
* `install.sh` `with_terraform` under `dash` on linux/amd64:
* fetched the real file over `raw.githubusercontent.com` from this
branch (standing in for `main`), then verified and installed 1.16.7;
* with the 1.17.1 file it installs 1.17.1;
* a changed hash is rejected and the cached zip is deleted;
* an unsupported platform and a garbage response are both refused;
* `--dry-run` prints the commands.
* Today neither the release tags nor `main` have the file, so
`--with-terraform` fails with "Could not download the Terraform
checksums" until this merges. After that, older releases use `main`'s
file.
* Security review fixes, under `dash` and `bash --posix`:
* checksum lines with `$(...)`, backticks, `;`, `../`, an extra field,
an uppercase or 65-character hash, or a malformed Terraform version are
refused before any command runs. The previous version of the script ran
the `$(...)` one. A file with an injected line followed by the real ones
installs only the real zip;
* with a `curl` stub, a tag hit reads `refs/tags/v2.39.0`, a 404 falls
back to `refs/heads/main`, and a 500 or a network error fails without
trying `main`;
* `sh_c`, and `sudo_sh_c` through `sudo`, `doas` and `su` stubs, pass
arguments with spaces, quotes, `;` and `$(...)` through unchanged and
run nothing else. `--dry-run` runs nothing;
* `--version v2.28.0`, `2.28.0;id` and `../../x` are refused. `--version
2.39.0`, `--version 2.33.0-rc.1`, `--stable` and the default mainline
still work;
* real installs of Terraform into a prefix with a space (no sudo) and
into a root-owned prefix (through `sudo`), and of Coder 2.39.0 with
`--method standalone` into a prefix with a space.
* `go test ./provisioner/terraform -run
TestTerraformChecksumFileMatchesVersion` passes with the 1.17.2 file,
and fails with the 1.17.1 file in place (`expected: "1.17.2", actual:
"1.17.1"`). `go vet` and `gofmt` are clean.
* `shellcheck --external-sources` (v0.10.0) and `shfmt -d` (v3.12.0) are
clean on `install.sh` and `scripts/build_docker.sh`, and `actionlint`
(v1.7.7) is clean on the workflows. Local git hooks were skipped.
## How coder/coder#31600, coder/coder#31463 and coder/coder#31461 fit
together
* coder/coder#31600 makes `provisioner/terraform/terraform_SHA256SUMS`
(a verbatim copy of HashiCorp's signed file) the one place the bundled
Terraform checksums live. `Dockerfile.base` reads it, and `install.sh`
downloads it from the Coder repo at install time.
* coder/coder#31463 adds `scripts/update_terraform_version.sh`. On
branches with the checksum file it just replaces that file. On older
branches it edits `install.sh` and `Dockerfile.base` directly.
* coder/coder#31461 (stacked on coder/coder#31463) runs the script
weekly for `main` and the supported release branches. It needed no
changes for the checksum file.
None of the three touch the same files, and merging all three onto
`main` is conflict-free. On that combined tree, the bump script (run
before `main` moved to 1.17.2) took 1.16.7 to 1.17.1 by replacing the
checksum file, the new Go test passes, and `actionlint` and `shellcheck`
pass. They can merge in any order. Merge coder/coder#31461 after
coder/coder#31463, retargeted to `main`.
Opened by Superblink on behalf of @droopy4096.
---------
Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com>
Co-authored-by: Dmytro Makovey <dmitry@coder.com>
Co-authored-by: Lisa Fiander <lisa@coder.com>
Co-authored-by: Dmitry Makovey <dmakovey@yahoo.com>
|
||
|
|
19da85b5d3 |
docs: turn the install landing pages into cards (#32405)
## Summary Rework the install landing pages so a reader can see where to go at a glance, without reading the planning material first. The install landing page is now a hub of ten cards in three groups that point to the high-impact and most searched pages, modeled on the GitLab and Mattermost install pages, and the planning material moves to a new Production deployment process page. Every existing page URL stays the same; the sidebar gains two pages. #31869 (the air-gapped K3s tutorial), which this PR links to, has merged, and this branch is rebased onto `main`. The cards need coder/docs-engine#388 to render as cards; without it, the docs engine, GitHub, and the classic offline docs render the same block as a plain link list, so the two PRs can merge in either order. The docs home page cards moved to #32714. Refs [DOCS-1568](https://linear.app/codercom/issue/DOCS-1568) and [DOCS-1570](https://linear.app/codercom/issue/DOCS-1570). ## Changes - `install/index.md`: a one-sentence intro, a tip that points to the Quickstart and the CLI download, and three groups of cards. - Install the control plane: Installation requirements, Air-gapped K3s quickstart, Install on Kubernetes, and Installation methods. - Run Coder in production: Production deployment process and Upgrade Coder. - Common tasks: Air-gapped deployments, Use an external database, TLS and reverse proxies, and Image pull secrets. - New `install/production-deployment.md` (Production deployment process), the first child of Install: the five phases table with its "When you can skip it" column, Move from evaluation to production, Decisions worth making deliberately, and Who does the work, all moved from the landing page. Move from evaluation to production keeps the setup token sentence from #32324. - New `install/server/requirements.md` (Installation requirements), the first child of Install the control plane: control plane CPU and memory, PostgreSQL, platform versions, network, internet access, and license, each traced to code or the existing platform pages. - `install/server/index.md`: takes the three platform questions, the offline notes, and the first air-gapped workspace build note from the landing page. The platform table gains a "Where the control plane runs" column, with Rancher and OpenShift listed as Kubernetes. - `install/server/kubernetes/index.md`: intro names EKS, AKS, GKE, K3s, and OpenShift, and points offline clusters to the air-gap page and the K3s tutorial. - `install/server/cloud/index.md`: sends existing EKS, AKS, and GKE clusters to the Kubernetes guide, notes that the AWS Marketplace guide creates a new EKS cluster, and fixes the Azure tab, which said GKE instead of AKS. - `install/plan/index.md` and `install/prepare/index.md`: planning reads as a recommendation, not a requirement, and Prepare links to the requirements page. ## Decisions for review 1. **Card syntax.** Each card is one item in a plain link list, `[Title](link): one-sentence description`, inside `<div class="cards">`. The corpus compiles as `.md`, so it can't use JSX; this is the same approach as `<div class="tabs">`, and it degrades to a readable list wherever the plugin isn't present. 2. **The first six cards** come from the Nov 20 review with Ben. Two card titles are shorter than their target page titles: "Air-gapped K3s quickstart" opens "Install Coder on K3s in an air-gapped environment", and "Installation methods" opens "Install the control plane". The 1-hour target from the Nov 4 review still isn't stated, because it needs a timed run. 3. **The Common tasks cards come from search data, not page views.** No page-view source was available (Search Console is on a personal account, and Vercel analytics needs credentials). The four cards are the install pages with the most result impressions in Algolia over the 30 days to Nov 18: image pull secrets, air-gapped deployments, the external database, and the NGINX and Apache reverse proxy pages, which match the frequent `proxy` and `certificate` searches. Semrush also shows "nginx reverse proxy" at 4,400 searches a month. The TLS card opens the TLS & Reverse Proxy section of the control plane setup page, which links Apache, Caddy, and NGINX, instead of one proxy page. Docker is left out because the Installation methods card already covers it. Swap any card if page views tell a different story. 4. **"Choose your path" is gone.** Every row now has a card or the tip, and Move from evaluation to production is a section of the new page. The Architecture link that row carried now lives only on Plan your deployment. 5. **Classic offline docs get no card styling.** They render the plain list until the offline docs move to the docs engine. 6. **Rancher and OpenShift read as Kubernetes options.** This reverses what I proposed in the Nov 4 install review (Rancher with container runtimes, OpenShift with Linux). Both guides install the Helm chart on a cluster, so a reader looking for Kubernetes needs to find them. This PR only changes the table labels; no pages move. ## Previews Both previews are built from this branch at `e1d00f4f10`. A screenshot of the docs engine version of the install page is on coder/docs-engine#388. - **Docs engine:** check out coder/docs-engine#388 (`vigilante/coder-docs-cards`), and in `apps/docs` run `DOCS_VERSION_ID=main DOCS_VERSION_REF=e1d00f4f10 DOCS_VERSION_ROOT=1 DOCS_ROOT=<this checkout>/docs pnpm sync`, then the same variables with `pnpm exec next dev -p <port>`, and open `/install/`. The cards sit in a two-column grid and stack to one column on a phone. - **Classic offline docs:** in `offlinedocs/`, run `pnpm install`, `pnpm copy-images`, and `pnpm exec next dev -p <port>`, and open `/install/`. The cards render as a bulleted link list with descriptions, and the tip renders as an alert. ## Not in this PR - Cards on the docs home page: #32714 ([DOCS-1904](https://linear.app/codercom/issue/DOCS-1904)). - New pages that need a tested run first: create your first template ([DOCS-1783](https://linear.app/codercom/issue/DOCS-1783)), an air-gapped Helm install on EKS or AKS ([DOCS-1798](https://linear.app/codercom/issue/DOCS-1798)), and a small reference architecture ([DOCS-1572](https://linear.app/codercom/issue/DOCS-1572)). - Sidebar moves and renames ([DOCS-1569](https://linear.app/codercom/issue/DOCS-1569)). - Pre-existing issues on `prepare/airgap.md`, which this PR links to: it says the built-in database downloads PostgreSQL from `repo1.maven.org`, but `cli/server.go` uses `repo.maven.apache.org`, and its first sentence says all features are supported offline without the hosted-service exception this PR adds to the requirements page. Known tradeoff: platform versions (Kubernetes 1.19, Helm 3.5, and so on) appear on both the requirements page and each platform page, so a version bump has to update both. ## Testing - `make gen/docs-manifest` and `make fmt/markdown`. - `make lint/emdash lint/docs-html lint/docs-manifest lint/markdown lint/docs-redirects`: all pass. - Vale on the changed pages: 0 errors and 0 warnings on added lines. - Links and anchors on the changed pages resolve, including `admin/setup#tls--reverse-proxy` on the docs engine, and no page in `docs/` links to an anchor this PR removed from the landing page. - The docs engine single-version sync of this branch passes strict. - In headless Chromium, the docs engine renders ten cards on the install page with the expected titles and links, in light and dark at 1440px and in one column at 390px; the classic offline docs render the same links as lists. - doc-check skill in author self-check mode at `eaab2994c4`, with fixes in `e1d00f4f10`: - Fixed: the requirements page and the platform chooser said every feature works without internet access; both now say Coder runs offline, and that features that call a hosted service, such as a hosted AI provider, need it reachable. - Fixed: the phase 5 "When you can skip it" cell now reads "Never", like phase 3. - Rejected: a finding that no setup token exists. #32324 adds it (`cli/setuptoken.go`, the `Setup token:` prompt in `cli/login.go`, and `setup_token` in `SetupPageView.tsx`). - Not applied: renaming the "Air-gapped K3s quickstart" card, which is the name from the Nov 20 review. - An earlier run flagged the Helm chart default resources on the requirements page as wrong, but `helm/libcoder/templates/_coder.yaml` sets 2 CPU cores and 4 GiB as both requests and limits when `coder.resources` is empty, so the sentence stands. <details> <summary>Plan and decision log</summary> **Request.** Add pages where they're needed, and update the existing landing pages so it's obvious where to go to install the control plane right away. Don't rearrange the sidebar or rename pages. **Inputs.** - The install section skeleton IA draft in Notion (Docs proposals), which recommends Kubernetes as the golden path and air-gap first. - Feedback from the Nov 4 install docs review with Stephen Kirby and Ben, the Nick and Ian 1:1 (Nov 4), and the Nick and Ben 1:1 (Nov 5). - The Nick and Ben weekly (Nov 20): the landing page still read as text-heavy and didn't tell a reader where to go. The bar is the GitLab and Mattermost install pages. Agreed: cards at the top, the text moved to an intro page, and air-gapped and production paths visually distinct. **What the feedback changed.** - Kirby's three questions (network-gapped, cloud or on premises, VMs or containers) open the platform chooser, Install the control plane. - Kirby's point was "plan once, deploy once": planning matters, but most of the lost time comes after IT approval. So readers can install first, and Plan and Prepare stay visible as recommendations, with a "When you can skip it" column, on the Production deployment process page. - The review called out the missing path from evaluation to production, which is now a section of the Production deployment process page. - Kirby's golden path is an enterprise past approval installing with Helm on air-gapped EKS or AKS. The K3s tutorial covers single-node evaluation only, so that gap is filed as DOCS-1798 instead of being written here without a tested run. - Nov 20: the landing page became six cards in two groups, following GitLab's install page (requirements, methods, offline, reference architectures, upgrades) and Mattermost's evaluate-to-production journey. The prose moved inward rather than being cut: planning to the new page, platform choice and offline notes to the chooser. - Nov 24: Nick asked for cards for the high-traffic pages on the install landing page. With no page-view data reachable, a third group, Common tasks, follows the install pages with the most Algolia result impressions, and Ben's caution against card sprawl keeps it to four. Cards for the docs home page, built first by mistake, moved to their own PR, #32714. #31869 had merged, so the branch is rebased onto `main` without its commits. **Choices made.** - Requirements traced to code: Helm chart default resources (`helm/libcoder/templates/_coder.yaml`), Kubernetes version (`helm/coder/Chart.yaml` `kubeVersion`), built-in PostgreSQL download (`cli/server.go`), and the Kubernetes starter template's code-server install (`examples/templates/kubernetes/main.tf`). - Cards are a docs-engine remark plugin over a plain link list (DOCS-1795, coder/docs-engine#388), not JSX, so the page reads the same on GitHub and in the classic offline docs. Each card description is one sentence and avoids abbreviations that would need expanding. - The new page is the first child of Install, so the sidebar reads as the process followed by its five phases. - Ian's suggestion to use includes for repeated content (such as the air-gap Dockerfile) is deferred. This PR repeats only short routing sentences. </details> --- _This PR was generated by Coder Agents on behalf of @nickvigilante._ --------- Co-authored-by: Ian Evans <5760366+ianjevans@users.noreply.github.com> |
||
|
|
5f4bb0ddc1 |
docs: add side padding to Agent Relay architecture diagram (#32694)
The labels on the left of the Agent Relay architecture diagram sit right against the frame on [the Agent Relay page](https://coder.com/docs/ai-coder/agent-relay). The image had only 4px of margin on the sides, so the docs frame clipped close to the text. This adds 36px of background on the left and right of `agent-relay-stack.png` to match the top margin. No markdown changes. | Before | After | | --- | --- | |  |  | "After" is the live page with the new image swapped in. --- _Generated by Coder Agents on behalf of @bpmct._ |
||
|
|
c7b144cc76 |
fix(coderd/x/chatd): prevent a chat stream relay deadlock on repeated episode selection (#31187)
Stacked on #31196, which must merge first. When a chat's worker runs on the same replica as the stream, the chat stream relay can deadlock with the in-process parts endpoint. Live model output then stops on that stream until the client reconnects, while saved messages, status and queue updates keep arriving. The stream loop configures the relay forwarder after every newer snapshot, and queueing a message, deleting or promoting a queued one, interrupting, and recording a retry keep the episode. The forwarder sent a selection each time, and the endpoint answers each one by sending the episode again from `seq` 1, so K updates on an N-part episode moved about K times N parts. While the stream loop reads slowly, the resent parts fill the buffers and the endpoint's serve loop waits to send. Three unread selections fill the pipe's one-slot channel, the endpoint's selection reader and its one-slot channel to the serve loop, and the forwarder's next `WriteControl` never returns. - The forwarder sends a selection only on a new connection or when the target changes. Before #31196, only a repeated selection restarted live output after the part buffer dropped a slow subscriber. - The endpoint's selection reader replaces an unread selection instead of waiting, so the endpoint does not depend on how a client sends selections. After the first change the forwarder cannot practically reach the cycle, since it drops other episodes' parts without waiting. Dropping one loses nothing, because every selection starts again from `seq` 1. <details> <summary>Investigation and decision log</summary> ### Evidence `TestStreamRelayForwarderSelectsOnlyChangedTargets` configures one 200-part episode 10 times: before the forwarder change it sees 10 selections and 2000 parts, after it 1 selection and 200 parts. `TestStreamPartsEndpointLatestSelectionWinsWhileBlocked` fails in 10 of 10 runs without the reader change and with a 15-slot queue that replaces nothing. `TestStreamRelayForwarderDeliversLivePartsAfterSameEpisodeReconfigures` stalls the stream loop until the buffers fill, configures the same episode 1000 times, then requires a new part to arrive; it fails in 20 of 20 runs with both changes reverted and passes with either one alone. All three pass with `-race -count=20`. A goroutine dump taken with the world stopped, from a test that used the real forwarder, local dialer and part buffer with a 2000-part episode, shows the four goroutines at the waits described above and every buffer full. The deadlock formed in 20 of 20 runs under `-race`, after 4 to 384 same-episode selections. After the test read every buffered part, added live parts, configured the relay 11 more times (once for a new episode) and fired the buffer's send timeout, no part arrived. ``` F goroutine 73 [select]: streamPartsChannelClientTransport.WriteControl stream_parts_transport.go:142 <- (*streamRelayForwarder).loop.func4 stream_relay.go:148 <- loop stream_relay.go:207 R goroutine 74 [select]: streamPartsEndpoint.serve.func1() stream_parts.go:84 E goroutine 83 [select]: streamPartsChannelServerTransport.WriteEvents stream_parts_transport.go:120 <- streamPartsEndpoint.serve stream_parts.go:169 L goroutine 84 [select]: (*streamPartsTransportSession).readLoop stream_parts_transport.go:236 f.parts=128/128 s.parts=128/128 eventsCh=128/128 controlCh=1/1 SelectEpisode started=13 returned=12 ``` A test goroutine in place of the stream loop dropped repeated parts and spent a fixed sync time on each hint before it selected the same episode again (200 hints, 3 runs per row, real clock): | Sync time per hint | Hint interval | Deadlock formed | |--------------------|---------------|-----------------| | 1 ms | 1 ms | 1 of 3 | | 5 ms | 5 ms | 1 of 3 | | 1 ms | 2 ms or 5 ms | 0 of 6 | | 5 ms | 10 ms | 0 of 3 | The deadlock formed only when selections arrived about as fast as the stream loop handled them. How often that happens in production is not measured. Selecting a new episode every time under the same pressure did not deadlock in 300 of 300 iterations, because the forwarder drops parts of other episodes without waiting for the stream loop. Over the WebSocket transport with the pipeline full, 1263 selections over 2999 iterations all returned; when the stream loop then stopped reading, the server heartbeat closed the parts connection about 35 seconds after it opened, and the forwarder dialed again once the stream loop read again. ### Decisions - `WriteControl` keeps its waiting send: the reader no longer waits after reading the pipe, so the send returns, and replacing there changed no test result. - Replaced `TestStreamRelayLivePartsAfterSameEpisodeReselects`, which waited for full buffers before every selection and so relied on the replays the forwarder change removes, with a test that fills the buffers once by stalling the stream loop. - Rejected: having the serve loop read selections while it waits in `WriteEvents`. The serve loop would have to abandon a send in progress and drop its part, a larger change with the same result. </details> > 🤖 This PR was created with the help of Coder Agents. |
||
|
|
1d488fca54 |
test(agent): remove startup script from TestAgent_ReconnectNoLifecycleReemit (#32737)
## TL;DR `TestAgent_ReconnectNoLifecycleReemit` failed once on a Windows nightly run. The test checks that an agent does not report its lifecycle states a second time after it reconnects. Before that check, it waited up to 10 seconds for a startup script, `echo hello`, to finish. On the Windows runner the shell process took 11 seconds, so the test failed during setup and never reached the reconnect check. The script is not needed for what the test checks, so this PR removes it. The test no longer depends on how fast the host shell starts. Refs https://linear.app/codercom/issue/CORE-665/flake-testagent-reconnectnolifecyclereemit-windows-startup-readiness <details> <summary>How to navigate this PR</summary> - Test code only. One file, 5 lines deleted, no production change. - `agent/agent_test.go`: the `Scripts` entry is removed from the manifest in `TestAgent_ReconnectNoLifecycleReemit`. Check that nothing later in the test reads the script or its output. </details> <details> <summary>Implementation</summary> - `agent/agent_test.go`: removed the `echo hello` startup script from the manifest passed to `agenttest.NewClient`. - The wait for the `ready` state is unchanged. With no start scripts the agent still reports `starting` then `ready`, so the wait now depends on the agent alone. - The wait was not raised to a longer timeout. That would make the failure less likely but leave the dependency on the host shell in place. - No reconnect coverage is given up. The agent reports `ready` only after start scripts return, so the script had always exited before the test disconnected. The only script work that could overlap the reconnect was its completion report, and the test has no assertion on it. </details> <details> <summary>Expected Output</summary> - The test reaches the `ready` state without starting a shell process. - After a disconnect and reconnect, the reported lifecycle states are the same list as before: `starting`, `ready`. - If the agent reports its states again after a reconnect, the test still fails with "lifecycle states should not be re-reported after reconnect". </details> <details> <summary>Testing</summary> - `TestAgent_ReconnectNoLifecycleReemit` in `agent/agent_test.go` is the only test changed. - `go test ./agent -run '^TestAgent_ReconnectNoLifecycleReemit$' -count=3` passes on macOS. - Checked that the test still catches the bug it guards. With the agent temporarily changed to report its states again on every reconnect, the test without the script failed with the expected states `starting`, `ready` and the actual states `starting`, `ready`, `starting`, `ready`. This check was run on an earlier `main` commit with the same test change, and the agent change was reverted. - Forced the original failure locally to confirm the cause. With the script changed to `sleep 11` the old test failed at the same wait with the same message as the nightly run. With `sleep 9` it passed. - Not run on Windows locally. The Windows CI job on this PR is the first Windows run of the change. </details> |
||
|
|
59e3889656 |
docs: redirect Customize your template pages to Template Fundamentals course (#31639)
Removes the four Quickstart "Customize your template" pages, their sidebar entries, and their seven screenshots, and redirects the old URLs to the Get started page. Closes DOCS-1476. coder/coder#31133 was closed for this reason. The Get started page's **What's next?** section now has two cards: one for the Template Fundamentals course at `https://coder.com/learn/coder-quickstart`, which replaces the removed pages, and one for the full course catalog at `https://coder.com/learn`. The cards use the `<div class="cards">` syntax from coder/docs-engine#388, and GitHub renders the same source as a plain link list. The image-management guide links to the course too. | Old page | Destination | |---|---| | `/docs/get-started/customize-your-template` | `/docs/get-started` | | `/docs/get-started/customize-your-template/add-a-language` | same | | `/docs/get-started/customize-your-template/install-command-line-tools` | same | | `/docs/get-started/customize-your-template/authenticate-to-github` | same | The rules use the relative format from #30805 (`get-started/customize-your-template...` to `get-started`), which also blocks removed routes without a redirect. The course defers the private-repository (`coder_external_auth`) lesson, so the Get started page keeps a short numbered procedure for it: edit the template, add the data source, publish, authenticate on the create-workspace form, and clone over HTTPS. Generated by Coder Agents on behalf of @nickvigilante. --------- Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com> |
||
|
|
2a30d45465 | feat(helm): add optional NetworkPolicy to charts (#31792) | ||
|
|
1d565409e4 |
fix(coderd/x/chatd): keep slow part subscribers attached while the episode is open (#31196)
The message part buffer dropped a subscriber of an open episode whose
send waited 10 seconds. The parts endpoint read the closed channel as
the end of the episode and kept the connection open, so live output
stopped for the rest of the model call. Only on the cross-replica
WebSocket could a longer stall end it: the endpoint's heartbeat closes
the socket 15 to 30 s after the relay stops reading, and the relay
reconnects and replays once it reads again. That path is unchanged. The
stream loop stops reading when its writes to the browser block.
The timeout keeps an unresponsive subscriber from holding an episode in
memory, but only closed episodes wait for subscribers. It now starts at
the close, also for a send already waiting then.
A drop after the close only cuts short the live preview, which the saved
message or the error event replaces. The buffer has no logger, so it is
not logged.
Cost: a subscriber that stops reading an open episode holds its
goroutine and batch until it reads, is cancelled, its context ends, the
buffer closes, or `SubscriberSendTimeout` passes after the episode
closes.
> 🤖 This PR was created with the help of Coder Agents.
|
||
|
|
b31ad5eb5a |
fix(site/src/components/Filter/FilterCombobox): report the filter input collapsed while no list is shown (#32683)
The filter search input ("Search and filter workspaces…", plus the
Audit, Templates, and Connection log filters) always reported
`aria-expanded="true"` and pointed `aria-controls` at cmdk's list id,
even while no list was mounted. axe flagged `aria-valid-attr-value`
(critical, WCAG 4.1.2), and screen readers announced a popup that did
not exist. cmdk 1.1.1's `Command.Input` sets these attributes after the
caller's props, so callers cannot override them.
`FilterComboboxChipsInput` now renders cmdk's input through `asChild`
into a small element that derives `aria-expanded` from cmdk's
`useCommandState` (`filtered.count > 0`; with filtering off, items mount
only in the open popup's lists). It passes `aria-controls` and
`aria-activedescendant` through only while the input is expanded. cmdk
still owns the value, the search sync that highlights the first row, the
ids, `aria-labelledby`, and keyboard handling.
Closes DEQ-624
| Ticket | UI surface |
|---|---|
| DEQ-624 | `FilterCombobox` search input on the Workspaces, Audit,
Templates, and Connection log pages (ARIA only, no visual change) |
<details>
<summary>Grouping and decision log</summary>
- Batch `bug-batch-2` has six tickets with six independent root causes,
so each gets its own PR. This one covers only DEQ-624.
- `aria-labelledby` was never broken: the cmdk root always renders a
hidden `<label>` with that id, and the input's name resolves to the
placeholder text in every state. Only `aria-controls` (and, on mobile,
`aria-activedescendant`) pointed at missing ids.
- The same change also fixes a mobile case: entering a category whose
options fail to load left `aria-expanded="true"` with `aria-controls`
and `aria-activedescendant` pointing at removed ids.
- Behavior change: a popup that is open but lists no rows yet (for
example while options load) now reads as collapsed.
- Rejected alternatives: (1) a plain `<input>` instead of cmdk's: it
would stop updating cmdk's search state, which drives the first-row
highlight, and cmdk does not expose its list id; (2) extending
`site/patches/cmdk@1.1.1.patch`: that means editing minified vendor code
and changing the lockfile.
- Tests: extends two existing `FilterCombobox.test.tsx` tests. One
asserts the input is collapsed with no `aria-controls` before opening,
then expanded and controlling the listbox after ArrowDown. The other
asserts the input is collapsed while the popup lists nothing. Both fail
on `main`.
- axe (4.11.1, `pages/WorkspacesPage` > `UnfilteredSingleResult`,
desktop and mobile): `aria-valid-attr-value` fired on `main` while
closed, in a category, and after Escape. On this branch it is clean in
every state (closed, open, ArrowDown, category, no match, Escape).
- Dropped review findings: (1) TS5/FE1 "no attribute assertions in
Vitest": `aria-expanded` and `aria-controls` are the accessibility state
this bug is about, and screenshots cannot capture them; (2) SD7
"single-use component": `asChild` needs a component child to receive
cmdk's props.
- Self-review: frontend-review (FE1 to FE10 pass); frontend-deep-review
(fixed: named `ChipsInputElementProps` type, clarified the doc comment);
frontend-accessibility (`aria-valid-attr-value`, `aria-required-attr`,
`aria-allowed-attr`, and the accessible name pass; keyboard and focus
behavior unchanged).
- Pre-existing notes, outside this diff: axe `aria-dialog-name` fires
while the popup is open, because the Radix popover content has
`role="dialog"` with no name. If the main panel and a category list
rendered together they would share cmdk's single list id; this did not
occur in the story.
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
b4974c61f3 |
fix(site/src): return focus to workspace actions after its dialogs close (#32682)
Closing a dialog opened from the "Workspace actions" menu, with Escape or Cancel, sent focus to `<body>` (WCAG 2.4.3). Radix's modal dialog cancels the browser's focus restore on close and focuses its own `DialogTrigger`. These dialogs open from menu items and render no `DialogTrigger`, so focus had nowhere to go. `ConfirmDialog`'s `onCloseAutoFocus` doc already asks callers to handle this. `WorkspaceMoreActions` now passes `onCloseAutoFocus` to its download logs, change version, and delete dialogs to focus the menu trigger. It also hands the trigger to `onStop` and `onRestart`, so `WorkspacesTable` can return focus from its stop and restart confirm dialogs. This is the same pattern the Secrets page uses (`returnFocusElement`). It covers both callers: the Workspaces table and the workspace page (`WorkspaceActions`). Closes DEQ-623 | Ticket | UI surface | |---|---| | DEQ-623 | Workspaces table row actions and workspace page "Workspace actions" menu: Stop, Restart, Change version, Download logs, and Delete dialogs (focus ring returns to the trigger; [screenshots](https://linear.app/codercom/issue/DEQ-623#comment-b1587b46)) | <details> <summary>Grouping and decision log</summary> - Batch `bug-batch-2` has six tickets with six independent root causes, so each gets its own PR. This one covers only DEQ-623. - Root cause: the ticket suggested the dialog remembers the menu item, which then unmounts. That was ruled out: moving focus to the trigger before the dialog opened still ended on `<body>`. The cause is Radix's modal `Dialog` close handling, described above. - I fixed each caller instead of changing the shared primitive. A shared fix would have to change `DialogContent` for every dialog in the app and also change `DropdownMenuItem`. The per-caller `onCloseAutoFocus` approach is the existing pattern (Secrets, Skills, CreateTemplate). - Test: one parameterized test in `WorkspacesPageView.test.tsx` for Stop (a table-owned dialog) and Delete (a `WorkspaceMoreActions`-owned dialog). It asserts the trigger has focus after Cancel and fails on `main`. - Browser check (Storybook, headless Chromium): focus returns to "Workspace actions" for Stop (Escape and Cancel), Restart (Escape; it has no Cancel button), Delete (Escape and Cancel, on both the table and the workspace page), Download logs, and Change version. - Dropped review findings: (1) making the new `onCloseAutoFocus` props required, because existing stories and tests render these dialogs on their own without it; (2) reusing `returnFocusTo` from `pages/AgentsPage/components/useDialogFocusReturn.ts`, because importing from a page into `modules/workspaces` reverses the dependency direction; (3) merging the two two-line focus handlers, because they read different sources (a ref and stored state). - Self-review: frontend-review (FE1 to FE10 pass), frontend-deep-review (fixed: parameter named `returnFocusElement` to match Secrets), and frontend-accessibility (focus management fixed; no axe violations with the dialogs open). - Pre-existing notes, out of scope: (1) the Secrets delete flow also ends on `BODY` in a real browser; its `DeleteAndCancel` story passes only because of timing; (2) the error dialogs shown after a failed action still return focus to `<body>`; (3) after confirming Stop or Delete, the trigger may become disabled as the workspace changes state; (4) a comment in the shared `DropdownMenuContent` says focus returns to the trigger when a dialog closes, which does not hold for real users. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
09b0085d9b |
fix(site/src): announce MultiSelectCombobox empty results to screen readers (#32678)
`MultiSelectCombobox` had its own copy of `CommandEmpty`, so it skipped the shared `CommandEmpty` that mirrors its text into the `Command` `role="status"` live region (#32667). Screen readers stayed silent when a search matched no options (WCAG 4.1.3). This affects IdP organization, group, and role sync, the OAuth2 app form, and multi-select dynamic parameters. The local copy is removed and the component uses the shared `CommandEmpty`. In cmdk 1.1.1, `Command.Empty` renders the same thing the copy did (the `filtered.count === 0` check and the `cmdk-empty` presentation div), so the visible markup is identical. Closes DEQ-651 | Ticket | UI surface | |---|---| | DEQ-651 | `MultiSelectCombobox` empty message (IdP sync forms, OAuth2 app form, dynamic parameters). No visual change: branch and `main` screenshots are byte-identical. | <details> <summary>Grouping and decision log</summary> - Batch `bug-batch-2` has six tickets with six independent root causes, so each gets its own PR. This one covers only DEQ-651. - The async-search branch (`onSearch && !creatable && no options`, which renders the empty indicator as a disabled `CommandItem`) is unchanged. No production caller passes `onSearch`, so changing it would alter selection behavior in an untested path. If `onSearch` gets a caller, that branch should switch to `CommandEmpty` too. - Test: extends the existing "Multi-Select Parameter" block in `DynamicParameter.test.tsx`, which already renders `MultiSelectCombobox`. It types a value with no match and expects "No results found" in the status region, then clears the input and expects the region to be empty. It fails on `main`. - Story: `SelectAllComboboxItems` no longer asserts `getByText("All organizations selected")`, because the text now also appears in the sr-only region and play functions must not assert (FE1). #32667 made the same change to other stories. - Commit scope is `site/src` because the test lives under `modules/`. - Self-review: frontend-review (FE1 to FE10 pass); frontend-deep-review (no findings); frontend-accessibility (the status region sits outside the listbox and is filled only on this branch; axe is the same on this branch and `main`). - Pre-existing notes, untouched by this diff: axe reports `button-name` on the badge remove and clear-all buttons, and `aria-required-children` on the empty listbox. Some callers' empty text ("All roles selected") reads oddly as a no-match message and is now announced. The #32667 limitation also applies: if the list is already empty when it opens, the region and text mount together and may not be announced. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
ad61a97a2d |
fix(site/src/components/Filter): announce filter errors and drop the empty description (#32677)
The shared `Filter` rendered its error span, and pointed the search
box's `aria-describedby` at it, for any error. The span's text comes
from `getValidationErrorMessage`, which is empty for anything but an API
validation error, so network and server errors produced an empty red
span and an empty description. The span was also inserted with its text,
so screen readers did not announce validation errors that arrived after
the debounced refetch (WCAG 4.1.3).
The span is now an always-mounted `role="status"` region. It contains
the message, and the search box references it, only when `aria-invalid`
is set (validation errors). This matches the `FilterCombobox` filters,
which already pass a message only for validation errors (for example
`AuditFilter`). Moving the column spacing from `gap-2` to `mt-2` on the
shown error keeps the empty region from adding space.
Closes DEQ-613
| Ticket | UI surface |
|---|---|
| DEQ-613 | Shared `Filter` search box (only remaining caller: AI Bridge
sessions list `ListSessionsFilter`). Validation errors look unchanged.
With a non-validation error, the empty 8px gap under the search box is
gone, so the filter looks like its no-error state. |
**Follow-up note (pre-existing, out of scope):** `ListSessionsPage`
passes `sessionsQuery.error` only to the filter, and
`ListSessionsPageView` has no `ErrorAlert`. Before this PR a network or
server error there showed an empty red span; it still shows no message.
The page needs its own error state.
<details>
<summary>Grouping and decision log</summary>
- Batch `bug-batch-2` has six tickets with six independent root causes,
so each gets its own PR. This one covers only DEQ-613.
- Of the ticket's two options I chose "render the message and
`aria-describedby` only for validation errors", not "show a message for
every error". Page-level errors belong to the page, and the other
filters already follow this convention.
- The live region is never `display: none` (no `empty:hidden`), because
a hidden region leaves the accessibility tree and would not announce.
- Test: extends the existing validation-error test. It renders without
an error, captures the `role="status"` node, rerenders with a validation
error, and asserts that the same node holds the message and that the
search box is invalid and described by it. It fails on `main`.
- Dropped test: a "non-validation error has no description" test passed
even with the old code, because an empty description reads as none, and
the only assertion that would catch it checks attribute presence, which
FE1 rules out.
- Dropped review finding (frontend-deep-review TS1/TS7, no story for the
error state): the validation-error layout measures the same as on `main`
(8px gap), and the non-validation state now matches the default story,
so a new story would add no Pixel coverage.
- Screenshots: none. Both error states are reachable only with temporary
stories, and the measurable change is that an empty 8px gap is gone in
the non-validation state (column height 48px to 40px).
- Self-review: frontend-review (FE1 to FE10 pass); frontend-deep-review
(only the dropped finding above); frontend-accessibility
(`aria-allowed-attr`, `aria-valid-attr-value`, `aria-allowed-role`, and
`label` pass; axe is clean on `ListSessionsFilter` with validation and
network errors, on both this branch and `main`).
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
893d239a04 |
fix(site/src): keep fixed-height menus within the viewport (#32746)
The shared menu content (`menuClasses.ts`) caps height at `--radix-popper-available-height` and scrolls. Menus that passed their own fixed `max-h-*` replaced that cap, because `cn` (tailwind-merge) lets the caller's class win. When less than the fixed height fit next to the trigger, for example at 200% zoom, those menus ran past the viewport. - **DEQ-640:** the fixed caps become `max-h-[min(<fixed>,var(--radix-popper-available-height))]`. The `overflow-*` overrides are dropped because the shared class already scrolls. `PRMenuLinks`' `overflow-auto` also re-enabled horizontal scrolling. - **DEQ-641:** the proxy list's inner `max-h-[calc(100vh-22rem)] overflow-y-auto` wrapper is removed. It collapsed to about 100px on short viewports and nested a second scroll region inside the already scrolling menu. The menu is now the only scroll region. Closes DEQ-640 Closes DEQ-641 | Ticket | UI surface | Screenshots | |---|---|---| | DEQ-640 | Agent log tabs overflow menu, agent log download menu, Agents PR links menu (top bar and sidebar submenu), Agents "Move to project" submenu | [DEQ-640 screenshots](https://linear.app/codercom/issue/DEQ-640#comment-94f27284) | | DEQ-641 | Navbar Proxy menu | [DEQ-641 screenshots](https://linear.app/codercom/issue/DEQ-641#comment-8b17a825) | Measured in Storybook: - `ChatTopBar/WithManyPRs` at 1280x180: on `main` the menu ends at 235px, 55px past the viewport. On this branch it ends at 180px. - `ProxyMenu/ManyProxiesOpened` at 1200x450: on `main` there is a 98px nested scroller. On this branch there is none and the menu scrolls to the viewport edge. - Arrow-key navigation keeps the focused proxy in view. <details> <summary>Decision log and notes</summary> - `MoveToProjectMenuItems.tsx` (`max-h-80 overflow-y-auto` on `SubContent`) has the same root cause and turned up while searching for other callers, so I included it. - No new tests. This is layout only and jsdom can't measure it. Pixel covers `ProxyMenu/ManyProxiesOpened` and `ChatTopBar/WithManyPRs`. Expect a baseline change on `ManyProxiesOpened`: the header and footer items now scroll with the list, and the `scrollbar-thin` styling on the inner list is gone. - axe flags `scrollable-region-focusable` on the scrolling Radix menu container. That happens on `main` too for any menu that scrolls (for example `WithManyPRs`), because Radix menu items use roving `tabindex=-1`. It isn't introduced here. On `main`, the ProxyMenu flag was on the inner wrapper this PR removes. Keyboard access works: arrow keys move focus and scroll the menu. - Reworded the `PRMenuLinks` doc comment to "fits up to five rows", because a short viewport now scrolls sooner. - Self-review: frontend-review, frontend-deep-review, and frontend-accessibility found no blocking or should-fix issues. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
4f70a77a40 |
fix(site/src/pages/CreateUserPage): link the login type error to its field (#32745)
On error, the Create user Login type trigger set `aria-describedby="login_type-error"`, but only a `login_type-helper` span ever rendered. `getFormHelpers` puts the error message in `helperText`, so the error showed as grey helper text and screen readers never announced it. The field now renders through the existing `SelectField`, which builds on `FormField`. It gets the same `aria-invalid`, `aria-describedby`, and red error text as the other fields on the form. Closes DEQ-630 | Ticket | UI surface | Screenshots | |---|---|---| | DEQ-630 | `/deployment/users/create`, Login type field | [DEQ-630 screenshots](https://linear.app/codercom/issue/DEQ-630#comment-5e0351a9) | Changes: - `CreateUserForm.tsx`: replace the hand-built Label, Select, and helper span with `SelectField`. The option rendering is unchanged. - `CreateUserForm.test.tsx`: assert that an API validation error on `login_type` becomes the trigger's accessible description. This fails on `main` and passes on this branch. - `CreateUserForm.stories.tsx`: add a `LoginTypeError` story so Pixel captures the error state. - Stories and tests that used the `login-type-input` test id now query `combobox` by name, because `SelectField` doesn't forward `data-testid` and FE10 prefers role queries anyway. <details> <summary>Decision log and dropped findings</summary> - First draft wrapped the `Select` in `FormField`'s `control` prop. Self-review (RO1/FE3) pointed out that `SelectField` already does exactly this, so I switched to it. - I first extended the existing `FormError` story, but its play only clicks Save. That never touches `login_type`, so the error never renders. I added a dedicated `LoginTypeError` story whose play fills the required fields and then submits. - Dropped nit: "remove the username, email, and password typing from the test because Formik touches every field on submit." It's wrong here: with only Save clicked, `login_type` stays untouched and the test fails, as I checked. - Kept `id="login_type"`, which predates this PR. It renders once per page. - DOM check in Storybook (`LoginTypeError`): on `main`, `aria-describedby=login_type-error` has no matching element. On this branch, it resolves to "Login type is not allowed", styled with `text-content-destructive`. - axe found no violations on base or branch. axe tolerates a dangling `aria-describedby`, so the DOM check above is the evidence. - Pre-existing note, out of scope: the Organization field has no helper or error wiring either. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
0ed6f0a89b |
fix(site/src): use space-separated HSL channels for every theme token (#32744)
Fifteen theme tokens in `site/src/index.css` used comma-separated HSL
channels (`30.66, 97.16%, 72.35%`), while every other token uses spaces.
Composing one of them with an alpha, such as `hsl(var(--border-warning)
/ 0.6)`, rendered no color in the themes that used commas. This converts
them to the space-separated form and adds a `cssVariables.test.ts` check
that fails if a comma-channel token comes back.
Every H, S, and L value is numerically unchanged, so nothing renders
differently today. This is not a visible change, so there are no
screenshots.
Closes DEQ-632
| Ticket | UI surface |
|---|---|
| DEQ-632 | Theme tokens in `index.css` (light, dark, and color-blind
themes). No visual change. |
<details>
<summary>Decision log</summary>
- Converted all 15 comma tokens, not only the three the ticket names
(`--border-warning`, the light and dark `--border-magenta`). The rest
(`--surface-sky`, `--surface-purple`, `--surface-magenta`,
`--highlight-*`) have the same problem.
- The test scans the raw CSS with `matchAll`, not the existing
`extractVariables` helper. That helper returns a `Map` and would keep
only the last definition of a token that appears in several theme
blocks.
- Verified red/green: the test lists all 15 tokens on `main` and passes
on this branch.
- Searched `site/src` for consumers that depend on commas
(`hsla(var(--x), a)`). There are none.
- Self-review: frontend-review, frontend-deep-review, and
frontend-accessibility found no blocking or should-fix issues. I applied
the one nit (narrowing the test name).
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
b4cae68207 |
chore(site): add react-you-might-not-need-an-effect oxlint plugin (#32565)
Adds [eslint-plugin-react-you-might-not-need-an-effect](https://github.com/nickjvandyke/eslint-plugin-react-you-might-not-need-an-effect) to oxlint through `jsPlugins` and enables `no-pass-live-state-to-parent`, the only rule with no existing violations. The other eight rules go into the migration backlog as `"off"`. Follow-up PRs enable them one at a time, smallest first, and fix their violations. Oxlint runs the plugin itself, so `packageExtensions` marks the plugin's `eslint` peer as optional. This keeps `eslint` out of the install, the same way `@shadcn/lint` declares it. The plugin is added to knip's `ignoreDependencies` for the same reason as `@shadcn/lint`: it is referenced only from the oxlint config. <details> <summary>Rollout plan</summary> Violation counts with every rule enabled (153 total): | Rule | Findings | Files | |---|---|---| | `no-pass-live-state-to-parent` | 0 | 0 | | `no-reset-all-state-on-prop-change` | 3 | 3 | | `no-external-store-subscription` | 6 | 5 | | `no-derived-state` | 8 | 5 | | `no-chain-state-updates` | 8 | 6 | | `no-initialize-state` | 8 | 6 | | `no-pass-data-to-parent` | 10 | 5 | | `no-adjust-state-on-prop-change` | 26 | 19 | | `no-event-handler` | 84 | 37 | 1. This PR: plugin setup and the zero-violation rule. 2. One stacked PR per remaining rule, in the order above, each moving its rule from the backlog to `"error"` and fixing its violations. Counts are rechecked after each PR because one rule's fixes can change another rule's findings. </details> > Generated by Coder Agents on behalf of @DanielleMaywood. |
||
|
|
1cd23eb039 |
test(codersdk/workspacesdk): skip TestACPTransport until the netstack TIME_WAIT fix (#32752)
Temporarily skip `TestACPTransport` ([CODAGT-1495](https://linear.app/codercom/issue/CODAGT-1495)) until [CORE-717](https://linear.app/codercom/issue/CORE-717) is fixed, as #30465 and #32058 do for the other tests it hits. Remove this skip with #30471. A scratch test looping this test's calls through the real `AgentConn` shows the cause: on main's gVisor pin, every dial that reused a source port the agent held in TIME_WAIT stalled (8 of about 1,316 dials). With #30471's pin, all 24 such reuses in 2,100 dials connected and nothing stalled. > 🤖 Created with the help of Coder Agents. |
||
|
|
b044acbe2b |
fix(coderd/database/migrations): remove lock-retry blocks from chat migrations (#31167)
Migrations 000609, 000611 and 000615 start with a lock-retry block (added in #30297 and #30412) that is meant to stop live chat traffic from deadlocking with the migration. On a release upgrade it cannot do that, and it can turn a failure into a 2-minute hang or cause a failure that would otherwise not happen. This PR removes the blocks. A release upgrade that runs 000607 to 000615 while chats are in use is unreliable with or without them, so it needs chat traffic stopped, for example by scaling the deployment to zero first. `coder server` runs all pending migrations in one transaction, so every migration's locks are held until the transaction commits. On a release upgrade (from v2.38 or earlier), 000607 and 000608 lock `chats` before any block runs. A chat request that writes `chat_messages` or `chat_queued_messages`, or that reads `users`, holds a lock that a later migration needs and then waits for `chats`. The block can release only the locks it took, so it can avoid this deadlock only when its migration takes the first chat lock of the upgrade. Postgres checks a waiting request for a deadlock once, after `deadlock_timeout` (1 second by default). The block pauses 100ms between 100ms lock attempts, so a check that lands in a pause finds no deadlock, the request keeps its lock, and the block retries until it fails the upgrade after 2 minutes, with the request stuck until then. Without the block, the outcome depends on timing. If the request's check fires after the migration starts waiting for it, Postgres cancels the request and the upgrade continues. If the request had already waited longer than `deadlock_timeout`, its check found no deadlock, so Postgres cancels the migration instead and the upgrade fails. Main does not finish those cases either: its block was still retrying after a minute, and it gives up at its 2-minute deadline. 000609 and 000611 return to their content before #30297, and 000615 loses the block in both directions. A block's migration takes the first chat lock of an upgrade only when upgrading from a build of main at 608 through 614: dogfood, where the #30297 deploy failed, or a `coder-preview` image built between 2026-10-02 and 2026-10-11. No release stops in that range, and dogfood is already past 615. v2.39 ships these migrations with the blocks. Editing them leaves every schema unchanged: databases on v2.39 or later already ran them and do not run them again, and `dump.sql` regenerates without a diff. The change affects only databases upgrading from v2.38 or earlier. WI-46 proposed the opposite direction: make the migrator survive live chat traffic. The v2.38 upgrade thread concluded instead that old replicas must be stopped before an upgrade runs migrations. So `TestMigrationChatTablesConcurrentTraffic`, which tested the blocks under chat traffic, is removed without a replacement, and its helpers `async` and `dedicatedConn` move to `migration000638_test.go`, their remaining caller. <details> <summary>Measurements</summary> Each run starts chat requests while the upgrade transaction is open, on the Postgres 13 test container with the default `deadlock_timeout`. "Request canceled" means Postgres canceled the chat request as the deadlock victim. "Stuck" means the migration was still retrying when the run was stopped, after 10 seconds unless noted. | Upgrade from | Migration | Chat requests | main | This PR | |---|---|---|---|---| | v2.38 (605) | 000609 | queued message insert | upgrade failed after 2m0s | request canceled after 1s, upgrade ok | | v2.38 (605) | 000609 | chat message insert | stuck | request canceled after 1s, upgrade ok | | v2.38 (605) | 000609 | chat message insert that waited 1.2s before 000609 started | stuck (stopped after 1 minute) | migration canceled after 1s | | v2.38 (605) | 000609 | chat message insert and queued message insert | stuck (stopped after 1 minute) | migration canceled after 2s | | v2.38 (605) | 000615 | read `users`, then `chats` | stuck | request canceled after 1s, upgrade ok | | v2.38 (605) | 000615 | read `users`, then `chats`, plus a chat message insert | stuck (stopped after 1 minute) | migration canceled after 2s | | 607 (main build) | 000609 | queued or chat message insert | stuck | request canceled after 1s, upgrade ok | | 610 (main build) | 000615 | queued message insert | stuck | request canceled after 1s, upgrade ok | | 608, 610, 614 (main build) | 000609, 000611, 000615 as the first chat lock | the four cases in `TestMigrationChatTablesConcurrentTraffic` | no deadlock | 2, 1 and 1 of 4 deadlock; in the 000615 case Postgres canceled the migration, in the others a chat request | </details> > 🤖 This PR was created with the help of Coder Agents, and has been reviewed by a human. 🏂🏻 |
||
|
|
65b2222c54 |
chore: update gpgkms to v0.2.1 (#32748)
Updates the gpgkms tool dependency from v0.2.0 to v0.2.1 (`c4dfbf6`, coder/gpgkms#12). ## What changes in v0.2.1 - Cloud KMS calls (`GetPublicKey` and `AsymmetricSign`) are now tried up to 5 times, waiting 1s, 2s, 4s and 8s in between, when they fail with a transient error. That covers KMS 5xx/408/429, network errors, per-request timeouts, and failures to fetch workload identity credentials. - Other KMS 4xx errors (permission denied, not found) still fail immediately. If the job is cancelled, gpgkms stops retrying and returns the context error. - Every KMS signature is still checked locally before it is used. This fixes [PLE-146](https://linear.app/codercom/issue/PLE-146). In that run, every gpgkms call failed with `credentials: status code 503: upstream connect error …` and the build failed. ## Does the signing key change? No. Key derivation is unchanged: gpgkms's golden and compat tests pass unchanged at v0.2.1. ## Not covered In the same run, darwin_amd64 failed in `kmsp11` (rcodesign's PKCS#11 library, `Error occurred when fetching oauth2 token`), not in gpgkms. This PR does not add retries there. ## Validation - `go get -tool github.com/coder/gpgkms/cmd/gpgkms@v0.2.1`, then `go mod tidy` (only gpgkms lines change), `go mod tidy -diff` and `go mod verify`. - `go tool github.com/coder/gpgkms/cmd/gpgkms` builds and runs. - The real KMS signing path runs in the next `build` workflow. --- _Opened by Xum on behalf of @deansheather._ |
||
|
|
521694f9f1 |
fix(site/src/pages): name the highlighted data point in more charts (#32697)
#32665 gave the user engagement chart's highlighted data point (the recharts active dot) `role="img"` and an `aria-label` that matches its tooltip, because NVDA read nothing for it. This does the same for the two other keyboard-focusable line charts: - **`ActiveUserChart`** (template insights): "8 active users, January 02" - **`LicenseSeatConsumptionChart`** (Deployment > Licenses): "165 seats, January 02" Each gets a small `formatDay` helper, so the label and the tooltip date stay in sync. recharts passes the custom dot the same props as the default one, so it looks the same. Closes DEQ-650 | Ticket | UI surface | |---|---| | DEQ-650 | Template > Insights active users chart; Deployment > Licenses seat consumption chart | No screenshots: the change only adds ARIA attributes. Storybook pixel diffs of the highlighted dot are identical to `main`. The ticket also lists `SpendTrendsCard` (AI spend). It is a `BarChart`: `Bar` has no `activeDot`, `activeBar` defaults to `false`, and the tooltip cursor is off, so no highlighted element renders that could need a name. It is unchanged. Verification: - **Storybook axe:** on `main` the active dot has no role or name. On this branch `svg-img-alt` and `aria-allowed-role` pass. - **Story tests:** the new stories fail without the source change and pass with it. - **Checks:** `pnpm check` and `pnpm lint` pass. Review notes: - **FE1 (story waits on a named element):** each file gets a `KeyboardHighlight` story that focuses the chart, presses ArrowRight, and waits with `findByRole("img", { name })`. That is setup for the Pixel capture of the highlighted state, and it throws if the dot is unnamed. An accessible name can't be checked from a screenshot, and jsdom can't render `ResponsiveContainer`, so no Vitest test can check it. #32665 used the same justification. The existing default stories are unchanged, so their resting-state baselines stay. - **`formatDay` repeated in three chart files:** kept local, as #32665 did. It is moved tooltip code, and the label must match each chart's tooltip. Moving it to `components/Chart` would also touch `UserEngagementChart`. - **`toLocaleString(undefined, …)` and "1 seats":** both are the tooltip's existing wording and locale, copied on purpose so the label matches the visible text. <details> <summary>Decision log</summary> - **Same fix as #32665:** `role="img"` and an `aria-label` on the active dot. The alternatives #32665 rejected (`aria-activedescendant` to a dot that remounts on every move, `aria-hidden`, `graphics-symbol`) still apply. - **`SpendTrendsCard` left out:** checked in recharts 2.15.4. With `activeBar: false` and no cursor, nothing highlighted renders. - **Live region:** unlike `UserEngagementChart`, these charts have no live region for arrow-key moves. That is a separate gap, not in this ticket. - **Size:** about 60 non-test lines. </details> 🤖 Generated by Coder Agents on behalf of @bartekgatzcoder. |
||
|
|
cbbab78930 |
fix(site/src): announce copy confirmations to screen readers (#32696)
Five copy controls confirmed success only visually: an icon swap, new
button text, or tooltip text. They had no live region, so screen readers
did not announce the copy (WCAG 4.1.3). `CopyButton`,
`UserDropdownContent` and `AgentRow` already rendered a hidden
`role="status"` "Copied" span next to the control.
This exports that span from `CopyButton.tsx` as `CopiedStatus` and
renders it next to the five controls:
- **Template embed:** "Copy button Markdown"
- **CLI auth page:** "Copy session token"
- **Chat sharing popover:** "Copy link"
- **Remote diff panel:** branch name copy button
- **`CopyableValue`:** used for resource metadata, sensitive values and
the icons page
`CopyButton`, `UserDropdownContent` and `AgentRow` now use the same
component, with no change to their DOM.
Closes DEQ-629
| Ticket | UI surface |
|---|---|
| DEQ-629 | Template > Embed, CLI auth page, Agents chat share popover,
Agents remote diff branch copy, `CopyableValue` (workspace resource
metadata, icons page) |
No screenshots: the status text is visually hidden. Storybook pixel
diffs of `CopyableValue` and `CliAuthPageView` are identical to `main`
before and after clicking.
Verification:
- **Storybook:** each control renders an empty status region before the
click, and it reads "Copied" after.
- **Tests:** `CopyableValue` and `CliAuthPageView` get new tests. The
existing `ChatSharingPopover` and `TemplateEmbedPage` copy tests now
also check the status. Each fails without the change.
- **No test for `RemoteDiffPanel`:** it needs query mocking for its diff
fetch, and it renders the same `CopiedStatus` the other tests cover.
- **Checks:** `pnpm check` and `pnpm lint` pass.
Note (pre-existing, not changed here): in `UserDropdownContent`, the
status span sits inside the `DropdownMenuItem`, so "Copied" may become
part of that item's accessible name. Moving it is a separate change.
<details>
<summary>Decision log</summary>
- **Shared component:** review flagged pasting the same three-line span
into five more files (eight copies in total). `CopiedStatus` lives next
to `CopyButton`, which already owned the pattern. Adding it there needs
no new file, and every consumer imports from `components/`, so there are
no circular imports.
- **Sibling, not child:** the status is rendered next to the control,
not inside it, so it never changes the control's accessible name.
`sr-only` is absolutely positioned, so it does not affect `flex`/`gap`
layouts.
- **Many live regions on the icons page:** each `CopyableValue` mounts
an empty region. Only one is ever non-empty, because the next click
clears any earlier confirmation (`useClipboard`), the same as `AgentRow`
in lists.
- **Size:** about 30 non-test lines once whitespace from the new
fragments is ignored.
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
|
||
|
|
8fae134458 |
fix(site/src/modules/workspaces/WorkspaceTiming): label timing rows directly instead of a color legend (#32393)
> [!NOTE] > Draft: the approach is still under design review, so this may change. Generated by Coder Agents on behalf of @chrifro. Resource and script bars in the build timeline could be told apart only by color, which fails WCAG 1.4.1 (Use of Color, Deque DEQ-255). Some actions, such as `state refresh` and unknown actions like `terraform` and `load`, also had identical swatches. Each timeline row now shows its action or status as text after the duration, and the toolbar legend is removed because it repeated that text. Bars keep their colors. The row text is `aria-hidden` because the bar's accessible name already includes the category (#32016). The legend types are renamed from `ChartLegend` to `ChartCategory`. Screenshots use real build timings from a coder/coder dogfood workspace (111 timings), served to a local build: | | Before | After | |---|---|---| | Plan |  |  | | Apply |  |  | | Startup scripts |  |  | <details> <summary>Verification with dogfood data</summary> I pulled the timings of 117 real builds from dogfood (1,089 script timings and 10,730 provisioner timings). I rendered three of them in the real app at 1400 and 768 px wide: a 111-row coder-kata build, a 114-row rebuild with 35 deletes, and an 18-row ephemeral build. Each stage was checked against the base commit: - Row counts per stage match the base commit (for example 4, 29, 27 and 15). - Every row has a label, and it matches the category in the bar's accessible name. - No label wraps, sits outside its row, or overlaps its bar. - No legend swatches remain (the base commit had 1 to 3 per stage). - At 768 px, two rows run past the chart's edge. On the base commit the same rows' bars and durations already run past it, and the chart scrolls horizontally to show them. - React warns about duplicate keys when a build deletes and recreates the same resource. The base commit has the same warning, so it is not caused by this PR. Every real script status was `ok`, so the other statuses are only covered by the existing stories, which still pass. </details> <details> <summary>Decision log</summary> - **Grey for the uncolored actions only:** rejected. It separates `terraform` from `state refresh`, but every category is still distinguished by color alone. - **3:1 contrast between legend entries:** rejected. The rule excludes colors that carry meaning (success, failure), the current fills are 1.0 to 1.4:1 against each other, and contrast can separate at most three entries within the 21:1 range. The charts have six or more. - **Icons for success and failure only:** rejected. The other script statuses and every resource action would still differ by color alone. - **Legend plus row text:** rejected after review because it repeated the same information. - **Row text without a legend (this PR):** each bar is labeled directly, so color carries no information that isn't shown as text. </details> Refs DEQ-255 |
||
|
|
267f1d8c9e |
fix: stop lint/docs-redirects depending on the live docs site (#32739)
`lint` has failed on every push to `main` and `release/2.40` since the docs site was republished on the 24th, e.g. https://github.com/coder/coder/actions/runs/45560160492/job/139021802160 coder/docs-engine#273 has the docs site generate one page per REST API endpoint from `coderd/apidoc/swagger.json`, at `reference/api/<section>/<endpoint>`, and list them in `llms.txt`. `lint/docs-redirects` downloads that list, and treats any page on it that isn't in `docs/manifest.json` as a page we removed, so it reported all 389 endpoint pages: ``` docs route "reference/api/agents/authenticate-agent-on-aws-instance" no longer resolves (from the live page list https://coder.com/beta-docs/@main/llms.txt). Add a rule to docs/redirects.json, for example: {"source": "reference/api/agents/authenticate-agent-on-aws-instance", "destination": "/"} ``` Nothing is broken on the site, those pages are live, and I don't think the docs engine is doing anything wrong either. The actual problem is that `make lint` depends on whatever coder.com is serving at the time, so a docs site release can turn `main` red without a commit here. It also fails where nobody can act on it: a PR only downloads the list when it changes `docs/manifest.json` or `docs/redirects.json`, whilst every push to `main` downloads it, and that run is after the merge. So PRs kept passing lint and merging onto a red `main`. To fix, `lint/docs-redirects` now runs with `-offline`, and only compares the manifest and redirects against the base branch. A PR that moves or removes a page without a redirect still fails, as that comparison never needed the download. I think this is the right fix, rather than just teaching the check about endpoint pages, because the download wasn't catching anything. The site is built from the manifest, so a page can only be on the live list and missing from the manifest if a PR removed it, in which case the base comparison already fails that PR, or if the docs engine made the page itself. Today 391 live pages aren't in the manifest, and all of them are the second kind: the 389 endpoint pages, plus 2 pages the site serves with hyphens for dots, which the check already special-cased. Endpoint pages would be the second special case of that kind, and the next docs engine change that adds pages would need a third. What we lose is a second failure on `main` when a page removal is merged past a failing lint, and that failure clears by itself once the site is republished without the page. On a push there's no base branch to compare against, so only the rules themselves are validated there. Alternatives I considered: - Only skipping the endpoint pages, which is what this PR did at first. It fixes today's failure and leaves the cause in place, as above. - Deriving the endpoint pages from `swagger.json` in the check, so they're compared like any other page. That means copying the docs engine's URL rules into this repo and keeping the two in step, in order to catch renamed or removed endpoints. In the last 90 days on `main` that was one removal and no renames. - Deleting the live comparison outright. I've kept it, as it's still useful to run by hand without `-offline`, e.g. after a change to how the docs engine builds its routes. So that it's usable, the first commit stays: routes of the endpoint page form are left out of that comparison whilst their section page is still in the manifest, and it prints how many were skipped. `go run ./scripts/docsredirectscheck -branch main` goes from 389 failures to passing. - Comparing against the previous commit on push runs, so that `main` keeps a removed-route check. That's the comparison the PR already ran, and a failure there comes after the merge. The URL of an endpoint page changes whenever its `@Summary` or tag does, and nothing here will notice. Catching that would mean requiring a redirect on those API changes, which I've left out of this PR. This also needs backporting to `release/2.40`. |
||
|
|
389cfeef2f |
fix(coderd): generate chat titles for users without the owner role (#32738)
Automatic title generation only works for chats created by a user with
the Owner role. For anyone else the chat keeps its fallback title (the
first message, truncated), and the only sign is a warning in the coderd
logs:
```
[warn] coderd.chatd.processor: failed to resolve model for automatic title generation ...
error= resolve fallback chat model for title:
- get AI provider:
- unauthorized: rbac: forbidden: ...
```
`GenerateChatTitleForMessagesAsync` runs its goroutine as the user who
made the request, and resolving the title model reads the `ai_provider`
row, which only Owners can read. Setting a title generation model
override doesn't help, as resolving the override reads the provider too.
To fix, we'll run the goroutine as chatd, as `ProposeChatTitle` already
does for the same reason. The model config lookup still loads the chat
owner's subject, so the owner's access still decides which model the
title call can use. That lookup now has the owner's full scope, where
before it had the scope of the API key that made the request.
`TestPostChats_AutomaticTitleGeneration` now creates the chat as a
member and asserts on the stored title, instead of waiting for the title
request to reach the provider.
I've confirmed this on a dev server (`./scripts/develop.sh`, one OpenAI
provider, `gpt-4.1-mini` as the default model, no title generation model
override), creating chats through the API on the same database before
and after the fix:
| Commit | Chat created by | Title |
|---|---|---|
| `6603069e8b` (`main`) | `admin` (Owner) | Generated after 2s: "Why the
sky is blue" |
| `6603069e8b` (`main`) | `member` (no roles) | Still the fallback after
90s, and coderd logged `failed to resolve model for automatic title
generation` |
| `549cbdfafb` (this PR) | `member` (no roles) | Generated after 2s:
"Why the sea is salty" |
It also reproduces on dogfood, where I don't have the Owner role: a chat
I created there on `main` kept its fallback title.
|
||
|
|
b9d3240158 |
fix(site/src/pages): scroll the whole sidebar tab into view on focus (#31394)
Part of DEQ-344, split out of #30689 (now merged) because it uses JS rather than classes alone. In the right panel tab strip, tabbing to a closeable tab's × scrolls only the × into view, so the tab half and its focus ring stay clipped at the scroller edge. On keyboard focus (`:focus-visible`), each tab pill now scrolls itself into view, and `scroll-px-9` keeps it clear of the 32px scroll chevron overlays. Pointer focus does not scroll: scrolling on mousedown moved the pill under the pointer and dropped the click. <details> <summary>Verification</summary> Playwright tab-through of the `SidebarTabView` `CloseableTabs` story at a 420px viewport, measuring each focused pill against the visible scroller area (minus chevron overlays): - `main`: 3 of 15 forward stops clipped (`Terminal 5` by 69px, `Terminal 7` and its × by 45px). - This branch: 0 clipped, forward and backward. Chromium, mouse press near the right visible edge of a partly hidden tab: before the keyboard-only check, the strip scrolled 46px on mousedown and the click landed on the pill wrapper; now it does not scroll and the tab receives the click. The new `CloseableTabLabelFocusedWithKeyboard` story focuses a tab whose close button starts clipped. The Vitest test covers pointer focus only, because jsdom's `:focus-visible` inside a focus handler depends on earlier focus changes in the file. `pnpm lint`, `make pre-commit`, and the `SidebarTabView` unit and story tests pass. </details> --- *Generated by Coder Agents on behalf of @tracyjohnsonux.* --------- Co-authored-by: Jake Howell <jacob@coder.com> Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com> |
||
|
|
148f06f50d |
fix(site/src): raise Agents search placeholder contrast (#32715)
Placeholder text in the Agents search fields used `content-disabled`,
which measures about 1.9:1 on the dark surface. That is below the WCAG
1.4.3 minimum of 4.5:1. This PR switches the model selector "Search..."
and the sidebar "Search chats..." placeholders to `content-secondary`
(about 7.7:1 in dark and light themes), the same token the shared
`Input` and `Command` placeholders use.
This is the first of several PRs for DEQ-356.
<details>
<summary>Plan and decisions</summary>
- DEQ-356 stays one Linear issue. Each area it covers gets its own PR:
1. Search placeholders (this PR).
2. Sidebar chat timestamp (`text-content-secondary/50`, about 2.69:1).
This one waits on the sidebar redesign.
3. Filter menu and chat sharing popover. These need a fresh axe scan of
the current UI before any code changes.
- The scope is the Agents area. About 20 other fields outside it (AI
Settings, Secrets, Template Builder, `IconField`) use
`placeholder:text-content-disabled`. They are left for a separate fix.
</details>
> 🤖 This PR was generated by Coder Agents on behalf of @tracyjohnsonux.
|
||
|
|
c52348ce43 |
fix(enterprise/dbcrypt): keep the stored value out of the malformed-field error (#32613)
--- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ |
||
|
|
d4e66907c4 |
refactor(coderd/x/chatd/chatwebhook): keep only the Standard Webhooks verifier (#32614)
--- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ |
||
|
|
39a4b4d90c |
fix(coderd/schedule/cron): compare reserved zone names without case (#32087)
--- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ |
||
|
|
13f5cc7872 |
fix(coderd/telemetry): give the reporter its own HTTP transport (#32160)
--- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ |