Commit Graph
17994 Commits
Author SHA1 Message Date
dependabot[bot] fbbfd01ec5 ci: bump the github-actions group across 1 directory with 12 updates
Bumps the github-actions group with 12 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [step-security/harden-runner](https://github.com/step-security/harden-runner) | `2.21.1` | `2.22.4` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.1` | `7.0.2` |
| [docker/login-action](https://github.com/docker/login-action) | `4.6.0` | `4.8.0` |
| [pnpm/action-setup](https://github.com/pnpm/action-setup) | `6.1.0` | `6.1.1` |
| [depot/build-push-action](https://github.com/depot/build-push-action) | `1.18.0` | `1.19.0` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `7.0.0` | `8.0.2` |
| [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `10.3.0` | `10.3.3` |
| [linear/linear-release-action](https://github.com/linear/linear-release-action) | `0.18.1` | `0.18.2` |
| [toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign) | `3.1.0` | `3.1.1` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.39.0` | `4.39.3` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.39.0` | `4.39.3` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.39.0` | `4.39.3` |



Updates `step-security/harden-runner` from 2.21.1 to 2.22.4
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](https://github.com/step-security/harden-runner/compare/v2.21.1...1d88384fd173af6ecb012dfd0264a306b711241a)

Updates `actions/upload-artifact` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v7.0.1...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

Updates `docker/login-action` from 4.6.0 to 4.8.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/dbcb813823bdd20940b903addbd779551569679f...8aa5831fb8d48d8f76594c7ddde61ae58019f550)

Updates `pnpm/action-setup` from 6.1.0 to 6.1.1
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/ea17c68df8912ef543352723c149a84f56e3d413...73e46992e05b19abd31f2f3c20e0e7370d762115)

Updates `depot/build-push-action` from 1.18.0 to 1.19.0
- [Release notes](https://github.com/depot/build-push-action/releases)
- [Commits](https://github.com/depot/build-push-action/compare/98e78adca7817480b8185f474a400b451d74e287...0f27be7c41d76663a98518dfe68f1c46582242c4)

Updates `actions/download-artifact` from 7.0.0 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...9000827ccba6bdab643e8b6fd33ac0654aef8333)

Updates `astral-sh/setup-uv` from 10.3.0 to 10.3.3
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/1c37ad07a6a961277cf70c0d37d6f313000f5884...68559e99cc807c1eb7e9238fd43a15bba460eec2)

Updates `linear/linear-release-action` from 0.18.1 to 0.18.2
- [Release notes](https://github.com/linear/linear-release-action/releases)
- [Commits](https://github.com/linear/linear-release-action/compare/30f9ae77461ec29f07fffe0c52edd1909bfbb6f5...dd4fc407f860b9460d2cf0b3fb1edd8985cf443f)

Updates `toshimaru/auto-author-assign` from 3.1.0 to 3.1.1
- [Release notes](https://github.com/toshimaru/auto-author-assign/releases)
- [Changelog](https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/toshimaru/auto-author-assign/compare/a78a94b219445cece8ccf0d45fec60af449f212a...415448809ea5ba0e171b251632720b009df3d8d6)

Updates `github/codeql-action/upload-sarif` from 4.39.0 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee...33d7b85da1a04171e211befe2c739303b9a4c066)

Updates `github/codeql-action/init` from 4.39.0 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee...33d7b85da1a04171e211befe2c739303b9a4c066)

Updates `github/codeql-action/analyze` from 4.39.0 to 4.39.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee...33d7b85da1a04171e211befe2c739303b9a4c066)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: astral-sh/setup-uv
  dependency-version: 10.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: depot/build-push-action
  dependency-version: 1.19.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: docker/login-action
  dependency-version: 4.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.39.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: linear/linear-release-action
  dependency-version: 0.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: pnpm/action-setup
  dependency-version: 6.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: step-security/harden-runner
  dependency-version: 2.22.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: toshimaru/auto-author-assign
  dependency-version: 3.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-19 23:27:52 +00:00
Jon Ayers 73bbbe5b7d ci: use shared signing setup action (#32486) 2026-11-19 17:19:57 -06:00
Andrew Aquino f9867168ad fix(site/src/modules/notifications): make inbox mark as read buttons distinguishable (#32466)
Each unread inbox notification's "Mark as read" button now gets
`aria-describedby` pointing at the notification content, the same way
the action links do since #32317. Screen reader users can now tell which
notification each button marks. The label also changes to sentence case
to match "Mark all as read".

The sr-only "Unread" text used to sit inside the dot, which is `display:
none` on hover and focus-within. Screen readers lost the unread state
while a user was in the item. The text is now a sibling of the dot. The
button was already keyboard reachable on main (#31656), so this was the
part of DEQ-610 still open.

Closes DEQ-610
Closes DEQ-633

| Ticket | UI surface |
| --- | --- |
| [DEQ-610](https://linear.app/codercom/issue/DEQ-610) | Navbar bell >
Inbox popover, unread item "Unread" indicator (screen reader only, no
visual change) |
| [DEQ-633](https://linear.app/codercom/issue/DEQ-633) | Navbar bell >
Inbox popover, unread item "Mark as read" button
([screenshots](https://linear.app/codercom/issue/DEQ-633#comment-dcc113c9))
|

<details>
<summary>Grouping and decision log</summary>

- Both tickets cover the same element in `InboxItem.tsx`, so they ship
in one PR.
- DEQ-610's keyboard reachability
(`not-group-hover:not-group-focus-within:sr-only`) is already on main
from #31656. Verified in Storybook (`InboxItem` / `UnreadFocused`): on
main, `Unread` has no layout box while the item has focus; on this
branch it stays in the accessibility tree.
- DEQ-633 reuses `aria-describedby={contentId}` from #32317 and keeps
"Mark as read" as the name. Every button has the same name, and the
description tells them apart.
- Self-review (frontend-review, frontend-deep-review,
frontend-accessibility): the only should-fix was a test whose keyboard
assertions can't fail in jsdom. I cut it down to the
accessible-description assertion. No findings were dropped.

</details>

🤖 Generated by Coder Agents on behalf of @aqandrew.
2026-11-19 13:54:24 -08:00
McKayla はな 55fd0ab1f5 fix: keep dynamic parameter edits after a submit attempt (#32355) 2026-11-19 14:27:18 -07:00
McKayla はな 485f678053 fix: let popovers scroll with the wheel inside dialogs (#32412) 2026-11-19 14:26:45 -07:00
Jeremy Ruppel eb4fde8429 fix(site/src): stop announcing parent breadcrumb links as the current page (#32460)
`BreadcrumbLink` wrapped React Router's `NavLink`, which sets
`aria-current="page"` on any link whose target is an ancestor of the
current URL. Breadcrumb links always point at ancestors, so on template
and workspace settings pages screen readers announced the parent crumb
as the current page (WCAG 4.1.2). `BreadcrumbLink` now renders a plain
`Link`.

The same two layouts also nested `BreadcrumbPage` (the non-link label)
inside `BreadcrumbLink`; the layout classes now go on the link directly.
As a side effect, the link's hover colour now applies to the crumb text,
which the nested span used to override.

The new test asserts on `aria-current` directly, since that attribute is
invisible to visual regression screenshots.

Closes DEQ-609

<details>
<summary>Review notes</summary>

- Commits: (1) `NavLink` to `Link` plus regression test, verified to
fail without the fix; (2) remove `BreadcrumbPage` nesting in
`TemplateSettingsLayout` and `WorkspaceSettingsLayout`; (3) JSDoc on
`BreadcrumbLink`, `LinkProps` type.
- No caller uses `NavLink`-only props (`end`, function
`className`/`children`) or `.active` / `aria-current` styling.
- Self-review ran frontend-review, frontend-deep-review,
frontend-accessibility (code audit) and test-audit: no blocking or
should-fix findings. At-rest layout is unchanged (the link becomes the
flex container the span used to be).
- Pre-existing, out of scope: breadcrumb links rely on the browser
default focus outline; Avatar fallback initials are not hidden from
assistive tech.

</details>

> Generated by Coder Agents on behalf of @jeremyruppel.
2026-11-19 15:18:30 -05:00
Andrew Aquino c004d655b9 fix(site): mark emoji picker category labels as headings (#32407)
The emoji picker's category labels ("Smileys & emotion", "Food & drink",
...) look like headings but were plain text. This bumps
`@coder/frimousse` to 0.4.2, which renders category headers as grid rows
(coder/frimousse#5), and wraps each label in an `h2`. The `h2` uses the
label's existing classes, so nothing changes visually.

Closes DEQ-130. Replaces #32189, which made the same change as a pnpm
patch.

The row-numbering test now searches a term that matches two categories.
It checks each heading, every row's `aria-rowindex`, and
`aria-rowcount`.

0.4.2 was published at 2026-11-18 17:08 UTC. Until 2026-11-19 17:08 UTC,
CI installs fail pnpm's minimum release age check
(`ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION`). Re-run CI after that. There
is no temporary exclusion, per
https://github.com/coder/coder/pull/32298#discussion_r4593170186.

🤖 Generated by Coder Agents on behalf of @aqandrew.
2026-11-19 10:24:08 -08:00
Nick VigilanteandCoder Prototypes feb6e809c4 docs: add provisioner metrics and a metrics signpost page (#31977)
## Summary

Admins who start from the External provisioners docs had no way to find
out which Prometheus metrics exist for provisioners, or how to turn them
on for standalone provisioner daemons.
This PR documents both, and turns the deployment metrics page into a
signpost to the monitoring docs for each area.

## Changes

- **`docs/install/operate/provisioners/index.md`:** expands the
"Prometheus metrics" section. The heading and its `#prometheus-metrics`
anchor are unchanged.
- It explains which metrics each provisioner daemon reports and which
the control plane reports. For built-in provisioners, the control plane
also reports the daemon metrics.
- Two tables list each metric's purpose and link to the generated
[Available
metrics](https://coder.com/docs/admin/integrations/prometheus#available-metrics)
table for types and labels.
- It explains how to read the queue wait metric. Jobs whose tags no
provisioner matches don't appear in it until a provisioner acquires
them.
- It shows how to turn on the daemon's Prometheus endpoint with
`--prometheus-enable` / `CODER_PROMETHEUS_ENABLE` and
`--prometheus-address` / `CODER_PROMETHEUS_ADDRESS`. It corrects the
stated default address from `localhost:2112` to `127.0.0.1:2112`.
- It covers the `coder-provisioner` Helm chart: the fixed `0.0.0.0:2112`
address, the `prometheus-http` container port, and the missing Service.
It adds a Pod discovery example with `coder.podAnnotations` and a
`PodMonitor` alternative.
- **`docs/install/operate/provisioners/manage-provisioner-jobs.md`:**
links from the troubleshooting section to the metrics section.
- **`docs/admin/monitoring/metrics.md`:** becomes a signpost page.
- It keeps the control plane setup links and the `#setting-up-metrics`
anchor.
- It adds a table of monitoring pages per area (provisioners, workspace
proxies, prebuilt workspaces, AI Gateway, Agent Relay), and notes which
areas serve metrics on their own endpoint.
  - It links to the full metrics list.

No new pages, so `docs/manifest.json` is unchanged.

## Testing

- `make lint/emdash`, `go run ./scripts/docshtmlcheck`, markdownlint,
and `markdown-table-formatter` are clean on the changed files.
- Vale reports 0 errors and 0 warnings. Its 4 suggestions are on lines
this PR doesn't change.
- The pre-commit hook (`pre-commit-light`, including
`lint/docs-redirects`, `lint/markdown`, and `lint/style-claims`) passed.
- A script resolved every relative link and anchor in the changed files.

<details>
<summary>Verified against</summary>

- `provisionerd/provisionerd.go` (`NewMetrics`): names of the five
provisioner daemon metrics.
- `provisionerd/runner/runner.go`: where the job and build metrics are
recorded.
- `cli/server.go:1273-1296`: the control plane registers the daemon
metrics only for built-in provisioners, and sets `num_daemons` to the
built-in count. `cli/server.go:385-389` registers the provisioner server
metrics.
- `coderd/provisionerdserver/provisionerdserver.go:1011-1019`:
`coderd_provisioner_job_queue_wait_seconds` is recorded only when a
provisioner daemon acquires a job. `coderd/coderd.go:2602` and
`enterprise/coderd/provisionerdaemons.go:365` pass the same metrics to
built-in and external provisioners.
- `coderd/jobreaper/detector.go:26-28`: a pending job that nothing
acquires is failed after 30 minutes, without a queue wait observation.
- `coderd/wsbuilder/metrics.go` and
`coderd/wsbuilder/wsbuilder.go:357-373`:
`coderd_workspace_builds_enqueued_total`.
- `enterprise/cli/provisionerdaemonstart.go:204-218, 371-383`: the
flags, env vars, and `127.0.0.1:2112` default. A standalone daemon sets
`num_daemons` to 1 and registers the Go, process, and `promhttp`
collectors.
- `cli/agent.go:603-611`: the metrics handler serves every path, so the
default `/metrics` scrape path works.
- `helm/provisioner/templates/_coder.tpl:40-41, 81-96`: the fixed
address, and the `prometheus-http` port that appears only when
`CODER_PROMETHEUS_ENABLE` is `"true"`. The chart has no Service
template.
- `helm/libcoder/templates/_coder.yaml:24-33`,
`helm/libcoder/templates/_helpers.tpl:20-22`, and
`helm/provisioner/tests/testdata/labels_annotations.golden`:
`coder.podAnnotations` and `coder.podLabels` land on the Pod template,
which carries the `app.kubernetes.io/name` and
`app.kubernetes.io/instance` labels.
- `enterprise/cli/proxyserver.go:243-250`: workspace proxies serve
metrics on their own listener.
- Tests that pin these claims: `coderd/workspaces_test.go` (queue wait),
`helm/provisioner/tests/testdata/default_values.golden` (fixed address),
and `enterprise/cli/testdata/coder_provisioner_start_--help.golden` (CLI
default).

</details>

<details>
<summary>Decision log</summary>

- **Kept the `## Prometheus metrics` heading.** Renaming it gained
nothing and would break external links to `#prometheus-metrics`. The AI
Gateway and Agent Relay pages that the signpost table links to use the
same heading.
- **Kept `<a id="setting-up-metrics"></a>` on `metrics.md`.** External
links to that anchor keep working, and `scripts/docshtmlcheck` passes
with it.
- **Dropped the Type and Labels columns.** `scripts/metricsdocgen` fills
one marked block in `prometheus.md`, so it can't generate these tables.
Types and labels drift the most, so the page now points to the generated
table for them. Extending the generator, or adding a check that metrics
named in `docs/` exist in `scripts/metricsdocgen/generated_metrics`,
would need a separate PR.
- **Rewrote the queue wait guidance.** The earlier text said a rising
value can mean no provisioner matches a job's tags. The code records the
value only when a provisioner acquires a job, so unmatched jobs never
reach the metric. The page now links to the existing troubleshooting
steps for finding them, instead of restating a command.
- **Reworded the signpost intro.** The workspace proxies page explains
how to turn on metrics but doesn't list them, so the table describes
each linked page as covering monitoring, not listing metrics.
- **"Separate endpoint" column.** Checked in code for workspace proxies.
Agent Relay has no server code in this repo, so its "Yes" comes from
`docs/agent-relay/monitoring/index.md`.

</details>

<details>
<summary>Related gaps not edited</summary>

- `docs/admin/integrations/prometheus.md:14` and
`docs/admin/networking/workspace-proxies.md:221` still say
`localhost:2112`. The server and proxy default is `127.0.0.1:2112`
(`codersdk/deployment.go:2658`).
- `docs/workspaces/speed-up-templates.md:42-44` implies that control
plane metrics include `coderd_provisionerd_job_timings_seconds`. That
holds only for built-in provisioners.
- `docs/admin/networking/workspace-proxies.md#observability` explains
how to turn on the endpoint but doesn't list any proxy metrics.
- `docs/admin/networking/` (DERP and tailnet, for example
`coder_derp_server_*` and `coder_servertailnet_*`) has no metrics
section.
- `docs/admin/monitoring/health-check.md` links to the database metrics
flag but doesn't list the `coderd_db_*` metrics.
- `docs/admin/monitoring/notifications/` doesn't list the
`coderd_notifications_*` metrics.
- `docs/admin/users/` (`coderd_api_active_users_duration_hour`, license
metrics) and `docs/admin/security/audit-logs.md` have no metrics
sections.
-
`docs/templates/extending-templates/prebuilt-workspaces.md#available-metrics`
lists metrics without types or labels, and doesn't say how to turn them
on.

</details>

Disclosure: these changes were generated by Coder Agents.

Closes DOCS-892


Supersedes #31804, reopened under a human author for attribution.

---------

Co-authored-by: Coder Prototypes <294797144+coder-prototypes@users.noreply.github.com>
2026-11-19 12:59:31 -05:00
Nick VigilanteandCoder Prototypes 01b0a234e8 docs: add Verify Coder releases page (#31983)
Adds a how-to page, `docs/admin/security/verify-releases.md` (sidebar:
**Administration > Security > Verify releases**). It shows Coder
deployment administrators how to check release artifacts with the
evidence each release already publishes:

- GPG verification of `coder_<version>_checksums.txt` with its `.asc`
signature, then a SHA-256 check of the artifact (Linux `sha256sum`,
macOS `shasum`, Windows `Get-FileHash`).
- GPG verification of the standalone CLI binaries on
`releases.coder.com/coder-cli/<version>/` using their detached `.asc`
signatures.
- `gh attestation verify` for SLSA build provenance on release files,
Helm charts (including charts pulled from `oci://ghcr.io/coder/chart`)
and `oci://ghcr.io/coder/coder:v<version>`, pinned to `release.yaml` and
the release tag.
- `cosign verify-attestation --type spdxjson` for the image SBOM, with
the keyless certificate identity and steps to extract the SPDX document.
- Short macOS (`codesign`, `spctl`) and Windows
(`Get-AuthenticodeSignature`) code-signature checks.

The attestation steps in `release.yaml` use `continue-on-error`. The
page therefore calls provenance best-effort, does not promise every
artifact is attested, and gives a fallback when `gh attestation verify`
returns `HTTP 404: Not Found`.

Verified against:
- `.github/workflows/release.yaml`: build targets, attestation steps and
subject globs, the SBOM steps (`syft`, `cosign attest`), the `latest`
tag logic, the `releases.coder.com` upload, Helm publishing
- `scripts/release/publish.sh`: checksum file name and GPG signing of
the checksum file
- `scripts/sign_with_gpg.sh`: detached armored signatures
- `scripts/build_go.sh`, `scripts/build_windows_installer.sh`,
`scripts/archive.sh`, `scripts/sign_windows.sh`,
`scripts/sign_darwin.sh`, `scripts/notarize_darwin.sh`: which files are
code-signed and notarized
- `scripts/image_tag.sh`: image name and tag format
- `Makefile`: slim binary and `.asc` handling
- `mise.toml`: the release pipeline uses cosign 2.4.3
- `release.key`: the public key in the repo root
- Every command except the macOS and Windows code-signature checks was
run against release v2.38.6: Linux and macOS commands in a shell,
Windows commands in PowerShell 7 on Linux. GPG checksum and binary
signatures, `gh attestation verify` on files, Helm charts and the OCI
image, and Cosign 3.1.4 SBOM verification all succeeded. Cosign 2.4.3
without the flag also succeeded.

<details>
<summary>Decision log</summary>

- Placed under `admin/security/` because the Security section lists its
child pages automatically, and the page is meant to be linked from the
trust center.
- PowerShell variables are case-insensitive, so `${VERSION}` works in
both shells. Single-line commands are shared, and tabs appear only where
commands really differ.
- Cosign 3 needs `--new-bundle-format=false` to find the SBOM
attestation. Without it, it reports "none of the attestations matched
the predicate type: spdxjson". Cosign 2 rejects the flag, so the page
tells Cosign 2 users to remove it.
- The `gpg --import` example output uses `<key ID>` rather than the real
key ID, to stay consistent with the fingerprint placeholder.
- Dropped Cosign's first output line because it ends in a spaced `--`,
which the punctuation rules ban.
</details>

Open questions for the reviewer:
- **Security: GPG fingerprint.** The page has a `TODO(security)`
placeholder. For reference, `gpg --show-keys release.key` reports
primary key `21C9 6B1C B950 7188 74F6 4DBD 6A5A 671B 5E40 A3B9` (`Coder
Release Signing Key <security@coder.com>`, expires 2029-01-18,
encryption subkey expired). That key signed the v2.38.6 checksums.
Please confirm this is the fingerprint to publish, and whether
`raw.githubusercontent.com/coder/coder/main/release.key` is the right
place to download it.
- **Security: signing identities.** Placeholders remain for the Apple
Developer ID / Team ID and the Windows EV certificate subject. The page
publishes the Sigstore certificate identity
`https://github.com/coder/coder/.github/workflows/release.yaml@refs/tags/v<version>`
with issuer `https://token.actions.githubusercontent.com`. Both come
from the public workflow path and were seen in real verification output.
Please confirm that is acceptable to publish.
- **Not run:** the macOS `codesign -dvv` / `spctl --assess -t install`
steps and Windows `Get-AuthenticodeSignature` come from script comments.
They need a check on real macOS and Windows machines, including expected
output.
- **Cosign format risk:** the SBOM attestation uses the older cosign
format, which Cosign 3 has deprecated. Consider a release-workflow step
that runs the documented verify command so a format change gets caught.
- **Public URL:** is `releases.coder.com/coder-cli/<version>/` meant to
be a documented download location?
- **Trust center link:** the trust center is outside this repo, so
someone needs to add the link to this page there.
- **Likely merge conflict:** open PR #31806 also edits
`docs/manifest/admin/security.yml` and `docs/manifest.json`.

Generated by Coder Agents.

Closes DOCS-1219


Supersedes #31811, reopened under a human author for attribution.

---------

Co-authored-by: Coder Prototypes <294797144+coder-prototypes@users.noreply.github.com>
2026-11-19 12:58:51 -05:00
Ben Potter 5f61a045ab docs: refocus sandbox agents intro on Coder's approach (#32451) 2026-11-19 09:19:28 -06:00
Susana Ferreira 8705d80fe0 feat: add provider, model, and client spend to the AI spend users endpoint (#32330)
## Description

Extends the experimental `GET
/api/experimental/organizations/{organization}/ai/spend/users` endpoint
with the per-user details behind the AI spend overview and the detailed
report. Each user now returns their spend per provider, model, and
client, and whether each has unpriced usage.

## Changes

- Rewrite `ListOrganizationAISpendUsers` with `GROUPING SETS`, returning
one row per user and provider, model, or client:
  - Adds the `user_ids` and `group_id` filters.
  - Pages, counts, and totals users, not their rows.
- Reads the provider display name, icon, and type from `ai_providers`,
including deleted providers. The live provider wins when a name was
reused, like `GetAIProviderFilterOptions`.
- Update the SDK and handler:
- Each user returns `provider_spend`, `model_spend`, and `client_spend`,
most expensive first, each with `has_unpriced_usage`.
  - `totals` returns `has_unpriced_usage`.
- Remove the `providers`, `clients`, and `models` name arrays and
`unpriced_usage_count`.
  - Accept `user_ids` (comma-separated, maximum 100) and `group_id`.
- Return more than 100 `user_ids` on the group members AI spend endpoint
as a validation error, like `/ai/spend/users`.
- Switch the Spend page to the new fields, with no UI changes.
- Update the query and handler tests.

<details>
<summary>Dogfood performance</summary>

- Benchmarked on **dogfood**, comparing the existing query on **main**
with the updated query in **this PR**.
- Tested **1, 7, 15 and 30-day windows**, ending at **November 18, 2026,
00:00 UTC**, exclusive.
- Each query ran **five times per window**, one at a time, with query
order and window order rotated across rounds to reduce ordering bias.

The table shows PostgreSQL execution time in **seconds, average
(min-max)**.

| Days | Main | This PR |
|------|-----:|--------:|
| 1 | 0.288 (0.199-0.501) | 0.223 (0.184-0.275) |
| 7 | 11.413 (4.076-40.003) | 4.107 (3.529-4.828) |
| 15 | 9.961 (8.053-16.917) | 7.253 (6.873-7.736) |
| 30 | 14.979 (12.276-23.177) | 8.499 (7.813-9.169) |

All five runs are included. Main's first seven-day run took **40.003s**
with unusually high read I/O time, which raises its average. Cache and
concurrent load can affect these results.

</details>

Closes AIGOV-734

> [!NOTE]
> Generated by Coder Agents on behalf of @ssncferreira.
2026-11-19 14:59:20 +00:00
Jeremy Ruppel f0f00c3069 fix(site/src/pages/WorkspacesPage): open workspaces from the name link, not a role-less focusable row (#32196)
Workspace rows on `/workspaces` were `<tr tabIndex={0}>` with Enter and
Space handlers but no role (`WorkspacesRow` dropped the `role` that
`useClickableTableRow` returns). Each row was a keyboard stop that
navigated but did not tell assistive technology what it was, so the
Deque audit reported it as a link without a role (WCAG 4.1.2).

Rows are now plain table rows with a mouse-only click, the same pattern
as #31857 for the templates list. The workspace name, which was already
an `<a>`, now uses the shared `Link` (with `asChild` over the router
link), so keyboard and screen reader users open the workspace through a
real link with the standard focus ring. Table semantics and the
row-header name cell stay as they were.

- `my-0 py-0` on the name link keeps the focus ring off the owner line
below. The link stays 24px tall, which meets `target-size`.
- The name link stops `click` and `auxclick` propagation. Ctrl/Cmd-click
and middle-click no longer also run the row handler, which opened a
second tab or pushed a duplicate history entry.

Closes DEQ-209

| Ticket | Surface |
|---|---|
| [DEQ-209](https://linear.app/codercom/issue/DEQ-209) | Workspaces list
(`/workspaces`) rows. Screenshots:
[before/after](https://linear.app/codercom/issue/DEQ-209/link-link-does-not-have-a-role#comment-be9f7b7a)
|

The resting state does not change: the row height and the name's
position, color, and weight match `main`. The visible change is keyboard
focus, which moves from the whole row to the workspace name. The new
`WorkspaceNameFocused` story captures that state for Pixel.

<details>
<summary>Decision log</summary>

- I kept `useClickableTableRow` for the row's mouse handling, because
its portal guards stop clicks from the delete dialog from activating the
row. I pass only `onClick`, `onAuxClick`, and `className` to the row,
which drops `tabIndex`, `role`, and the key handlers.
- Test: a new case in `WorkspacesPageView.test.tsx`. Tab goes from the
select-all checkbox to the row checkbox and then to the name link, and
Enter opens the workspace. It fails on `main`, where the row takes focus
first.
- axe-core 4.11 in Storybook (`pages/WorkspacesPage` AllStates and
WorkspaceNameFocused) shows the same results on `main` and on this
branch. `link-missing-role` is a manual Deque checkpoint, so I checked
it by hand: no `tr` in the table body is focusable now.
- Dropped finding, frontend-deep-review RP6 (move the name link into a
named component): the diff edits the existing inline link in place and
adds 7 lines. That matches the inline `stopPropagation` on the Agent
badge link next to it and the #31857 precedent. Splitting the 1000-line
file is a separate refactor.
- Dropped nit, SA6 (ring offset color on a checked row):
`ring-offset-surface-primary` leaves a 2px band on a selected row's
`surface-secondary` background. This is the shared `Link` behavior
everywhere, so I left it.
- Pre-existing, not changed: the Agent badge link stops `click` but not
`auxclick`, so a middle-click on it also opens the workspace in a new
tab. The filter combobox has an `aria-valid-attr-value` violation
(`aria-controls` points to a closed popover).

</details>

🤖 Generated by Coder Agents on behalf of @jeremyruppel.
2026-11-19 09:38:40 -05:00
Jeremy Ruppel fddcc1a4ca fix(site/src): group role checkboxes under the Roles label (#32195)
The role checkboxes in `RoleSelector` sat under a visual "Roles" label
with no programmatic association, so screen readers announced each
checkbox without its group (WCAG 1.3.1).

`RoleSelectorLayout` now renders `role="group"` labelled by the "Roles"
text through `aria-labelledby`. When `hideLabel` is set (the "Edit
roles" and default roles dialogs), the label is visually hidden instead
of omitted, so the group keeps its name. The rendered UI does not
change.

Closes DEQ-585

| Ticket | UI surface |
|---|---|
| DEQ-585 | Create user form, Roles checkboxes (shared `RoleSelector`,
also used in the Edit roles and organization default roles dialogs) |

No visible change, so there are no screenshots.

<details>
<summary>Grouping and decision log</summary>

- One eligible ticket in the batch (DEQ-585). The root cause is in the
shared `site/src/modules/roles/RoleSelector.tsx`, so this one fix covers
every caller.
- Used `role="group"` + `aria-labelledby` rather than
`<fieldset>`/`<legend>`: the checkboxes are Radix `role="checkbox"`
buttons, and the layout also wraps the loading and error states, so a
group div avoids fieldset default styling and keeps the markup
unchanged.
- Coverage: a Vitest test finds the Auditor checkbox inside the `Roles`
group, submits the form, and asserts the submitted roles. It fails
without the fix.
- Verification: axe-core 4.11 (WCAG 2.0/2.1/2.2 A/AA + best-practice) on
the RoleSelector stories, `pages/CreateUserPage/WithRoles`, and
`UserActionDialogs/EditRolesLoading`: no violations. The accessibility
tree shows `group "Roles"` containing the 4 checkboxes.
- The ticket asks for "1 of 4" to be announced. Grouping alone does not
add set position for checkboxes, and NVDA gives no position for
checkboxes in a `group`. Adding list semantics would be speculative, so
this PR does not.
- Pre-existing, not changed: the loading and error branches do not pass
`hideLabel`, so the dialogs show a visible "Roles" label while loading.
- Self-review: frontend-review (FE1 to FE10) passes.
frontend-deep-review found one nit (a real email domain in the test),
which is fixed. frontend-accessibility: no blocking or should-fix
findings.

</details>

🤖 Generated by Coder Agents on behalf of @jeremyruppel.
2026-11-19 09:35:09 -05:00
coder-automations[bot]andgithub-actions[bot] 11b33b4c26 chore: refresh AI model price book (#32436)
## Price book changes

17 models added, 0 models removed, 19 models changed.

<details>
<summary>Added</summary>

- azure/gpt-6.2-astra
- azure/gpt-6.2-sol
- bedrock/global.openai.gpt-6.2-astra
- bedrock/global.openai.gpt-6.2-sol
- bedrock/openai.gpt-6.2-astra
- bedrock/openai.gpt-6.2-sol
- bedrock/us.openai.gpt-6.2-astra
- bedrock/us.openai.gpt-6.2-sol
- copilot/gemini-4-neon
- copilot/gpt-6.2-astra
- copilot/gpt-6.2-sol
- copilot/mai-code-2
- copilot/mai-code-2-flash
- google/gemini-4-neon
- openrouter/google/gemini-4-neon
- vercel/google/gemini-4-neon
- vercel/scaledown/extract-1
</details>

<details>
<summary>Changed</summary>

- openrouter/deepseek/deepseek-r1-0528
- openrouter/deepseek/deepseek-v4-flash-0731
- openrouter/deepseek/deepseek-v4.1-flash
- openrouter/deepseek/deepseek-v4.1-flash-1017
- openrouter/google/gemma-3-27b-it
- openrouter/google/gemma-4-26b-a4b-it
- openrouter/minimax/minimax-m3.1-flash
- openrouter/moonshotai/kimi-k2.7-code
- openrouter/moonshotai/kimi-k3
- openrouter/moonshotai/kimi-k3.1-pro
- openrouter/qwen/qwen3.5-27b
- openrouter/qwen/qwen3.5-9b
- openrouter/reflection/beam-1.0-501b-a23b
- openrouter/xiaomi/mimo-v2.5-pro
- openrouter/z-ai/glm-5.1
- openrouter/z-ai/glm-5.3-flash
- openrouter/~deepseek/deepseek-flash-latest
- openrouter/~deepseek/deepseek-v4-flash-latest
- openrouter/~moonshotai/kimi-latest
</details>

## Review notes

Regenerated by `make gen/aibridge-prices` from the live
[models.dev](https://models.dev) catalog. Both artifacts come from one
snapshot, so they ship together:

- `coderd/aibridge/prices/data/prices.json`
- `site/src/modules/aiModels/knownModels/knownModelsGenerated.json`

These are customer-visible cost numbers taken from upstream data, so
this PR is never merged automatically. The summary above lists what
moved; check the diff for exact figures before approving.

Opened automatically by the [aigateway-prices-refresh
workflow](https://github.com/coder/coder/actions/runs/44492971443).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-19 14:30:51 +00:00
Ben Potter 690d107fdb docs: explain how to keep a workspace running without a connection (#32315)
The answer to "how do I keep a workspace up while a long job or coding
agent runs?" only lived in the [reference
page](https://coder.com/docs/reference/#workspace-agents), which is hard
to find. This adds a **Keep a workspace running without a connection**
section to the scheduling page under Activity detection:

- Background processes (Claude Code in `tmux`, Herdr, `nohup` jobs)
don't count as activity.
- `coder schedule extend` from the CLI, and `PUT /extend` from a script
with a user token.
- **Keep coding agents running:** template examples for Claude Code and
Herdr. A `coder_script` uses the owner's build session token once to
mint a token scoped to `workspace:read` + `workspace:update` and
allow-listed to the workspace. It also installs a `coder-keepalive`
helper. Claude Code calls the helper from `managed_settings` hooks, and
Herdr calls it from a `post_start_script` loop. Neither needs a module
change. Matching README examples: coder/registry#1262.

This deliberately avoids app status / AgentAPI reporting.

<details>
<summary>Validation</summary>

On a local v2.38.8 deployment, I used three Docker workspaces with no
IDE, SSH, or terminal connection. Autostop was 2m, and Claude Code went
through dogfood's AI Gateway running about 30 sequential tool calls over
about 11 minutes. The template used the snippets from this page
verbatim, with the unmodified modules from registry `main`.

| Workspace | Result |
| --- | --- |
| Control (no keep-alive) | Stopped about 1 minute after its deadline
while Claude worked |
| Claude Code hooks | Deadline moved to now + 1h at 13:32, and again at
13:43. No changes after Claude finished |
| Herdr loop | Deadline moved to now + 1h at 13:32. No changes after the
agent went idle |

The scoped token from inside the workspace: `PUT /extend` returns 200.
Stopping or deleting the workspace returns 403. Other workspaces,
`/users/me`, and token creation return 404. A full `GET
/workspaces/{id}` is forbidden with the allow list, which is why the
helper uses `?include_related=latest_build`.

</details>

---

🤖 Generated with Coder Agents using Claude.
2026-11-19 07:46:47 -06:00
Molly Fraser 7f245d8296 chore!: remove legacy AI Gateway metric aliases (#32381)
Removes the deprecated `coder_aibridged_*` and `coder_aibridgeproxyd_*`
Prometheus metric aliases, which were scheduled for removal in v2.37.
The embedded AI Gateway and AI Gateway Proxy now emit only
`coder_ai_gateway_*` and `coder_ai_gateway_proxy_*`.

- Replace `NewMetricAliasRegisterer` with
`prometheus.WrapRegistererWithPrefix` in `cli/server.go` and
`enterprise/cli/aibridgeproxyd.go`.
- Delete `coderd/prometheusmetrics/metricalias.go` and its test (no
remaining callers).
- Drop alias support from the metrics docs scanner.
- Update the AI Gateway monitoring and rebranding migration docs: legacy
names are removed as of v2.40.

**Breaking:** dashboards and alerts that still use the legacy names stop
matching. The monitoring docs show a temporary `metric_relabel_configs`
bridge.

Closes AIGOV-447.

<details>
<summary>Implementation plan</summary>

| File | Change |
|---|---|
| `cli/server.go` | Remove the `TODO(deprecation)` comment; register
embedded gateway metrics with
`prometheus.WrapRegistererWithPrefix(aibridgemetrics.PrometheusMetricPrefix,
...)`. |
| `enterprise/cli/aibridgeproxyd.go` | Same swap with the
`coder_ai_gateway_proxy_` prefix; drop the unused `prometheusmetrics`
import. |
| `coderd/prometheusmetrics/metricalias.go`, `metricalias_test.go` |
Delete; the two call sites above were the only callers. |
| `scripts/metricsdocgen/scanner/prefix.go` | Remove
`NewMetricAliasRegisterer` from `prefixFuncs`. |
| `scripts/metricsdocgen/scanner/scanner_test.go` | Remove the alias
fixture and the legacy-alias assertion; the remaining literal-prefix
case already covers plain `WrapRegistererWithPrefix`. |
| `scripts/metricsdocgen/README.md` | Drop the
`NewMetricAliasRegisterer` mention. |
| `docs/ai-governance/ai-gateway/monitoring.md` | State that legacy
names are no longer emitted as of v2.40; reword the relabel snippet as a
temporary bridge and explain its cost. |
| `docs/ai-governance/ai-gateway/rebranding-migration.md` | Mark metrics
as "No (removed in v2.40)"; rewrite the Metrics section; remove the
now-obsolete "dropping the old names" section. |

Release note: the `!` title applies `release/breaking`, so the change is
listed under breaking changes in the v2.40 release notes.

Verification: `make gen` (no metrics reference changes), `make lint`,
`pnpm run format-docs`, `pnpm run lint-docs`, doc-check and test-audit
self-review, and targeted tests for `enterprise/cli` (AI Gateway /
proxy), `cli` (AI Gateway), `scripts/metricsdocgen`, and
`coderd/prometheusmetrics`.

</details>

Code written by @mollymaefraser, with Coder Agents used as a guide.
2026-11-19 13:24:00 +00:00
Molly Fraser a50d929128 feat(site/src): add organization filter to AI Gateway sessions list (#32260)
Adds an organization filter to the AI Gateway sessions list, using the
`organization` search key added in #32057. Choosing an organization adds
`organization:<name>` to the sessions query, so the list shows sessions
with at least one interception attributed to that organization. The
filter is a new `OrganizationFilter` in `pages/AIBridgePage/filters/`,
shaped like the provider, client and model filters, with options from
the shared `getOrganizationFilterOptions` helper (the same source as the
Connection Logs and Audit filters). The shared
`useOrganizationsFilterMenu` it first reused was removed in #32367. It
is shown only when `useDashboard().showOrganizations` is true, so
single-organization deployments see no change. The AI Gateway audit docs
mention the new filter.

Refs AIGOV-754. Stacked on #32057.

## Open questions for reviewers

- **Permission behind the org list:** the menu lists only organizations
where the user can read **audit logs** (`organizationCheck` in
`filters/OrganizationFilter.tsx`), not AI Gateway interceptions. Owners
and auditors, who can see this page today, have both. A custom role that
can see sessions but not audit logs would get an empty list. Connection
Logs has the same behavior. Is this acceptable, or should it check AI
Gateway interceptions instead (a one-line change)?
- **#31040 (Tracy):** that draft reworks this filter bar and already has
an Organization option. This PR adds the filter to the current bar; if
#31040 lands first, this moves into it.

## Notes for reviewers

- **Tests:** `ListSessionsPage.test.tsx` checks that picking an
organization sends `organization:<name>` in the request. The
`WithOrganizations` story shows the opened menu, and `Default` shows the
bar without it. Hiding the filter on single-org deployments has no
Vitest test, because FE1 does not allow presence assertions. It is the
same one-line `showOrganizations` check as Connection Logs.
- The filter starts at "All organizations", not the default
organization.
- The cost shown for a session is the whole session's cost, even with
the filter on, as agreed for AIGOV-754.

<details>
<summary>Decisions and plan</summary>

- **Scope (call with Sas and Susana, 13 Nov):** filter only, no
Organization column. No backend change for cost: show the whole
session's cost, not per org. Org logic is per page.
- **Approach:** build on the current filter bar rather than wait for
#31040, which is a draft and conflicts with `main`. Follow the
Connection Logs pattern (`ConnectionLogPage.tsx`,
`ConnectionLogFilter.tsx`).
- **Stack:** #32057 (backend) → this PR (list filter) → follow-up PR for
the organization row on the session detail page
(`SessionSummaryTable.tsx`).
- **Single-org:** no UI change on single-org deployments.
- **Checks run:** `pnpm lint:types`, Biome, the `ListSessionsPage`
Vitest suite, `frontend-review` (FE1 to FE10), `frontend-deep-review`
(all findings fixed), and doc-check on `audit.md` (no blocking
findings).

</details>

---

Code written by @mollymaefraser, with Coder Agents used as a guide:
explaining the existing code path, reviewing each step, running tests
and reviews, and writing parts of the test setup.
2026-11-19 12:11:46 +00:00
christin 4ae3039186 fix(site/src/components/Link): hide the external link icon on internal links (#32045)
The shared `Link` component showed its external link icon by default, so
same-tab internal links (for example "Activity Audit", "License
Consumption" and "Go to workspaces") looked external.

When `showExternalIcon` is unset, `Link` now shows the icon only when
the link opens in a new tab (`target="_blank"`) or its `href` points to
another `http(s)` origin. With `asChild`, it reads `href` and `target`
from the child and falls back to its own props, matching how Slot merges
them; a `RouterLink` has only `to`, so it counts as internal. An
explicit `showExternalIcon` still overrides the default, so existing
`showExternalIcon={false}` call sites are unchanged. Docs links built
with `docs()` resolve to `https://coder.com/docs`, so they keep the
icon.

The origin check uses `new URL` in a `try`/`catch` rather than
`URL.parse`, which Chrome 111 and Safari 16.4 in `browserslist` lack.

The `InlineUsage` story renders links without `href`, so its Pixel
baseline loses the icon. New stories: `Internal`, `InternalRouterLink`,
`ExternalSameTab`.

Closes
[DEQ-608](https://linear.app/codercom/issue/DEQ-608/hide-the-external-link-icon-on-internal-links)

| Before | After |
|---|---|
|
![before](https://raw.githubusercontent.com/coder/coder/assets/deq-608-internal-link-icon/pr/before.png)
|
![after](https://raw.githubusercontent.com/coder/coder/assets/deq-608-internal-link-icon/pr/after.png)
|

`/deployment/overview`, "How we calculate engaged users" expanded,
captured from the dev server.

<details>
<summary>Decision log</summary>

- Changed the `Link` default instead of adding
`showExternalIcon={false}` at each call site, so every internal link is
fixed, including ones the ticket did not list.
- With `asChild`, child `href`/`target` take precedence over `Link`'s
own, mirroring Radix Slot's prop merge. A child that builds its anchor
internally, or a `RouterLink` with an absolute external `to`, counts as
internal; such callers can pass `showExternalIcon` explicitly. No
current caller does this.
- Same-origin absolute URLs (for example notification links back into
the deployment) count as internal.
- Checks run: `pnpm test` for `Link` and its consumers (Markdown,
HelpPopover, notifications, Filter, TemplateBuilder), `pnpm lint:types`,
Biome, `make pre-commit`, and the frontend-deep-review skill (all
findings fixed).

</details>

---

_Generated by Coder Agents on behalf of @chrifro._
2026-11-19 11:29:34 +01:00
Andrew Aquino 964ceed5f3 fix(site): convey selected and current state to screen readers (#32020)
> [!NOTE]
> 🤖 Generated by Coder Agents on behalf of @aqandrew.

Fixes the Deque `state-selected-missing-incorrect` findings (WCAG
4.1.2): screen readers either heard the wrong row as selected, or didn't
hear the selected or current state at all.

**Listboxes.** cmdk sets `aria-selected` on whichever row is highlighted
and ignores the prop. So when focus landed on a picker, the first row
was announced as "selected" and the row with the check mark wasn't. A
small pnpm patch to cmdk 1.1.1 (`site/patches/cmdk@1.1.1.patch`) does
two things:

- An Item's `aria-selected` prop now wins over cmdk's value.
- cmdk now finds the highlighted row by `data-selected`, which still
tracks the highlight, instead of `aria-selected`.

Each picker that shows a check mark now passes its chosen state:
`ComboboxItem` (all `SelectFilter` filters), `Autocomplete`,
`OrganizationAutocomplete`, `ModelSelector`, the Agents org, project,
and workspace pickers, and the org switcher. In `FilterCombobox`, rows
report whether their value is applied (default `false`), its lists are
`aria-multiselectable`, and the flyout's value buttons get
`aria-pressed`. Menus that pass nothing keep cmdk's behavior, where the
highlighted row is selected.

**Workspace page.** The workspace breadcrumb gets `aria-current="page"`.
The Resources and History sidebar buttons, which open and close their
panels, get `aria-pressed`. The selected resource gets `aria-current`.

Closes DEQ-32, Closes DEQ-91, Closes DEQ-162, Closes DEQ-195, Closes
DEQ-221, Closes DEQ-278, Closes DEQ-363, Closes DEQ-395, Closes DEQ-409,
Closes DEQ-559

| Ticket | Surface |
|---|---|
| DEQ-32 | Agents: Attach workspace picker, model selector |
| DEQ-91 | Template builder: Organization picker |
| DEQ-162 | Workspace page: breadcrumb, Resources/History toggles,
resource list |
| DEQ-195 | Workspace sharing: user/group search |
| DEQ-221 | AI Gateway sessions: user and provider filters |
| DEQ-278 | Templates: user filter |
| DEQ-363 | Audit log: resource type, action, user, organization filters
|
| DEQ-395 | Users: status filter |
| DEQ-409 | Create user: Organization picker |
| DEQ-559 | Workspaces: filter menu (`FilterCombobox`) |

There are no visual changes, so there are no screenshots. I ran axe-core
4.11 on the affected open-menu stories on both `main` and this branch.
It reported no new violations; the existing `aria-dialog-name`,
`nested-interactive`, and `aria-required-children` results show up on
`main` too. The listbox dumps match the fix. In
`CompactProjectSelector/Open` on `main`, the highlighted first row is
`aria-selected` and the chosen project isn't. On this branch, only the
chosen project is.

DEQ-572 (template builder stepper) was already fixed on `main` by
#31854, so this PR doesn't touch it.

<details>
<summary>Decisions, dropped review findings, and follow-ups</summary>

**Why a patch.** I looked at two ways to avoid it.

- Rendering the Item `asChild` so the child's `aria-selected` wins broke
keyboard navigation. cmdk finds the highlighted row with
`[aria-selected="true"]`, so Enter and the arrow keys stopped working
once a chosen row stopped matching the highlighted one. The patch moves
that lookup to `data-selected`.
- `aria-checked` on options would leave cmdk's wrong
`aria-selected="true"` on the highlighted row.

Remove the patch once cmdk ships a release that keeps the two states
separate.

**Role choices on the workspace page.**
- Sidebar icon buttons get `aria-pressed`. Clicking the active one
closes its panel, so they are toggles; they don't navigate anywhere.
- Resource rows get `aria-current`. Clicking one selects it and never
deselects it, so it is the current item in a set.

**Self-review.** I ran `frontend-review`, `frontend-deep-review` (all 8
roles), and `frontend-accessibility`, and fixed every blocking and
should-fix finding. One fix: the Create Organization row now has
`aria-selected={false}`, so a highlighted Create Organization row isn't
announced as the selected org.

Dropped findings:
- *Use the input's `aria-activedescendant` instead of `data-selected` to
find the highlight in `FilterCombobox` tests.* I tried it. cmdk leaves
the input's `aria-activedescendant` null in two existing Retry tests
even though a row is highlighted. That's a separate cmdk timing issue,
so the tests keep using `data-selected`, the attribute cmdk documents
for the highlighted item.
- *Only mark `FilterCombobox` lists `aria-multiselectable` when they
hold value rows (nit).* I left it on the shared list: every list in this
component can apply several values at once.

Follow-ups, out of scope here:
- Inline-search `Autocomplete`, used only by `ModelIdentifierField`,
sets `aria-activedescendant` and `aria-controls` to ids that cmdk
overwrites, so the highlight was never announced there. This predates
the PR.
- `MultiSelectCombobox` passes no chosen state, so cmdk still marks its
highlighted row as selected. Its picked options leave the list, and
Deque didn't report it.
- `.claude/docs/FRONTEND_PATTERNS.md` says cmdk overwrites
`aria-selected`. With this patch that's no longer true for Items. That
file is outside `site/`, so it's left for a separate change.

**Checks.** `pnpm test` (whole unit suite), `vitest --project=storybook`
(whole suite; one unrelated loading story failed once and passed on
rerun), `pnpm check`, `pnpm lint`, and `pnpm format`.
</details>
2026-11-19 11:18:45 +01:00
christinandJeremy Ruppel d8b78b2dd0 fix(site/src): raise light theme warning text and icon contrast (#32047)
In the light theme, warning text and warning icons both used
`--content-warning`, which was orange-400 (`#FB923C`). That is 2.26:1 on
white and 2.06:1 on `--surface-secondary`, so warning text failed WCAG
1.4.3 (4.5:1) and warning icons failed WCAG 1.4.11 (3:1). One example is
the navbar proxy latency from DEQ-517, which was audited at 2.00:1.

This PR splits warning text and warning graphics into two light-theme
tokens:

| Token | Used for | Before | After | On white / secondary / orange
surface |
|---|---|---|---|---|
| `--content-warning` | text | orange-400 | **orange-700** `17 88% 40%`
| 5.31 / 4.83 / 4.63 (needs 4.5) |
| `--border-warning` | icons, status dots, borders | orange-300 |
**orange-600** `21 90% 48%` | 3.56 / 3.24 / 3.11 (needs 3) |

- **Graphics now use `border-warning`:** standalone warning icons,
warning icons inside badges, the `StatusIndicator` dot, the `Alert` and
toast icons, build and app status icons, the Health page dots and icons,
the AI spend warning badge on the user menu, the orphan checkbox in the
workspace delete dialog, and the left accent borders. Warning text stays
on `content-warning`.
- **Warning badges use the standard tokens:** the shared `Badge` warning
variant used `--highlight-orange` (`#A35200`) for text and border. It
now uses `content-warning` for text and `border-warning` for the border
and icon, the same as other warning text and graphics.
- **New `"icon"` type in `getLatencyColor`:** the navbar signal icon
uses it, so the icon is orange-600 and the latency text is orange-700.
- **`SpendAmount` icon no longer dimmed:** the unpriced-usage icon used
to be dimmed to 75% opacity until hover. It is now always fully visible,
so it can use `border-warning` and still meet 3:1.
- **Bug fixes:**
- The DERP region latency dot used `bg-content-yellow`, a class that
doesn't exist, so it rendered without a color. It now uses
`bg-border-warning`.
- The warning ring around the chat input and around a message being
edited built its color with `hsla(var(--border-warning),0.6)`. That only
works with the comma syntax the token used to have, and was already
broken in the color-blind themes. Both now use a new
`--shadow-border-warning` theme variable (`color-mix()` based) through
`shadow-(--shadow-border-warning)`, which renders in the light, dark,
and color-blind themes.
- **Unchanged themes:** the dark theme and the four color-blind themes
keep their values. In dark mode the two tokens are effectively the same
color, so moving graphics to `border-warning` causes no visible change
there.
- **New tests:** `theme/cssVariables.test.ts` checks every theme for
`--content-warning` at 4.5:1 and `--border-warning` at 3:1 on the
primary, secondary, and orange surfaces. On the old light values, only
the light cases fail.

**This is the best way to meet the contrast requirements while keeping
warnings orange.** Orange-500 would fail 3:1 for icons (2.79:1 on
white), and lighter oranges fail 4.5:1 for text.

**Known trade-off: warning and error now look more alike.** Darkening
the text brings it close to `--content-destructive` red. For example, in
the region dropdown, a warning latency and an error latency differ only
by text color, and the two are now hard to tell apart. The design relies
on font color alone to show the state, so it can't be solved with color
tokens. The design team will fix it in
[DES-22267](https://linear.app/codercom/issue/DES-22267/distinguish-region-dropdown-warnings-and-errors-beyond-color).

### Screenshots (light theme, Storybook)

| | Before (`main`) | After |
|---|---|---|
| Region dropdown (`ProxyMenu/Opened`) | ![Region dropdown before,
latency in pale
orange](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v2/before-proxy-menu.png)
| ![Region dropdown after, latency text in
orange-700](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v2/after-proxy-menu.png)
|
| `StatusIndicator/Warning` | ![Warning status
before](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v2/before-status-indicator.png)
| ![Warning status after, orange-700 label and orange-600
dot](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v2/after-status-indicator.png)
|
| `Alert/Warning` icon | ![Warning alert
before](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v2/before-alert.png)
| ![Warning alert after, orange-600
icon](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v2/after-alert.png)
|
| Warning border (`Alert/WarningProminent`) | ![Prominent warning alert
before, pale orange-300
border](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v3/before-alert-border.png)
| ![Prominent warning alert after, orange-600
border](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v3/after-alert-border.png)
|
| `AppLink/HealthUnhealthy` | ![Unhealthy app icon
before](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v2/before-app-link.png)
| ![Unhealthy app icon after,
orange-600](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v2/after-app-link.png)
|
| `Badge/Warning` | ![Warning badge before, amber-brown text and
icon](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v4/before-badge-warning.png)
| ![Warning badge after, orange-700 text and orange-600 icon and
border](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v4/after-badge-warning.png)
|
| "Cost setup" badge and spend icons (`SpendUsersTable/UnpricedUsage`) |
![Spend table before, amber-brown badge and dimmed pale
icons](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v4/before-cost-setup-badge.png)
| ![Spend table after, orange-700 badge text and orange-600
icons](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v4/after-cost-setup-badge.png)
|
| User menu AI spend warning (`UserDropdown/AISpendWarning`) | ![User
menu warning badge before, amber-brown
icon](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v4/before-user-menu-badge.png)
| ![User menu warning badge after, orange-600
icon](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v4/after-user-menu-badge.png)
|
| "Blocked" badge (`NetworkCallsTable/BlockedBadge`) | ![Blocked badge
before](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v3/before-blocked-badge.png)
| ![Blocked badge after, orange-600 icon and orange-700
count](https://raw.githubusercontent.com/coder/coder/assets/light-warning-contrast/pr/v3/after-blocked-badge.png)
|

Text changes from `rgb(251, 146, 60)` to `rgb(192, 63, 12)`, and icons,
dots, and borders to `rgb(233, 89, 12)`.

### Known design follow-ups
Design is aware of these. They are out of scope for this PR and will be
handled from the design side.

1. **Warning and error states that differ only by color**, such as the
region dropdown (see the trade-off above).
[DES-22267](https://linear.app/codercom/issue/DES-22267/distinguish-region-dropdown-warnings-and-errors-beyond-color)
tracks it.
2. **Error red on `--surface-secondary` is 4.39:1, under 4.5:1.** For
example, a critical latency in the highlighted row of the region
dropdown fails 4.5:1.
3. **Some warning graphics stay orange-700 because orange-600 fails 3:1
on their background.** They keep `content-warning`, which passes there
(4.18 to 4.40:1):
- **AI spend usage bars** (`UsageBar`) in the user menu's AI spend
section and the Agents usage popover, plus the **usage ring** next to
the Agents chat input and in the sidebar footer: the warning fill sits
on a grey `surface-tertiary` track, where orange-600 is 2.81:1.
- **Parameter warning boxes** (`DynamicParameter` diagnostics) on the
create-workspace and template embed pages: the icon sits on a 15%
warning tint, where orange-600 is 2.85:1.
- **Chat status icons** for interrupting, requires action, and paused in
the Agents sidebar: on the currently open chat's row
(`surface-quaternary/50`), orange-600 is 2.80 to 2.95:1.
- **Agents attachment warning icons** (failed or expired attachment
tiles and the upload-error overlay): they sit on `surface-tertiary` or
`bg-overlay`, where orange-600 is 2.6 to 2.8:1.
- **"Blocked" count badge** on the AI Bridge sessions list
(`NetworkCallBadges`): it sits on `surface-tertiary`. Its count text is
only 4.18:1 there, so the text still fails 4.5:1.
4. **Warning borders are much stronger.** The 17 `border-border-warning`
uses, such as prominent warning alerts (see screenshot) and the chat
input warning ring, change from orange-300 to orange-600.
5. **Light color-blind themes change too.** Their `--border-warning`
(`322 81% 60%`) is lighter than their `--content-warning`, so icons
moved to `border-warning` look lighter there. They still pass 3:1 (3.15
to 3.46).
6. **Decorative uses become darker.** The `devel` prerelease navbar
stripe and the success-to-warning usage bar in Template Insights mix in
`--content-warning`, so they become darker and browner.

Closes DEQ-517

<details>
<summary>Decision log</summary>

- **Fix the shared tokens, not the latency component:** the failing
color was shared by every light-theme warning, so patching only the
latency component would leave the rest failing.
- **Separate text and graphics:** text needs 4.5:1 and graphics need
3:1, so one token can't be both readable as text and visibly orange as
an icon. Other systems, such as Atlassian, also split text and icon
warning tokens.
- **Reuse `--border-warning` for graphics:** it already colored some
warning icons (`WorkspaceNotifications`, the license cards), and reusing
it avoids a new token. `--highlight-orange` (`#A35200`) is too dark and
brown to read as the icon orange.
- **Choose orange-600 for graphics:** it is the lightest orange that
meets 3:1 on white, `surface-secondary`, and `surface-orange`.
Orange-500 is 2.79:1.
- **Choose orange-700 for text:** design chose it. Atlassian `#A54800`
and yellow-800 `#854D0E` were also considered. They sit further from red
but move away from orange.
- **Color badge icons with `[&_svg]:text-border-warning`:** this keeps
the badge text on `content-warning` and colors only the icon.
`--highlight-orange` - **`shadow-(--shadow-border-warning)`, not
`shadow-border-warning`:** both use the shared `--shadow-border-warning`
theme variable, per review. The named `shadow-border-warning` utility is
not used because `cn()` (tailwind-merge) does not treat it as
conflicting with the `shadow-xs` already on both elements, so
`shadow-xs` won and the ring disappeared. tailwind-merge does treat
`shadow-(--var)` as a box shadow.rge does dedupe an arbitrary
`shadow-[...]` value.
- **Self-review:** frontend-deep-review (eight roles) and an
accessibility pass ran on both revisions. The second pass found the
broken `hsla()` shadow and the four 3:1 failures on tinted or tertiary
backgrounds; all are fixed or kept on `content-warning`, as listed
above. No blocking or should-fix findings remain.

</details>

🤖 Generated by Coder Agents on behalf of @chrifro.

---------

Co-authored-by: Jeremy Ruppel <jeremy.ruppel@gmail.com>
2026-11-19 11:06:36 +01:00
Molly Fraser 4bccdc4ed6 feat: show and filter by organization in AI Gateway sessions API (#32057)
Adds an `organization` filter to `GET /api/v2/ai-gateway/sessions` (and
its `/api/v2/aibridge/sessions` alias) and returns the organization an
interception was attributed to, and how it was chosen, on sessions,
threads and agentic actions, as proposed in the surface definitions on
AIGOV-754. No migration: `aibridge_interceptions.organization_id` and
`organization_source` already exist (000634).

The filter accepts an organization name or ID and keeps sessions with at
least one interception in that organization; the count uses the same
rule so pagination totals match. Each session, on the list and detail
responses, lists the organizations its interceptions were attributed to,
ordered by name, with the distinct sources used for each, or `[]` when
none was stored. Each thread carries the organization of its root
interception and each agentic action carries its own, or null when none
was stored. The new filter is listed in the AI Gateway monitoring docs.

Refs AIGOV-754

## Open questions for reviewers

- **Multi-org sessions** (AIGOV-776): the filter is row-level, like
provider and model. A session spanning two orgs is listed under each
org's filter, and with the filter on, `threads`, `started_at` and
`ended_at` only cover the matching interceptions, while providers,
models, tokens and `organizations` cover the whole session. Is that the
desired behavior?
- **Unknown org ID:** an unknown org name returns 400, but an unknown
org ID returns an empty page, because `parseOrganization` does not look
up UUIDs. This matches workspaces and templates, but the spec says 400.

## Notes for reviewers
- `aiBridgeSessionOrganizations` returns an empty list if the
organizations JSON from the query can’t be decoded, rather than failing
the whole request. The field is supplementary, so a decoding problem
shouldn’t take down the sessions list, but it does mean a SQL bug here
would show up as empty data rather than an error. The alternative is to
log the error before returning the empty list.
- A thread’s organization is taken from its root interception only. If
later requests in the same thread were attributed to a different
organization, that shows on each agentic action’s own organization
field.

<details>
<summary>Implementation notes</summary>

- `coderd/database/queries/aibridge.sql`:
- `@organization_id` filter in `CountAIBridgeSessions` and the
`session_page` CTE of `ListAIBridgeSessions`.
- New `sorg` lateral in `ListAIBridgeSessions` that groups the session's
interceptions by organization, collects distinct sources, joins
`organizations` (deleted orgs still resolve) and returns a JSON array.
- `ListAIBridgeSessionThreads` resolves the organization name, display
name and icon through a `LEFT JOIN LATERAL` in the final `SELECT`. A
plain join on `organizations` is not safe there: the query has two
`@authorize_filter` placeholders, and the injected filter can reference
a bare `id`, which would be ambiguous next to `organizations.id`. The
lateral only exposes the three selected columns. This answers the
authorize-filter open question from the surface proposal.
- `coderd/database/modelqueries.go`: the hand-written
`ListAuthorizedAIBridgeSessions`, `CountAuthorizedAIBridgeSessions` and
`ListAuthorizedAIBridgeSessionThreads` gain the new argument and scan
columns. The compiler does not catch a mismatch here; it fails at
runtime.
- `enterprise/coderd/aibridge.go`: pass `OrganizationID` into
`CountAIBridgeSessionsParams`, which is built field by field, and list
the `organization` key in `@Param q`.
- `coderd/searchquery/search.go`: `organization` key via
`parseOrganization`.
- `codersdk/aibridge.go`: `AIBridgeInterceptionOrganizationSource` enum,
`AIBridgeInterceptionOrganization`, `AIBridgeSessionOrganization`, new
response fields and `AIBridgeListSessionsFilter.Organization`, per the
proposed Go definitions.
- `coderd/database/db2sdk/db2sdk.go`: decode the session organizations
JSON, never returning nil; `AIBridgeInterceptionOrganizationSource`
converter; build one organization per interception while grouping thread
rows, and use it for the thread (root interception) and each agentic
action.
- `site/`: add `organizations: []` to two frontend mocks, now that the
field is required in the generated types.
- `docs/ai-governance/ai-gateway/monitoring.md`: `organization` added to
the sessions API query filters.
- Tests: `TestAIBridgeSessions` (name and ID parsing),
`TestAIBridgeListSessions/Filters` (by name and ID, checks count and
page), `FilterErrors/UnknownOrganization`,
`TestAIBridgeListSessions/Organizations` (multi-org ordering and
sources, no-org session returns `[]`, filtering by either org returns
the multi-org session and never the no-org one),
`TestAIBridgeGetSessionThreads/Organizations` (thread uses the root's
org, each action its own, null when none, session `organizations` on the
detail endpoint), and `TestAIBridgeInterceptionOrganizationSource`
(every database source maps to an SDK value).
- Remaining files are generated by `make gen`.

</details>

---

Code written by @mollymaefraser, with Coder Agents used as a guide:
explaining the existing code path, reviewing each step, and running
tests.
2026-11-19 09:07:56 +00:00
Andrew Aquino 3fc801a03a fix(site/src): add navigation semantics to pagination and deployment banner (#32354)
Adds navigation semantics to two groups of links that Deque flagged
under `semantic-nav` (WCAG 1.3.1).

- `PaginationWidgetBase` now renders `<nav aria-label="Pagination">`
with a `<ul>`, and each page button sits in its own `<li>`. The
narrow/wide toggle moved from `display: contents` wrappers onto the
`li`s.
- `DeploymentBannerView` is now a `<section aria-label="Deployment
stats">` region. The workspace status links sit in a `<nav>` labelled by
the visible "Workspaces" text, as a `<ul>` with one `<li>` per status.
The `/` separators are `aria-hidden`.

Closes DEQ-145
Closes DEQ-487

| Ticket | UI surface | Visible change |
|---|---|---|
| DEQ-145 | Pagination on every paginated list (Audit Logs, Workspaces,
Users, and others) | None |
| DEQ-487 | Deployment banner at the bottom of the dashboard (admins
only) | None |

I captured Storybook screenshots before and after
(`PaginationWidgetBase` wide and narrow,
`DeploymentBannerView/Example`). They are byte-identical, so none are
attached. Running axe-core 4.11 on those stories reported no violations
on either base or branch.

<details>
<summary>Grouping, decisions, and dropped findings</summary>

- **Grouping:** two tickets, one PR. Both are the same rule and both
fixes are markup-only (163 non-test lines).
- **No new tests:** at first I added Vitest assertions for the nav,
list, and listitem roles. `frontend-deep-review` (TS2/TS5) flagged them
under FE1 because they assert DOM structure, not a behavior outcome, so
I removed them. The existing behavior tests still pass unchanged.
- **Dropped finding:** the shared `PaginationWidgetBase` always uses the
name "Pagination", and two widgets on one page would produce duplicate
landmark names. No page renders more than one, so I did not add a label
prop.
- **Pre-existing, not in scope:** the banner's workspace status links
get their accessible name only from the count, with the status in a
tooltip description. I left this for a separate ticket.
</details>

🤖 Generated by Coder Agents on behalf of @aqandrew.
2026-11-18 21:15:54 -08:00
Andrew Aquino 130ff0d2da fix(site/src/pages/TemplateBuilder): address remaining WCAG audit follow-ups (#32281)
Fixes the accessibility findings from the
[CLIENT-570](https://linear.app/codercom/issue/CLIENT-570) audit of
`/templates/new/builder` that were still open on `main`.

| # | Finding | Change |
|---|---|---|
| 1, 14 | Card description and official badge hidden from assistive tech
| The radio or checkbox has `aria-describedby` set to the description,
and the badge gets `sr-only` " (official)" text. |
| 2 | Duplicate "View details" link text | `sr-only` " for {name}" after
the visible text, as Tracy suggested in the ticket, so the accessible
name extends the visible label. |
| 5 | Module grid has no group label | The grid is a `role="group"`
labelled by the step `h2`. |
| 6 | Focus stays put on step change | New `useStepHeadingFocus` focuses
the new step's `h2` (`tabIndex={-1}`) on every step change, including
browser back/forward. If the step is still loading, focus moves once the
heading mounts. Page load keeps the browser's default focus. |
| 7 | No live region | The selection summary has an `sr-only`
`role="status"` with the base template and module count. |
| 8 | Filter counts read as raw parentheses | Filters read "IDE (2
modules)": the visible text plus `sr-only` " modules". |
| 10 | Search field has only a placeholder | `aria-label="Search
modules"`. |
| 11 | Sidebar is not a landmark | `SelectionSummary` renders an
`<aside>` labelled by its "Selection" heading. |
| 13 | `cursor-pointer` and `onClick` on a card `div` | Removed. The
card name is a `<label htmlFor>` for the control, and its `::after`
stretches over the card, so clicking anywhere selects natively. Controls
sit above the overlay (`z-10` inside an `isolate` card), and "View
details" stays clickable. |

The only visible change is the cursor: it is now a pointer over the
whole card through the label. Everything else is screen-reader-only text
or ARIA. I checked in Storybook that clicking a card's description
selects it, clicking "View details" opens the registry without
selecting, and the radio still gets its hover style. axe-core 4.11
reports no violations on the TemplateCard, ModuleCard, ModuleSelectStep,
SelectionSummary and TemplateBuilderPageView stories in either theme.
The only exception is a `link-in-text-block` on the page header's
existing "View docs" link, which this PR doesn't touch.

I skipped `rel="noopener noreferrer"` from finding 2. Browsers already
treat `target="_blank"` as `noopener`, most `target="_blank"` links in
`site/` set no `rel`, and `noreferrer` would hide the referrer from our
own registry.

<details>
<summary>Decision log and review notes</summary>

**Status of every CLIENT-570 item on `main` before this PR:** 3 and 4
were fixed by #31865 (real Radix radio group) and #30540 (shared
`Checkbox`). 9 was fixed by #31567 (focus ring is `content-link`; the
selected border is 3.56:1 or more against the unselected border). 12 was
fixed by #26223 (`Avatar` defaults to `alt=""`). 15 was fixed by #32017
and #32136. This PR covers everything else.

**Focus approach:** the first version queried `h2` in the step container
from a page-view effect. Review showed it dropped focus when a step was
still showing its loader, so `TemplateBuilderTitle` now receives a ref
callback through a private context. A pending flag carries a focus
request across a loader. The new page-view test resolves the modules
request only after Continue is clicked. It fails if the ref-callback
path is removed.

**Filter label:** an `aria-label` ("IDE, 2 modules") was tried first. It
was replaced with `sr-only` text so the accessible name contains the
visible label (2.5.3).

**Self-review findings dropped, with reasons:**
- `aside` inside `main` would trip
`landmark-complementary-is-top-level`: axe-core 4.11 exempts
complementary landmarks inside `main` (`landmarkIsTopLevelEvaluate`).
- Use the shared `Label` primitive for the card name: its base `text-sm
font-medium leading-none` would override the `h3` typography, and plain
`<label htmlFor>` is common in `pages/`.
- Heading could take focus from a user who moved focus while a step was
loading (nit): left as is. The heading only waits while the modules
query loads, and that query is already prefetched once a base is
selected.
- Pre-existing presence checks in the `ModuleSelectStep` story `play`
functions (nit): only the name regexes changed, so they are left for a
separate cleanup.

**Checks run:** `pnpm test src/pages/TemplateBuilder` (79 passed),
Storybook tests for `src/pages/TemplateBuilder` (54 passed), `pnpm
check`, `pnpm lint` (includes types, circular deps and the React
Compiler check), and `pnpm format`. I broke each new test's behavior in
turn (removed `htmlFor`, `aria-describedby`, the `sr-only` link text,
the status text, and the ref-callback focus) and confirmed that test
fails.

</details>

🤖 Generated by Coder Agents on behalf of @aqandrew.
2026-11-18 21:12:37 -08:00
Jon Ayers 284b0af2f7 ci: update release workflow (#32418) 2026-11-18 19:37:52 -06:00
Jake Howell c8d29a1ce3 refactor(site): migrate the connection logs filter to use new combobox variant (#32367)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell.

Migrates the connection logs filter to use the newer variant on the
Connection Logs page.

<img width="865" height="486" alt="image"
src="https://github.com/user-attachments/assets/dee5f2da-7627-40e9-a468-a305048a1982"
/>
2026-11-19 12:35:41 +11:00
Jake Howell b4f0e3b131 refactor(site): migrate the group members filter to use new combobox variant (#32365)
Migrates the member filter to use the newer variant on the Groups
Members page.

<img width="762" height="346" alt="image"
src="https://github.com/user-attachments/assets/07522eec-4bc3-4d51-9ac7-e0475172af1e"
/>
2026-11-19 11:35:11 +11:00
TJ 72a36f2c50 feat(site): clarify that chat costs are estimates (#32415)
Removes any odd cost message that appears below the $. Adds an icon with
a tooltip next to chat cost in the chat summary panel and the project
chats list, so users know the figure is provisional while agents run
(DES-22256). Also provides context if model costs aren't configured
correctly.

- Info icon: "Estimated. Updates in increments and may lag slightly."
- Warning icon, when some requests have no configured pricing: "3
requests used a model without configured pricing, so cost may be
underreported." This replaces the "Excludes unpriced usage from N
requests" line under the cost in the summary panel.

In the project chats list, the cost badge and PR icon move out of the
row link, because the tooltip trigger is a button and can't sit inside
an anchor. The rest of the row still opens the chat.

Preview in Storybook: `ChatSummary` > Cost Estimate Tooltip / Partial
Cost Tooltip, and `ProjectChatsListView` > Populated / Partial Cost.

<details>
<summary>Decision log</summary>

- One shared `ChatCostTooltip` built on `InfoTooltip`, used in both
places. The warning variant replaces the info variant rather than
appearing alongside it.
- Icons use a new `xsmall` (10px) `InfoTooltip` size. Each message has a
max width (`max-w-48` for the estimate, `max-w-68` for the warning,
which stays on two lines for counts up to four digits) so it wraps into
two even lines. Text style matches other tooltips (Geist 12px/500).
- Tooltips open on `top`, matching the default and most common placement
in `AgentsPage`.
- In the list, the icon sits inside the cost badge. `Badge` gives svgs
`py-0.5` at `size-icon-xs`, which shrank the glyph and left extra space
on the right. The badge now uses `svgSize={null}` and `[&_svg]:p-0`, so
the icon renders at its own size and the padding is even on both sides.
- The amount uses `text-box: trim-both cap alphabetic` so `items-center`
centers the digits instead of the font's line box. The digits sit
0.375px below center (previously 0.625px above). Chromium snaps
baselines to whole pixels, so this is the closest it can get. Browsers
without `text-box` support render as before.
- The warning copy names a request count, not "this model", because a
chat tree's cost can span several models through subagents. The chat
overview card's own "Excludes unpriced usage" subtitle is unchanged in
this PR.
- The project list test no longer asserts that the cost text is part of
the link name, since the cost is now outside the link.

</details>

---

Generated by Coder Agents on behalf of @tracyjohnsonux.

<img width="575" height="466" alt="image"
src="https://github.com/user-attachments/assets/62be0d86-2f55-4348-a591-4e77b3bcf42d"
/>

<img width="1800" height="720" alt="image"
src="https://github.com/user-attachments/assets/970302fd-cfbb-4806-945a-1a162d4c7756"
/>

<img width="586" height="455" alt="image"
src="https://github.com/user-attachments/assets/a19f3ce9-078e-49c3-8e8d-fb7525184bb4"
/>


<img width="575" height="445" alt="image"
src="https://github.com/user-attachments/assets/ab6c1bf7-9715-4d08-a89f-35d76ec29fe6"
/>
2026-11-18 16:34:19 -08:00
christinandJeremy Ruppel c9e8f2c0c3 fix(site): keep floating content within the viewport at 320px (#31348)
At a 320px-wide viewport (1280px at 400% zoom), shared floating UI
clipped its content, failing WCAG 1.4.10 Reflow. Menus had
`overflow-hidden` and no height limit, Select had a fixed `max-h-96`,
and Popover and Tooltip had no width limit, so items and text ended up
past the viewport edge where neither scrolling nor the keyboard could
reach them.

Each primitive is now capped to the available space that Radix reports
(`--radix-popper-available-*`), and menus scroll instead of hiding
overflow:

- `DropdownMenu`/`ContextMenu` (`menuClasses.ts`): `max-w` from the
available width (the height cap and scrolling landed separately in
#32385). `min-w` is `min(12rem, available width)` so it can't override
the cap on submenus.
- `Popover`: `max-w` from the available width, so fixed widths such as
the ports popover's `w-[404px]` shrink to fit.
- `Select`: `max-h` is now `min(24rem, available height)`, plus `max-w`
from the available width.
- `Tooltip`: `max-w` from the available width, plus `wrap-break-word`.

tailwind-merge drops the base cap when a caller passes its own `max-w`,
so callers wider than 320px now use
`max-w-[min(<size>,var(--radix-popper-available-width))]`
(SessionTimeline, IdpUnseenClaimWarning, AgentLogs, UserGroupsCell,
workspace Notifications). Interactive tooltips add 8px collision
padding, so `InfoTooltip` and `AgentStatus` (`max-w-xs`) use the same
form. `MobileMenu` is full width by design, so it opts out of the width
cap with `max-w-none`. New `NarrowViewport` stories for the four
primitives run on Pixel's `phone` viewport. Each story overflows without
the fix.

Closes DEQ-588, DEQ-492, DEQ-339, DEQ-346, DEQ-6
Refs DEQ-168 (Login type select only)

## Before / after (320×256 CSS viewport)

| Surface | Before | After |
|---|---|---|
| Filters menu (DEQ-588) |
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/before-filters-menu.png?raw=true)
|
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/after-filters-menu.png?raw=true)
|
| Mobile header menu, sections expanded (DEQ-492) |
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/before-mobile-menu-expanded.png?raw=true)
|
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/after-mobile-menu-expanded.png?raw=true)
|
| Login type select (DEQ-168) |
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/before-login-type-select.png?raw=true)
|
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/after-login-type-select.png?raw=true)
|
| Footer "Deployment status" tooltip (DEQ-339) |
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/before-footer-status-tooltip.png?raw=true)
|
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/after-footer-status-tooltip.png?raw=true)
|
| Ports popover (DEQ-6, Storybook) |
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/before-ports-popover.png?raw=true)
|
![](https://github.com/coder/coder/blob/2cf3e2deec900029906cd9b864c25d124594b2f4/after-ports-popover.png?raw=true)
|

Playwright measurements of the same scenarios (the surface's bottom or
right edge against the 256px-tall, 320px-wide viewport):

| Surface | Before | After |
|---|---|---|
| Filters menu | bottom 314px | fits, scrolls |
| Mobile menu, sections expanded | bottom 518px | fits, scrolls |
| Login type select | bottom 274px | fits |
| Deployment status tooltip | right 428px | fits |
| Ports popover | right 420px | fits |

Not covered here: DEQ-125 (the toast already fits at 320px, and the
report points at the dialog overlay, so it needs a licensed repro), the
DEQ-168 organization picker (not reproduced), and the DEQ-539 sharing
form and DEQ-443 notifications inbox, whose page layouts are planned as
separate PRs.

<details>
<summary>Implementation plan and decision log</summary>

**Grouping.** Eight Deque 1.4.10 Reflow issues (DEQ-588, 539, 492, 443,
346, 339, 168, 125, 6) were grouped by root cause. Most trace to five
shared floating primitives (menus, tooltip, select, popover, toast), so
fixing those once resolves most issues. DEQ-539 (sharing form row and
table) and DEQ-443 (inbox header and rows) are page layout problems and
get separate PRs.

**Approach.** Cap every primitive to the Radix available-space CSS
variables, let text wrap, and scroll rather than clip.

**Decisions**

- Used `--radix-popper-available-*`, which the popper wrapper sets and
content inherits, so one variable works for menu, popover, and tooltip.
- Select keeps its 24rem ceiling through `min(24rem,
var(--radix-select-content-available-height, 24rem))`, so `item-aligned`
mode, where the variable is unset, still behaves as before.
- Tooltip `collisionPadding` stays at Radix's default of 0. About 25
tooltip callers pass `max-w-xs` (320px), which tailwind-merge keeps over
the base cap. With padding 0 they still fit a 320px viewport, but an 8px
padding would have pushed them over.
- Callers with an explicit `max-w` wider than 320px got the `min(...)`
form instead of a wholesale codemod.
- `MobileMenu` uses `max-w-none`. The new cap left a 15px gap on this
full-width menu.
- Reverted a toast `max-w-full` change: sonner already switches to full
width below 600px, so the toast fit before and after.
- Reverted an organization picker change from truncation to wrapping,
because the clipping could not be reproduced.

**Verification**

- Playwright at 320×256 in the dev app (`./scripts/develop.sh`), plus
Storybook for license-gated or workspace-gated surfaces. The before runs
had the changes stashed.
- Biome and `tsc` pass, and `make pre-commit` passes.
- Related Vitest suites pass. `WorkspacePage.test.tsx` fails the same
way without these changes.
- frontend-deep-review (all eight roles) was run, and its should-fix
findings (story coverage, story play cleanup, the extra callers) are
addressed.

**Review follow-up (@jeremyruppel)**

- `InfoTooltip` (with-link story) measured right edge 356px at 320px
before, 297px after.
- `min-w-48` beat the new `max-w` on submenus, where available width is
only the space beside the sub-trigger.
- `*-100` callers kept as `25rem` rather than `400px` so they still
scale with root font size.
- Not changed: tooltip height is still uncapped, so tall interactive
tooltips (prompt origin) can overflow a 256px-tall viewport when they
flip below the trigger.

</details>

---

🤖 Generated by Coder Agents on behalf of @chrifro, with review fixes on
behalf of @jeremyruppel.

---------

Co-authored-by: Jeremy Ruppel <jeremy.ruppel@gmail.com>
2026-11-18 18:28:40 -05:00
TJ b413bc7f4f fix(site/src/pages/AgentsPage/components/ProjectPage): put project chat cost beside the avatar (#32414)
Fixes DES-22270.

On the project page, each chat row ended with the cost badge followed by
the PR state icon. Chats without a PR render no icon, so their cost
badge shifted right and the list read as a misaligned table. The row now
shows the PR icon first and the cost beside the owner avatar, so cost
badges line up against the avatar column on every row.

| Before | After |
|---|---|
|
![before](https://github.com/coder/coder/blob/990c157659148acff17232cc0084c95e79497b14/before.png?raw=true)
|
![after](https://github.com/coder/coder/blob/990c157659148acff17232cc0084c95e79497b14/after.png?raw=true)
|

Verified in the `ProjectChatsListView/Populated` story: before, cost
badges ended at x=954 on rows with a PR and x=980 on rows without;
after, all end at x=980 beside the avatar, with the PR icon to their
left.

> Generated by Coder Agents on behalf of @tracyjohnsonux.
2026-11-18 15:16:59 -08:00
christin 6e02a6a39d fix(site/src/components): scroll menus that do not fit the viewport (#32385)
At 200% browser zoom, dropdown menus that held more items than fit the
viewport ran past the viewport edge, and `overflow-hidden` on the menu
content left the clipped items unreachable (WCAG 1.4.4, Resize text).
This hit the Admin settings menu, the user menu, and the Agents sidebar
filter and account menus.

The shared `menuContentClass` now caps menu height at Radix's
`--radix-popper-available-height` and scrolls vertically, so every
`DropdownMenu` and `ContextMenu` (including submenus) stays inside the
viewport. `menuMaxHeightClassName` moves from
`FilterCombobox/primitives.tsx` into `menuClasses.ts` so menus and
`FilterCombobox` share one constant. A new `OpenTallerThanViewport`
story covers the overflowing state for visual regression.

Menus that pass their own height cap (`AgentRow`,
`DownloadSelectedAgentLogsButton`, `MoveToProjectMenuItems`) keep it,
because `cn` lets the caller's class win.

Fixes DEQ-467, DEQ-231

### Proof

Captured from the real app (`./scripts/develop.sh`) with Playwright at a
683×384 CSS viewport, which is a 1366×768 screen at 200% zoom.

| Menu | Before | After |
|---|---|---|
| Admin settings (mobile nav), scrolled to the end | <img width="340"
alt="Admin settings menu before: Healthcheck and later items cut off
below the viewport"
src="https://raw.githubusercontent.com/coder/coder/0e4dbe9b82237f6d905d608c5491ee7aaa772d41/before-admin.png"
/> | <img width="340" alt="Admin settings menu after: menu scrolls, last
item Healthcheck visible"
src="https://raw.githubusercontent.com/coder/coder/0e4dbe9b82237f6d905d608c5491ee7aaa772d41/after-admin.png"
/> |
| Agents account menu | <img width="340" alt="Account menu before: top
items cut off above the viewport"
src="https://raw.githubusercontent.com/coder/coder/0e4dbe9b82237f6d905d608c5491ee7aaa772d41/before-agents-account.png"
/> | <img width="340" alt="Account menu after: menu starts at the
viewport top and scrolls"
src="https://raw.githubusercontent.com/coder/coder/0e4dbe9b82237f6d905d608c5491ee7aaa772d41/after-agents-account.png"
/> |
| Agents filter menu | <img width="340" alt="Filter menu before: top
items cut off above the viewport"
src="https://raw.githubusercontent.com/coder/coder/0e4dbe9b82237f6d905d608c5491ee7aaa772d41/before-agents-filter.png"
/> | <img width="340" alt="Filter menu after: menu starts at the
viewport top and scrolls"
src="https://raw.githubusercontent.com/coder/coder/0e4dbe9b82237f6d905d608c5491ee7aaa772d41/after-agents-filter.png"
/> |

Measured menu bounds (viewport height 384px):

| Menu | Before | After |
|---|---|---|
| Admin settings | top 73, bottom 501, `overflow: hidden` | top 73,
bottom 384, scrolls (311 of 427px visible) |
| Agents account | top -161, bottom 332, `overflow: hidden` | top 0,
bottom 332, scrolls (330 of 491px visible) |
| Agents filter | top -107, bottom 225, `overflow: hidden` | top 0,
bottom 225, scrolls (223 of 330px visible) |

<details>
<summary>Decision log</summary>

- **Fix in the shared class, not per menu.** Every reported menu renders
through `DropdownMenuContent`, which uses `menuContentClass`. Fixing it
there also covers submenus and `ContextMenu`, and future menus cannot
regress one by one.
- **Use Radix's available height.** `--radix-popper-available-height` is
the space between the trigger and the viewport edge on the side Radix
chose. `Popover` and `FilterCombobox` already cap height with it.
- **`overflow-y-auto overflow-x-hidden` instead of `overflow-hidden`.**
Vertical scrolling makes the clipped items reachable. Horizontal stays
hidden, so the open and close zoom animation and long labels behave as
before.
- **Reuse `menuMaxHeightClassName`.** Review found that
`FilterCombobox/primitives.tsx` already exported the same literal. It
moves to `menuClasses.ts`, the shared menu styling module, instead of
being duplicated. Importing it the other way would pull cmdk into every
menu consumer.
- **Story, not a unit test.** jsdom has no layout, so a Vitest test
could only assert class names. The `OpenTallerThanViewport` story gives
Pixel a snapshot of the capped, scrollable state. With the fix reverted,
the story's menu measures 1456px in a 384px frame; with it, 322px.
- **Validation.** `pnpm lint` (biome, oxlint, tsc, circular deps,
compiler, sentence case, knip), `make pre-commit`, `make test-js` (one
flake in `TemplatesFilter.test.tsx` under full-suite load, which then
passed 8 of 8 targeted runs), the DropdownMenu Storybook tests, and the
frontend-deep-review roles, whose one should-fix (reuse the existing
constant) is applied.

</details>

---

_Generated by Coder Agents on behalf of @chrifro._
2026-11-18 17:56:01 -05:00
Jeremy Ruppel 6a62aaf091 test(site/src/pages/AISettingsPage): wait for added member before saving sharing dialogs (#32413)
Fixes a `test-js` flake on main: [run
44403867707](https://github.com/coder/coder/actions/runs/44403867707/job/135153980207)
failed `OrganizationSkillSharingDialog > saves only the changed entries`
because the PATCH body was missing the added user.

"Add member" is a React 19 `<form action>`, so its draft update commits
in a transition. The test clicked "Save permissions" right after, and
under CI load Save could run against the pre-add draft. The tests now
wait for the added member's row before saving.
`ChatModelSharingDialog.test.tsx` had the same sequence and gets the
same fix.

<details>
<summary>Investigation notes</summary>

- Reproduced deterministically by running the last two clicks with
`userEvent.setup({ delay: null })`: 3/3 failures with the same diff as
CI. Both tests pass under that repro with this change.
- user-event clicks are not wrapped in `act` here:
`@testing-library/react@14.3.1` depends on `@testing-library/dom@9.3.3`,
while `@testing-library/user-event@14.6.6` resolves
`@testing-library/dom@10.4.2`, so RTL's `act` event wrapper is never
applied. Passing runs also log hundreds of "not wrapped in act"
warnings, hidden by `silent: "passed-only"`. Upgrading to RTL 16 would
address this suite-wide and is left out of scope.
</details>

> Generated by Coder Agents on behalf of @jeremyruppel.
2026-11-18 17:42:09 -05:00
christin 7809665265 fix(site/src): add visible labels to the port forward listening port controls (#32383)
The listening ports filter in the workspace port forward popover showed
only a "Filter ports..." placeholder, which disappears on focus, so the
field had no persistent visible label (axe `label-is-placeholder`, WCAG
3.3.2). This adds visible `Protocol` and `Port` labels, tied with
`htmlFor`/`id`, to the listening port protocol select and the port
field.

Both popover sections now have a "Protocol" and a "Port" control, so
each section's controls are wrapped in a `role="group"` labelled by its
heading ("Listening ports", "Shared ports"). That way screen readers can
tell them apart. `SearchField` gains an `id` prop to support the label
association.

Fixes
[DEQ-272](https://linear.app/codercom/issue/DEQ-272/label-is-not-persistent)

| Before | After |
| --- | --- |
| <img
src="https://raw.githubusercontent.com/coder/coder/assets/port-forward-visible-label/pr/before.png"
width="404" /> | <img
src="https://raw.githubusercontent.com/coder/coder/assets/port-forward-visible-label/pr/after.png"
width="404" /> |

<details>
<summary>Decision log</summary>

- **Label text.** Deque suggested "port number". The field both filters
detected ports and connects to a typed port, so the label is `Port`,
which matches the share form's existing `Port` field. The placeholder
stays as an example hint.
- **Protocol label.** The protocol select beside the field had only an
`aria-label`. It gets a visible `Protocol` label too, so both controls
in the row look the same.
- **Duplicate names.** The frontend deep review flagged that `Protocol`
and `Port` now appear in both popover sections. Rather than adding
section words to the visible labels, each section is a `role="group"`
named by its existing heading.
- **Tests.** The Vitest helper and story queries now find the field by
its new name inside the "Listening ports" group. They no longer depend
on the share form's port field being a spinbutton.

</details>

<details>
<summary>Verification</summary>

- `pnpm check`, `pnpm lint` (biome, oxlint, tsc, circular deps,
compiler, sentence case, knip): pass.
- `PortForwardButton.test.tsx` and the `PortForwardPopoverView`
storybook tests: pass.
- Full `pnpm test`: 4 failures in `TemplatePermissions.test.tsx` and
`MCPServerForm.test.tsx`, which this change doesn't touch. Both files
pass when run alone (26/26).
- `pnpm build`: pass.
- Checked on a `./scripts/develop.sh` instance with a running workspace:
the popover's "Listening ports" group shows visible `Protocol` and
`Port` labels and exposes them as accessible names.

</details>

> Generated by Coder Agents on behalf of @chrifro.
2026-11-18 17:16:34 -05:00
Taruj Goyal 734a0cae07 feat: scope browser-only connections to a template (#30578)
Add per-template `browser_only` enforcement while preserving `CODER_BROWSER_ONLY` as a deployment-wide override.

Refs #29157. Supersedes #29204 (closed by stale bot). Rebased onto current `main`, with migration renumbered to `000643`.

### Changes

- Add `templates.browser_only` (default `false`) to the database, SDK, and template create/update APIs.
- Require the `browser_only` entitlement to enable the setting, but allow disabling and continue enforcement after license expiry.
- Reject agent coordinate connections with 409 and enforce per-template tunnel restrictions through `AuthorizeTunnel`.
- Return non-fatal tunnel policy errors in both AGPL coordinator and pgcoord, preserving other active tunnels on shared connections.
- Exclude browser-only workspaces from Desktop workspace updates and enforce the restriction in MCP agent connections.
- Fix `TestMigration000617ConnectionLogsMethod` to use raw SQL, avoiding schema compatibility issues.

### Open questions

- **Naming:** Keep `browser_only` or use `require_browser_connections`?
- **Performance:** `AuthorizeTunnel` adds a database query under the coordinator mutex. Consider a narrower query if needed.
- **Feature reporting:** Should the feature report as enabled when any template uses it?

### Out of scope

Dashboard UI, CLI flag, and Terraform provider support (requires a separate `coder/terraform-provider-coderd` change).

### Verification

- Relevant unit and integration tests passed, including coordinate rejection, tunnel isolation, workspace filtering, and non-fatal policy errors in both coordinators.
- `golangci-lint` passed with no issues.
- Regenerated database, SDK TypeScript, Swagger/API reference, and audit-log artifacts.
- Not manually verified with Coder Desktop, multi-node deployments, workspace proxies, or UI.

### AI disclosure

Most changes and the rebase were completed with Claude Code (Opus 5/5.5), following the [AI contribution guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING).
2026-11-18 22:07:12 +00:00
Andrew Aquino 422090c7a9 fix(site/src/pages/AgentsPage/components/ChatsSidebar): expose search shortcut via aria-keyshortcuts (#32408)
The Agents sidebar **Search** nav item has `aria-label="Search chats"`,
so the `Ctrl K` / `⌘ K` hint that appears on hover and focus never
reaches screen readers. This PR adds `aria-keyshortcuts` to
`SettingsNavItem` and sets it on the Search item: `Meta+K` on macOS and
`Control+K` everywhere else, matching `useAgentsPageKeybindings`. The
visible label and the `Kbd` hint are unchanged.

Closes DEQ-256

| Ticket | UI surface |
| --- | --- |
| DEQ-256 | `/agents` sidebar, **Search** nav item (Ctrl/⌘ K hint) |

No screenshots: only ARIA changes, and the UI looks the same.

**Dropped review finding:** FE1 flags assertions on attribute presence.
I kept `toHaveAttribute("aria-keyshortcuts", "Control+K")` because the
attribute is the screen-reader outcome and Pixel can't capture it.
`AgentChatInput.test.tsx` already asserts `aria-keyshortcuts` the same
way.

<details><summary>Decision log</summary>

- Root cause: the `aria-label` replaces the button's text content, `kbd`
hint included, so the shortcut never reaches the accessibility tree.
- Chose `aria-keyshortcuts` over adding the shortcut to `aria-label`. It
is the semantic way to expose a shortcut, NVDA reports it as the
shortcut key, and the existing send button (`AgentChatSendButton`)
already does it.
- Not changed: the Settings button already exposes its `Ctrl ,` hint
through its tooltip description.

</details>

🤖 Generated by Coder Agents on behalf of @aqandrew.
2026-11-18 13:43:13 -08:00
christinandJeremy Ruppel a065cd2cbe fix(site/src): show truncated filter labels and options in a tooltip (#32054)
Under WCAG 1.4.12 text spacing overrides (letter spacing 0.12em, word
spacing 0.16em, line height 1.5), the `SelectFilter` trigger and options
cut their labels off with no way to read the full text. Examples are
"All providers" on AI Gateway sessions and "All resource types" and "All
organizations" on the audit log.

Nothing wraps. Labels stay on one line with an ellipsis, and a truncated
label shows its full text in a tooltip:

- **Trigger:** `ComboboxButton` shows the tooltip on hover and keyboard
focus. It only opens if the label is truncated at that moment, so a
spacing override applied after load is still caught. It stays closed
while the dropdown is open.
- **Options:** the new `ComboboxItemLabel` shows the tooltip while its
option is highlighted, by pointer or arrow keys. cmdk options never get
DOM focus, so the tooltip follows cmdk's highlighted value instead.
`SelectFilter` options use it. cmdk highlights the first option when the
dropdown opens, so a truncated first option shows its tooltip right
away. Escape closes that tooltip first, and a second Escape closes the
dropdown.

Filter widths are unchanged from main. With the spacing override, "All
providers" (109 > 98px), "All resource types" (156 > 148px) and "All
organizations" still truncate at main widths, and the tooltip covers
them.

`ComboboxButton` is shared, so its form callers (workspace version,
preset, IdP sync, AI budget dialogs) also get the tooltip when their
selected value is truncated. That's additive: on main they truncated
with no way to read the full text.

The W3C Understanding document for 1.4.12 allows ellipses caused by
spacing overrides "so long as the content is still available". The
tooltip keeps the content available.

Closes DEQ-365
Closes DEQ-430

| Ticket | Surface | Before/after screenshots (spacing override on) |
|---|---|---|
| DEQ-365 | Audit log filters, long options | [Linear
comment](https://linear.app/codercom/issue/DEQ-365/text-spacing-content-cut-off#comment-4731b624)
|
| DEQ-430 | AI Gateway sessions filters, long options | [Linear
comment](https://linear.app/codercom/issue/DEQ-430/text-spacing-content-cut-off#comment-754a4ae6)
|

<details>
<summary>Grouping, decisions, and review notes</summary>

**Grouping.** The batch label `text-spacing-cut-off` had three eligible
tickets with two root causes. DEQ-365 and DEQ-430 come from the shared
`SelectFilter`/`ComboboxButton` and are fixed here. DEQ-434 comes from
`StaticWidth` in agent metadata and is fixed in #32055.

**Revisions.**
1. Wrapped the trigger and options onto several lines. A human reviewer
rejected this.
2. One-line trigger with a tooltip, wider filters, wrapped options.
3. This version: nothing ever wraps, options get a tooltip too, and the
width bumps are reverted at the reviewer's request after a re-check
confirmed the issue still exists at main widths.

**Tooltip details.**
- Both tooltips are controlled Radix `Tooltip`s that compare the label's
`scrollWidth` to its `clientWidth`.
- The trigger tooltip opens through `onOpenChange`. The option tooltip
opens from a layout effect when `useCommandState` reports the option as
highlighted, so it follows the arrow keys without focus moving.
- Trigger: Escape and moving the pointer onto the tooltip work as WCAG
1.4.13 requires, through the Radix defaults.

**Verification.**
- Injected the WCAG spacing stylesheet into Storybook (`pages/AuditPage`
AuditPage, `pages/AIBridgePage/ListSessionsFilter` Default,
`components/SelectFilter` LongOptionHighlighted and
TruncatedTriggerFocused). Truncated triggers show their full label on
hover and on focus. The highlighted long option shows its full label,
arrow keys move the tooltip, and short options get none. Option heights
stay 37 to 40px (one line).
- Vitest: the focused trigger's accessible description is the full label
when truncated and empty when it fits. With a truncated option
highlighted, the first Escape dismisses its tooltip and the second
closes the dropdown.
- Unit tests for Filter, Combobox, Command, AuditPage, AIBridgePage,
TemplatesPage and ConnectionLogPage pass (331), and so do the Storybook
tests for Filter, Combobox, Command, AuditPage and AIBridgePage (228).
`pnpm check` and `tsc` are clean.
- `OrganizationMembersPage.test.tsx` fails 4 tests locally with main's
components too, so it's unrelated.

**Accessibility audit (axe 4.11, WCAG A/AA and best practices).** No new
violations. `aria-dialog-name` and `scrollable-region-focusable` on the
open popover already fail on main, and this diff doesn't touch the
popover.

**Doc check.** No docs describe filter label truncation, so no docs
changes are needed.

</details>

🤖 Generated by Coder Agents on behalf of @chrifro. Review fixes by Coder
Agents on behalf of @jeremyruppel.

---------

Co-authored-by: Jeremy Ruppel <jeremy.ruppel@gmail.com>
2026-11-18 16:40:15 -05:00
Jon Ayers f66c82d939 feat: add dbcrypt support for oauth_extra (#32344)
The `oauth_extra_key` can sometimes contain sensitive data so we should
encrypt
2026-11-18 14:59:28 -06:00
christinandJeremy Ruppel beba6a337f fix(site/src/pages/TemplateBuilder): name View details links after their template or module (#32320)
The template builder repeats a "View details" registry link on every
base template card (step 1), module card (step 2), and configured item,
so screen reader users could not tell which template or module each link
opens (WCAG 2.4.4, Link Purpose (In Context)).

Each link now has visually hidden context after its visible text, so its
accessible name reads "View details for AWS EC2 (Linux) (opens in new
tab)". The visible text is unchanged and stays first in the name, so
voice-control users can still say "View details" (2.5.3).

Closes DEQ-210, DEQ-142

| Ticket | Surface | Visible change |
|---|---|---|
| DEQ-210 | `/templates/new/builder`, step 1 base template cards
(`TemplateCard`) | None (screen reader text only), so no screenshots |
| DEQ-142 | `/templates/new/builder?step=module-select`, module cards
(`ModuleCard`) | None (screen reader text only), so no screenshots |
| (same pattern) | Configure step item headers
(`TemplateBuilderAvatarData`) | None |

Accessible names read from Chromium's accessibility tree on the running
dev server:

| Step | Before | After |
|---|---|---|
| Base template | `View details (opens in new tab)` (repeated) | `View
details for Docker Containers (opens in new tab)`, `View details for AWS
EC2 (Linux) (opens in new tab)`, ... |
| Module select | `View details (opens in new tab)` (repeated) | `View
details for Claude Code (opens in new tab)`, `View details for Codex CLI
(opens in new tab)`, ... |

<details>
<summary>Decision log</summary>

- `sr-only` span over `aria-label`: `aria-label` would override the link
content and duplicate the "(opens in new tab)" text that `Link` already
appends. The hidden span extends the name in place and keeps
label-in-name.
- `sr-only` span over `aria-describedby` (used in #32317): these cards
have no single element whose text alone identifies the item without
extra noise, and the Deque suggested labels ("View details for Git
Clone") are names, not descriptions. Putting the item in the name also
fixes link lists such as the NVDA Elements List.
- The separating space sits outside the hidden span. jsdom drops leading
whitespace inside the span when it computes the name; browsers keep it
either way, and the trailing space does not render inside the
`inline-flex` link.
- Self-review: frontend-deep-review found no blocking issues. Its
should-fix (the test asserted `href` instead of the accessible name) was
fixed. Its optional nit (extract a shared link component for the three
call sites) was skipped to keep the fix small.
- Review round 1 (@jeremyruppel took over the PR): added a `ModuleCard`
link-name test (DEQ-142 had no coverage), made the `TemplateCard` test
check both cards, and made `ModuleCard`'s `detailsUrl` required, as
`TemplateCard`'s already is, so stories render a real link. Activating
"View details" also selects or toggles the card; that predates this PR
and is tracked in DEQ-634.
- Checks run locally: TemplateBuilder Vitest suite (75 tests; the new
`TemplateCard` and `ModuleCard` link-name tests fail without the fix),
`pnpm check`, `pnpm lint`, and a Playwright check of accessible names on
both steps against `./scripts/develop.sh`.

</details>

🤖 Generated by Coder Agents on behalf of @chrifro.

---------

Co-authored-by: Jeremy Ruppel <jeremy.ruppel@gmail.com>
2026-11-18 15:57:32 -05:00
christin 9110cc529a fix(site/src/modules/notifications): describe inbox action links with notification content (#32317)
Notification inbox action links such as "View workspace" read the same
for every notification, so screen reader users could not tell which
workspace a link opens (WCAG 2.4.4, Link Purpose (In Context)).

Each action link now has `aria-describedby` pointing at its
notification's message. The link keeps its visible text as its
accessible name, so voice-control users can still say "View workspace"
(2.5.3). The message wrapper is a plain `div` because `react-markdown` 9
does not accept an `id`; the Markdown classes moved onto it so the
rendered output stays the same and only one wrapper is emitted.

Closes DEQ-364

| Ticket | Surface | Visible change |
|---|---|---|
| DEQ-364 | Navbar notifications popover, action buttons on each item |
None (ARIA only), so no screenshots |

<details>
<summary>Decision log</summary>

- `aria-describedby` over `aria-label`/`aria-labelledby`: both
alternatives replace the link name with the full message, which breaks
label-in-name and makes link names long. The description supplements the
name, which is what the Deque guidance suggests as option 2.
- One fix in `InboxItem` covers every action on every notification type;
no backend template changes needed.
- Known limit: screen reader link lists (NVDA Elements List) show only
the name, which is the AAA criterion 2.4.9 and out of scope.
- Self-review: frontend-deep-review, frontend-review (FE1 to FE10),
frontend-accessibility, and test-audit found no blocking or should-fix
issues. One nit (Markdown added a second wrapper `div`) was fixed.
- Checks run locally: `InboxItem.test.tsx` (new test fails without the
fix, passes with it), `pnpm check`, `pnpm lint`, `pnpm format`.

</details>

🤖 Generated by Coder Agents on behalf of @chrifro.
2026-11-18 15:38:32 -05:00
Andrew Aquino c14e700cfd fix(site/src/pages/AIBridgePage/SessionThreadsPage): quote verbatim prompt and thinking text (#32332)
The AI Gateway session timeline shows prompt and model thinking text
exactly as written. Deque's manual Lists check (1.3.1.f) flagged it
because the text contains lines like `1. ...`. This PR keeps the text
verbatim and marks it as quoted content, without turning it into list
markup: `ExpandableText` now renders a `<blockquote>` in place of a
`<p>`. Screen readers announce the text as a block quote right after its
visible "Prompt" or "Thinking..." label.

Closes DEQ-107

| Ticket | UI surface |
|---|---|
| DEQ-107 | AI Gateway session timeline, the prompt and thinking blocks
(`/ai-gateway/sessions/:id`) |

No screenshots: the change is DOM-only. Full-page Storybook screenshots
of `OneThread`, `SecondThreadLoopOpen` and `SearchExpandsPromptOnMatch`
are byte-identical before and after, and axe reports no violations.

<details>
<summary>Decision log</summary>

- We chose not to render this text as Markdown. AI Gateway is an audit
view of other users' raw traffic, and Markdown would change what the
auditor sees. For example, link text can hide its URL, comments
disappear, and headings can imitate app UI. It would also break the
plain-string search highlighting and add parse cost on long sessions.
The Agents page already renders the same kinds of text as Markdown for
the user's own chats.
- WCAG 1.3.1 covers structure the page presents. Newlines collapse here,
so nothing is presented as a list, and the content is unformatted text
authored by a user or a model. A `<blockquote>` tells assistive tech
that the text is quoted as written.
- I didn't use a labelled `<section>` because it would add a region
landmark per block and risk `landmark-unique`. `role="log"` is a live
region, and `aria-roledescription` on a generic element is flagged by
axe.
- Element 3 of the ticket is a JSON string value inside the tool call
input `<pre>`. It stays literal data.
</details>

🤖 Generated by Coder Agents on behalf of @aqandrew.
2026-11-18 12:33:14 -08:00
Andrew Aquino a6ca18a42f fix(site/src/pages/AgentsPage): expose the agent chat panel toggle's expanded state (#32409)
The agent chat top bar's "Toggle panel" button showed whether the right
panel was open only through its icon. It now sets `aria-expanded` from
the same `showSidebarPanel` state, so screen readers announce expanded
or collapsed (WCAG 4.1.2, Deque
`state-aria-expanded-missing-incorrect`).

Closes DEQ-427

| Ticket | UI surface |
| --- | --- |
| DEQ-427 | `/agents/:id` top bar, "Toggle panel" button (`ChatTopBar`)
|

No screenshots: the change is ARIA-only and does not alter the rendered
UI.

The existing `AgentChatPage` test now asserts the button reports
`expanded: true` while the panel is open and `expanded: false` after it
closes.

<details>
<summary>Decision log</summary>

- Root cause: the toggle in `ChatTopBar.tsx` had no `aria-expanded`. One
attribute fixes it; no shared primitive is involved.
- `aria-controls` is not added: the panel lives in a separate
`RightPanel` with no id today, and `aria-expanded` alone satisfies the
checkpoint. Keeping the diff to one attribute.
- Extended the existing test that already clicks "Toggle panel" instead
of adding a new one.
</details>

🤖 Generated by Coder Agents on behalf of @aqandrew.
2026-11-18 12:27:44 -08:00
christin dbc9d08d63 fix(site/src/pages/AuditPage): use primary text color for audit diff line numbers (#32044)
Audit log diff line numbers used `opacity-50` on top of
`text-content-primary`, which blended to `#A17E7E` on the dark deleted
background (`#450A0A`) for a 4.46:1 contrast ratio, below the WCAG 1.4.3
minimum of 4.5:1.

Drop the opacity so line numbers use `content-primary` directly, like
the rest of the diff text.

Closes DEQ-581

| Ticket | UI surface | Screenshots |
|---|---|---|
| DEQ-581 | Audit page, expanded audit log diff line numbers |
[before/after](https://linear.app/codercom/issue/DEQ-581/text-content-lacks-451-contrast-ratio#comment-3fb8dd2a)
|

Measured after the change (Storybook `AuditLogRow / WithDiff`): dark
theme `#FFFFFF` on `#430A0A` (about 16:1), light theme `#09090B` on
`#FEE1E1` / `#DEFCE9` (above 17:1).

<details>
<summary>Decision log</summary>

- Single ticket, single root cause: the `opacity-50` class on both
line-number cells in `AuditLogDiff.tsx`.
- Requested direction: use `content-primary` instead of the faded
red-tinted color. The column already sets `text-content-primary`, so
removing the opacity is the smallest change; no new class needed.
- Tradeoff: line numbers are now as prominent as diff text. A lighter
token (for example `content-secondary`) was not used because it would
need its own contrast check on both diff backgrounds and the request
named `content-primary`.
- No test added: the change is a single styling class with no behavior;
existing `WithDiff` story covers the visual state for Pixel.

</details>

🤖 Generated by Coder Agents on behalf of @chrifro.
2026-11-18 15:02:15 -05:00
christinandJeremy Ruppel 7a4c4ac521 fix(site/src): keep copy confirmation until the user's next interaction (#32319)
Copy confirmations (the tick icon and the "Copied" status) disappeared
after a 1 second timer, which fails WCAG 2.2.1 Timing Adjustable.
`useClipboard` now keeps `showCopiedSuccess` true until the user's next
pointer press or key press anywhere on the page, which is the "leave the
content on screen until dismissed by the user" fix the audit recommends.
Every copy control that uses the hook gets the fix.

`TemplateEmbedPageView` disabled its copy button while the confirmation
showed. Now that the confirmation can stay up indefinitely, the button
would have stayed disabled, so it no longer disables.

Closes DEQ-95
Closes DEQ-407
Closes DEQ-494

| Ticket | UI surface | Screenshots |
|---|---|---|
| DEQ-95 | Account menu deployment ID copy item; Agents "Copy message"
button (`CopyButton`); "Notifications are blocked" error toast |
[before/after](https://linear.app/codercom/issue/DEQ-95/content-visually-appears-and-disappears-with-no-ability-to-adjust#comment-c79f52a3)
|
| DEQ-407 | Workspace page: copy workspace name, agent logs copy,
Connect via SSH copy (`CopyButton`, `AgentRow`) |
[before/after](https://linear.app/codercom/issue/DEQ-407/content-visually-appears-and-disappears-with-no-ability-to-adjust#comment-a539dde4)
|
| DEQ-494 | Account menu deployment ID copy item |
[before/after](https://linear.app/codercom/issue/DEQ-494/content-visually-appears-and-disappears-with-no-ability-to-adjust#comment-9172f756)
|

The DEQ-95 toast was already fixed on `main` by #30420, which keeps
error toasts open until dismissed. This PR covers the tick icon.

**Dropped review findings**
- Tooltips that show "Copied!" in place of the action label
(`CopyableValue`, `UserDropdownContent`, `AgentRow`, `RemoteDiffPanel`)
keep that text until the next click or key press, so hovering the
control again still shows "Copied!". Accessible names don't change. Also
dismissing on `pointerleave` or `blur` would be a product decision, and
the tickets ask for persistence, so I left this unchanged.

<details>
<summary>Grouping and decision log</summary>

- All three tickets share one root cause: `CLIPBOARD_TIMEOUT_MS` in
`site/src/hooks/useClipboard.ts` reset `showCopiedSuccess` after 1
second. Every reported tick icon reads that flag, so one fix in the hook
replaces several call-site patches.
- Dismissal listens for `pointerdown` and `keydown` on `document` in the
capture phase, so components that stop propagation (Radix menus) still
dismiss it. The event that starts a copy has already been dispatched by
the time the listener is attached, so the confirmation does not dismiss
itself.
- I chose dismiss-on-next-interaction over a user-adjustable timeout
(the audit's option 2). That option needs a setting and is overkill for
a check mark.
- Tests: timer-based `useClipboard` tests were replaced. The persistence
and dismissal behavior is covered through `CopyButton` (key press and
pointer press), and these tests fail on `main`. One vacuous "no success
timer after unmount" test was removed because no timer exists anymore.
- Self-review: frontend-review FE1 to FE10 pass. The
frontend-deep-review findings were fixed: a dead timer flush, a stale
JSDoc bullet, `onTestFinished` instead of `try/finally`, and the
disabled embed button. In frontend-accessibility, axe-core 4.11 runs on
the `UserDropdown` and `WorkspaceTopbar` stories in the copied state.
They report only the page-level rules that isolated stories ignore, and
the results match `main`.
- Size: 22 non-test lines, all under `site/`.

</details>

🤖 Generated by Coder Agents on behalf of @chrifro.

---------

Co-authored-by: Jeremy Ruppel <jeremy.ruppel@gmail.com>
2026-11-18 15:01:53 -05:00
Jeremy Ruppel e049627258 test(coderd/templatebuilder): fix ETXTBSY flake in TestQuickstartCppInstallGuard (#32403)
`TestQuickstartCppInstallGuard` wrote stub executables in parallel
subtests and then executed them through the quickstart install script. A
concurrent fork could inherit a stub's write fd, so the exec failed with
`Text file busy` (golang/go#22315). The stubs are now bash functions
prepended to the script, so the test does not write or execute any
files.

This PR also adds `TestBaseBundlesReferencedFiles`. It walks each base's
rendered `main.tf` HCL and checks that every `file()`/`templatefile()`
path is bundled in `BaseExtraFiles`. It replaces the hand-written
`AWSLinuxExtraFiles` and `AzureLinuxExtraFiles` subtests.

Fixes CLIENT-1102

<details>
<summary>Plan and decision log</summary>

### Fix CLIENT-1102: flake in TestQuickstartCppInstallGuard

#### Problem

`TestQuickstartCppInstallGuard` wrote stub executables in parallel
subtests, then executed the quickstart install script. A concurrent fork
could inherit a stub's write fd, so executing a stub failed with
`ETXTBSY` (golang/go#22315).

#### Decision log

1. Hold `syscall.ForkLock` while writing stubs. Rejected: it keeps the
file setup and protects only this process.
2. Replace the stub files with bash functions, so no file is written or
executed. Implemented.
3. Delete the test and only check that the files are referenced. Tried,
then reverted after review: the test is the only regression test for the
C/C++ install guard (#30374), and running scripts from Go tests is not
against repo policy.
4. Keep the reference check as a separate test. It covers a different
contract: every file that a base's `main.tf` passes to
`file()`/`templatefile()` must be bundled.

#### Change

- `TestQuickstartCppInstallGuard`: define the stubs as bash functions
prepended to the script. `PATH` is an empty temp dir, `sudo` echoes its
arguments, and the test checks stdout for `SUDO: apt-get install`.
- Add `TestBaseBundlesReferencedFiles`: one parallel subtest per base.
Each renders `main.tf` with `testRenderContext`, walks the parsed HCL
for `file()`/`templatefile()` calls, evaluates the path with
`path.module = "."`, and checks that it is a key of `BaseExtraFiles`,
which `Compose` passes through unchanged. A path that is not a literal
fails the test, and so does a base that bundles files without
referencing any of them. Calls in comments and heredocs are ignored.
- Remove the `AWSLinuxExtraFiles` and `AzureLinuxExtraFiles` subtests,
which only listed file names by hand and are now covered by
`TestBaseBundlesReferencedFiles`.

#### Verification

- With the guard set back to gcc only, `MissingCmake` and `OnlyGcc`
fail.
- `go test ./coderd/templatebuilder -run
'^TestQuickstartCppInstallGuard$' -count=500 -cpu=8` passes, as does the
whole package with `-count=20 -cpu=8`.
- Reference check mutations: a renamed quickstart reference, a removed
aws-linux file, and a misspelled DigitalOcean reference each fail the
subtest for that base with a short message. A path that is not a literal
fails. A call in a comment is ignored.
- `golangci-lint` (0 issues), `gofmt`, `git diff --check`.

</details>

---

_Generated with Coder Agents on behalf of @jeremyruppel._
2026-11-18 14:59:15 -05:00
christinandJeremy Ruppel 806c3a92a8 fix(site/src/modules/notifications): name the notifications inbox button (#32048)
The notifications bell in the header had no accessible name other than
the unread count, so NVDA read it as "1, button", or as a nameless
button when nothing was unread. It now gets `aria-label`
"Notifications", or "Notifications, N unread" when the badge shows a
count. Callers can still override the label through props.

Closes DEQ-508

| Ticket | UI surface | Screenshots |
|---|---|---|
| DEQ-508 | Header notifications inbox button (`InboxButton`) | Not
visible: only the accessible name changes |

Verified with axe-core 4.11 on the `InboxButton` stories: no violations.
The accessibility tree reads `button "Notifications, 3 unread"` (Unread)
and `button "Notifications"` (AllRead). The new Vitest test fails on
`main` and passes here.

<details>
<summary>Grouping and decision log</summary>

- Batch `label-programmatic-not-descriptive` has 3 tickets: DEQ-508
(this PR), DEQ-558 (separate PR, different component), and DEQ-219,
which was already fixed on `main` by #31940 (the time range picker is
now a combobox named "Time range"). DEQ-219 was handed back to a human.
- Used `aria-label` on the button instead of sr-only text. Inline
sr-only text next to the flex badge risks concatenation without
whitespace ("Notifications1"), and `aria-label` gives one deterministic
name.
- The name uses the exact unread count even above 99, where the badge
shows "99+". The badge is a status indicator, not the control's label,
and the exact count tells the user more. The deep review raised this and
kept it as an intentional choice.
- Self-review: frontend-review (FE1 to FE10 all PASS),
frontend-deep-review (all eight roles, no findings),
frontend-accessibility (no violations on the affected stories).

</details>

🤖 Generated by Coder Agents on behalf of @chrifro.

---------

Co-authored-by: Jeremy Ruppel <jeremy.ruppel@gmail.com>
2026-11-18 14:39:16 -05:00
christin b504eeabac fix(site/src/pages/CreateUserPage): include descriptions in login type option names (#32049)
The "Login type" options on the Create user page announced only their
short label ("Password", "GitHub", "Service account"). The description
under each option, which is what tells the user what the login type
does, was left out. Each option is now labelled by both its label and
its description, for example "Password Use an email address and password
to log in."

Radix `Select.Item` sets `aria-labelledby` to its `ItemText` id and lets
props override it. So the item now points at its own `ItemText` id and
the description id, both built from `useId()`. The trigger still shows
only the short label as its value, and typeahead still matches the
label.

Closes DEQ-558

| Ticket | UI surface | Screenshots |
|---|---|---|
| DEQ-558 | `/deployment/users/create`, the Login type dropdown options
(`CreateUserForm`) | Not visible: only the accessible names change |

Verified with axe-core 4.11 on `pages/CreateUserPage` with the listbox
open. Before, the options were named `option "Password"`, and so on.
After, they are named `option "Password Use an email address and
password to log in."`, and so on, with the Premium notice included for
the disabled service account option. The trigger is still `combobox
"Login type": Password`. The only violation, `aria-hidden-focus` on
`#storybook-root`, also shows on `main`: it is Radix hiding the page
behind the open select. The updated Vitest test fails on `main` and
passes here. The e2e helper's `getByRole("option", { name: "Password",
exact: false })` still matches only the Password option.

<details>
<summary>Grouping and decision log</summary>

- Batch `label-programmatic-not-descriptive` has 3 tickets: DEQ-558
(this PR), DEQ-508 (separate PR, different component), and DEQ-219,
which was already fixed on `main` by #31940. DEQ-219 was handed back to
a human.
- The description goes into the name (`aria-labelledby`) rather than
only `aria-describedby`, because the ticket asks for it and Deque's
guidance says all on-screen text that labels the control belongs in the
name.
- The fix is scoped to this form's hand-assembled items. The shared
`SelectItem` has no description slot, and no other select renders
descriptions.
- Self-review: frontend-review (FE1 to FE10 all PASS),
frontend-deep-review (all eight roles, no findings),
frontend-accessibility (no new violations).

</details>

🤖 Generated by Coder Agents on behalf of @chrifro.
2026-11-18 14:18:50 -05:00
Nick Vigilanteandcoder[bot] 579b9995e8 fix: document WebSocket routes as 101 responses in the Swagger spec (#30125)
Six WebSocket routes were documented as `200` responses: `chats/watch`,
`chats/{chat}/stream`, `chats/{chat}/stream/git`,
`chats/{chat}/stream/parts`, `workspaces/{workspace}/watch-ws`, and
`workspaceagents/{workspaceagent}/watch-metadata-ws`.

Mark them `@Success 101`, matching the other WebSocket routes, and
describe each message. `chats/{chat}/stream` and `stream/parts` send a
JSON array batch of events per message, so they keep `{array}`; the
others send one event per message.

Also document that the previous template version route returns `204`
with no body when there is no previous version.

Part of DOCS-1122, split from #30121.

<details>
<summary>CI flakes unrelated to this change</summary>

On `d23267b7c3`, two checks failed in code this PR does not touch.

-
[`TestChatTurnStopsAtStepLimit/Default`](https://github.com/coder/coder/actions/runs/40809166900/job/123235512188)
in `coderd/x/chatd` (test-go-pg, ubuntu): this PR changes only Swagger
comment annotations and generated docs, and does not touch the `chatd`
package.
-
[`updateWorkspace.spec.ts:76`](https://github.com/coder/coder/actions/runs/40809166900/job/123235512158)
(test-e2e): this PR changes no UI code, and the test exercises workspace
parameter updates.

</details>

---
🤖 Built with AI assistance.

---------

Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com>
2026-11-18 14:05:18 -05:00
Ben PotterandNick Vigilante 3617b3d384 docs: document 2-second sandbox startup with prebuilt workspaces (#32391)
Follow-up to #32280. The sandbox agents guide said sandbox runtimes boot
in milliseconds but didn't say how fast a Coder workspace can be.

- `sandbox-agents.md`: some sandboxes advertise millisecond startup, but
about 2 seconds is good enough and worth the infrastructure flexibility.
Links the [Improving Coder Workspace Startup
Times](https://www.youtube.com/watch?v=-xcVJQWVCxs) video (1.5 min to 2
seconds on Kubernetes) in Fast startup.
- `speed-up-templates.md`: links the same video in the intro.

> Generated by Coder Agents on behalf of @bpmct.

---------

Co-authored-by: Nick Vigilante <nickvigilante@users.noreply.github.com>
2026-11-18 18:18:33 +00:00
df7f2076fd docs: explain how the init script obtains the workspace agent (#31976)
## Summary

Adds a short note to the base image guidance on the image management
page, so template authors don't expect a speedup the init script can't
deliver:

- The init script downloads the agent from the Coder server on every
workspace start, which keeps the agent at the server's version.
- An agent binary already in the image isn't used by the init script, so
adding the agent to the image doesn't skip the download.
- To skip the download, the note links to [Build tools into the
image](https://github.com/coder/coder/blob/main/docs/workspaces/speed-up-templates.md#build-tools-into-the-image),
which describes starting `coder agent` directly.

Refs DOCS-1323.
Supersedes #31803, reopened under a human author for attribution.

> Generated by Coder Agents.

<details>
<summary>Verified against</summary>

- `provisionersdk/scripts/bootstrap_linux.sh`: always downloads
`${ACCESS_URL}bin/coder-linux-${ARCH}` with curl, wget or busybox and
retries until it succeeds. `BINARY_DIR` only changes where the binary is
downloaded to.
- `provisionersdk/scripts/bootstrap_darwin.sh`: always downloads into a
new `mktemp` directory.
- `provisionersdk/scripts/bootstrap_windows.ps1`: always downloads to
`$env:TEMP\sshd.exe`.
- `provisionersdk/agent.go`: these scripts are the only init scripts
given to the Terraform provider.
- `cli/agent.go`, `cli/root.go`: `coder agent` is a hidden command. It
reads `CODER_AGENT_URL`, `CODER_AGENT_TOKEN` and `CODER_AGENT_AUTH`
(default `token`).
- `docs/workspaces/speed-up-templates.md` on `main` (from #32280)
already documents installing the agent in the image and starting it
directly.

</details>

<details>
<summary>History</summary>

This branch was originally stacked on the sandbox agents guide.
That guide landed on `main` in #32280 under a different name, so the
merge with `main` kept main's version and the PR now contains only the
image management note.

</details>

---------

Co-authored-by: Coder Prototypes <294797144+coder-prototypes@users.noreply.github.com>
Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com>
Co-authored-by: Ben Potter <me@bpmct.net>
2026-11-18 13:08:07 -05:00
Nick Vigilante b2474d19d7 feat: own the docs accessibility checks the axe Linter doesn't run on Markdown (#30905)
## Merge order

This PR was stacked on #30879, which has merged. It now targets `main`
and has no remaining dependency.

## Summary

The axe Linter checks only one rule in Markdown, `heading-order`, and
markdownlint `MD001` already covers it for Markdown headings. This PR
adds owned checks for the raw HTML in docs Markdown that neither tool
sees, so the coverage stays when the licence ends.

- `Coder.HeadingOrder` (Vale) flags heading-level skips and counts raw
`<hN>` headings, such as the `<h3>` headings `scripts/apidocgen` emits,
which `MD001` ignores.
- `Coder.EmptyHeading` (Vale) flags headings with no text, in Markdown
and raw HTML.
- `Coder.LinkName` (Vale) flags links with no text: `[](url)`, links
whose only content is an image with empty alt text, and empty `<a
href>`.
- `docshtmlcheck` now rejects `aria-*`, `role`, `tabindex`, and `lang`
attributes, and `iframe`, `object`, `area`, `form`, `input`, `select`,
`textarea`, `button`, and `meta` elements. No docs page uses any of
them, so the 32 axe HTML rules that check them have nothing to check,
and this keeps it that way.
- The style guide's decorative-image example changes from
`![](decorative.png)`, which `MD045` rejects, to `<img src="…" alt="">`.
No docs page used the old form.
- The style guide's checks table gains a row per new check, and the
coverage counts move the descriptive-link-text section from planned to
tool-checked (22 of 90 rules tool-checked, up from 21 on `main`).

## Design

All three Vale rules are `script` rules on `raw` scope, because heading
levels, empty headings, and links with no text only show up in the raw
source. Raw scope also reaches YAML front matter, fenced code, HTML
comments, and inline code, so the scripts skip those themselves. Fence
tracking matches the opening marker's character and length, so a
four-backtick fence holding a three-backtick one stays closed correctly.
The patterns use only capture groups that always participate, because
Tengo's `text.re_find` panics on a group that didn't match.

`Coder.HeadingOrder` is built to agree with `MD001` without reporting
the same skip twice. It tracks the previous heading of any kind and the
previous Markdown heading. It stays quiet on a Markdown heading that
`MD001` already reports (a skip measured against the previous Markdown
heading) and reports the skips `MD001` can't see: a raw HTML heading
that skips, and a Markdown heading that skips only because a raw HTML
heading sits before it. On a probe file covering each case, the two
tools reported disjoint lines. The one remaining divergence is by
design: after `## A`, `<h3>B</h3>`, `#### C`, `MD001` reports C (it sees
H2 to H4) while this rule sees a clean H2, H3, H4 sequence and stays
quiet, so the author still gets exactly one finding.

The `docshtmlcheck` guard is a separate `guard.go` that runs on each
start tag the existing tokenizer already walks. The elements stay in
`allowedElements`, so authors get a message explaining why the element
doesn't belong rather than the generic unknown-element one, and a closed
`<button>` still balances. Guard findings get their own kinds
(`disallowed-element`, `disallowed-attribute`) and their own summary
footer. I included `form` alongside the form controls the issue lists,
since a form with no controls has no use either.

Known gaps, documented in each rule's header and none hit by the current
corpus: setext headings, headings inside block quotes or list items, raw
HTML headings or links split across lines, reference-style links, and
inline code delimited by more than one backtick. There is no Vale rule
test harness in the repository, so the hit and non-hit probe files used
below live outside the tree.

## QA

I ran each Vale rule against a probe file with hits and non-hits, with
the repository `.vale.ini` and the pinned Vale 3.7.1.

- `Coder.HeadingOrder`: reported the raw `<h4>` after an `##` and the
`###` that follows a raw `<h1>` after a `###`. It stayed quiet on the
two skips `MD001` reports, on `#` lines in front matter, fenced code,
and an HTML comment, and on a clean sequence. markdownlint on the same
file reported only the two `MD001` lines, so no line got both.
- `Coder.EmptyHeading`: reported `##`, `### ###`, `<h2></h2>`,
`<h3>&nbsp;</h3>`, and `<h4> <br/> </h4>`. It stayed quiet on text
headings, seven `#` marks, an empty `<h2>` in inline code, and lone `#`
lines in front matter, fences, and comments.
- `Coder.LinkName`: reported all 7 hit cases (empty, whitespace, `![]()`
inside a link, raw empty-alt `<img>` inside a link, empty `<a href>`,
`<a href>` around an empty-alt image, `<a href>` holding only `&nbsp;`).
It stayed quiet on all 9 non-hit cases, including a bare decorative
image, `<a id>` anchors, inline code, comments, and fenced code.

Findings on the current corpus (`docs/`, excluding the exempt style
guide): `Coder.HeadingOrder` 0, `Coder.EmptyHeading` 0, `Coder.LinkName`
0, `docshtmlcheck` guard 0. The other Vale findings are unchanged from
before the PR. No corpus pages changed.

## Testing

- `go test ./scripts/docshtmlcheck/ ./scripts/styleclaims/`: 140 passed.
The guard tests were written first and failed before `guard.go` existed.
They cover each element, each attribute (including case-insensitive
names and attributes wrapped across lines), lookalike names such as
`data-role`, code and comment exclusion, the reported line and message,
and the `run` exit code and footer.
- `make lint/docs-html`: clean.
- `make lint/style-claims`: clean, so the checks table, the coverage
counts, and the annotations agree with `.vale.ini` and the rule files.
- `make lint/emdash`: clean.
- `pnpm check-docs` (markdownlint and table formatting): 0 errors across
515 files.
- Vale 3.7.1 over `docs/` with `--no-exit`, run directly rather than
through `make lint/prose` because the worktree's mise config isn't
trusted: no findings from the new rules.

## Upstream

Not applicable. These checks are specific to the Coder docs corpus and
its style guide, so there's nothing to send to Vale, markdownlint, or
goldmark.

## Linear

https://linear.app/codercom/issue/DOCS-1318

---

🤖 Built with AI assistance.
2026-11-18 12:24:23 -05:00
Thomas KosiewskiandJaayden Halko 2c96f05186 feat: show the overview card in Coder Agents chats (#31412)
Shows the overview card container from #31590 in Coder Agents chats. The
card sits in the chat's top-right corner, and a list button in the chat
top bar shows and hides it, as in the Codex desktop app. The card and
the button exist only while the right panel is closed, the transcript is
not full width, and the page is not an embed. Both show only from an
84rem chat, so the card never covers the transcript and the transcript
never moves. Below 84rem the card does not mount, so its cost and
attachment requests do not run. Phones and narrow windows do not show
the card.

The card shows by default and stays open until the user hides it. The
choice is stored in localStorage under `agents.overview-card-open`, for
every chat. The right panel keeps its own saved preference. A row opens
the right panel on its tab, which hides the card. The card returns when
the panel closes.

The Repositories section lists every repository the git watcher reports,
by folder name with its branch below. A clean repository shows `+0 −0`,
so a chat keeps a Repositories row when AI Gateway turns cost off. The
card reads the attachments through `useChatAttachments` from #31411, so
it shows the Summary panel's list and shares its query. When the earlier
attachments fail to load, the card shows the error and a **Retry**
button in Attachments, as the Summary panel does.

The docs describe the card in the Coder Agents overview and add it to
the places that show spend. #31260 (do not merge) stays the hands-on
reference.

1600px chat with the card open:

![1600px chat with the overview card
open](https://github.com/user-attachments/assets/6d1760c7-0707-42e2-8284-2a5e133e3f71)

1600px chat after the user hid the card:

![1600px chat after the user hid the
card](https://github.com/user-attachments/assets/d7cf7d7a-92c8-4fa4-9096-2c12043e0a06)

960px chat, no card and no button:

![960px chat without the card or the
button](https://github.com/user-attachments/assets/384d7db8-7c2f-4c1a-9a75-a9d59ae0dd4f)

## Decision and open questions for Jaayden

Decision you can reverse: a clean repository row is plain text, not a
button. The Git panel lists only repositories with changes, so a click
on a clean row used to open the default Git view. To reverse it, give
the clean row its `onClick` back in `ChatOverviewCardView`.

1. Should a new chat show the card instead of the Summary panel? This PR
keeps the right panel's saved preference as it is.
2. A chat with no repository and no cost shows "Nothing to show yet". Is
that the placeholder you want?
3. Subagents (#31410): the heading says "not idle" instead of "active"
because errored subagents stay in the list, and the ones that need the
user sort first. Do that wording and order work for you?
4. A row click (#31478) moves focus to the active right panel tab. Do
you prefer the Git view switcher instead?

## How to test

1. Open Storybook at `pages/AgentsPage/AgentChatPageView`, stories
`OverviewCardBesideTranscript`, `OverviewCardHiddenWhenNarrow`,
`OverviewCardHiddenInFullWidth`, and `OverviewCardHiddenByUser`.
2. Run `pnpm exec vitest run --project=unit
src/pages/AgentsPage/AgentChatPage/AgentChatPage.test.tsx
src/pages/AgentsPage/hooks/useChatOverview.test.ts` in `site/`. The page
tests set the chat width with the repo's `MockResizeObserver`. They
check that a narrow chat requests none of the card's data, and that
**Retry** in the card requests the earlier attachments again.
3. In a dev deployment, open a chat in a window at least 84rem wide.
Hide the card with the list button, reload, and check that it stays
hidden.

## What to look at first

1. `hooks/useChatOverview.ts`: one `canShow` value gates both the toggle
and the card, so the page only renders what the hook returns. The hook
measures the chat's outer element with a `ResizeObserver` through
`observeChat`, and `OVERVIEW_MIN_CHAT_WIDTH_REM` holds the 84rem value
in one place, so the button and the card cannot disagree.
2. `AgentChatPageView.tsx`: the page passes `observeChat` as the chat
element's ref and destructures it from the hook result. The React
Compiler treats an object that holds a ref callback as a ref, so the
page keeps it apart from the other values.
3. `components/ChatOverviewCard.tsx`: this PR adds `ChatOverviewToggle`
to the container from #31590.

<details>
<summary>Review history</summary>

The repository's frontend-deep-review ran three rounds on the first
version, a clean-context advisor ran once, then one strict code quality
review ran, then a polish pass and one final review round ran on the
whole stack.

Polish pass changes:

- Split `ChatOverviewCard.tsx` into the container plus
`ChatOverviewToggle`, with the view in `ChatOverviewCardView.tsx`
(#31409). The `getOverviewCost` tests moved to
`ChatOverviewCard.test.tsx` unchanged.
- Added `useChatOverview`, which owns the visibility gate and the open
state.
- The card builds repository rows with `repoLabel`, the repository's
branch, and `countRepoChanges`. Before, it filtered repositories through
`computeRepoStats` only to add the clean ones back.
- The docs say that you cannot select a clean repository row.

Final round fixes: renamed the top bar prop `overview` to
`overviewToggle`, inlined the toggle value in the hook, and corrected
three doc comments.

Follow-up fixes, after the final round:

- The card no longer mounts below an 84rem chat. Before, it stayed
mounted and CSS hid it, so its queries kept running. The repo has no
element-size hook, so `useChatOverview` observes the chat element
itself. The `@container/chat` class and the `@min-[84rem]/chat` classes
are gone.
- The card wires the earlier attachments request into the view, so a
failure shows its error and a retry.
- New tests: the hook test checks the 84rem boundary on both sides, and
two page tests check the narrow chat's requests and the card's retry.
Each fails without its fix. The existing page tests now set a 1600px
chat width before they look for the card. Their assertions did not
change.
- The container moved to #31590, because this PR grew past 600 changed
lines. GitHub cannot insert a PR in the middle of a stack, so I removed
stack #31413 and linked the six PRs again as stack #31591.
- Safari: Playwright 1.63.0 downloaded WebKit, but WebKit does not start
on this host, because system libraries such as `libsoup-3.0` and
`libGLESv2` are missing. I did not check the narrow right panel or the
card in WebKit. The `@container/chat` wrapper that the check was about
no longer exists.

Skipped in the polish pass: passing the card's placement class from the
page. That keeps the 84rem breakpoint in one file with the toggle, and
moving it adds a pass-through prop.

Declined:

- The page test checks that the card is gone while the right panel is
open (`toBeNull`). That unmount is the behavior under test, and no
callback or request captures it.
- `@container/chat` traps the right panel's `fixed inset-0` overlay
below the `lg` breakpoint. I rendered `NarrowWithSidebarPanel` at 390px
and 900px in Chromium, and the panel still covers the viewport. The
follow-up fixes removed `@container/chat`.
- `try`/`catch` around `localStorage` in `overviewCardStorage.ts`. The
file follows `sidebarTabStorage.ts`.
- Final round: move `ChatOverviewToggleProps` into the hook. The hook
imports only a type from the component file, so no runtime cycle exists.

</details>

---
_Generated with [`xum`](https://github.com/coder/xum) • Model:
`anthropic:claude-opus-5-5` • Thinking: `high`_

---------

Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com>
2026-11-18 16:55:09 +00:00