Skip to content

chore: sync upstream 284b0af2f7 - #398

Merged
ibetitsmike merged 18 commits into
mainfrom
mike/issue-362-sync-upstream-284b0af2f7
Nov 20, 2026
Merged

ibetitsmike merged 18 commits into
mainfrom
mike/issue-362-sync-upstream-284b0af2f7

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Merge upstream coder/coder@284b0af2f7 into fork main c631d81a83.

Clean merge, no conflicts (123 files). Notable upstream additions:

Silent-loss checks clean: registerForkChatRoutes, fork agent proto tags, Fork* experiment fields, fork-only queued queries, fork GLM reasoning-effort hook all present. Note: upstream never contained the fork-only chatdmig migration router, so its absence from the upstream tree is expected, not a deletion.

Validation: full-tree go vet clean (one pre-existing finding in an untouched file); chatd/dbauthz vet clean; suites that link locally pass (remaining Mac link failures are the known tailscale-mono env issue). fork-ci is the build and test gate.

aqandrew and others added 18 commits November 18, 2026 12:27
…expanded state (coder#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.
…rompt and thinking text (coder#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.
… notification content (coder#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.
…eir template or module (coder#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 coder#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 <[email protected]>
The `oauth_extra_key` can sometimes contain sensitive data so we should
encrypt
…oder#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 coder#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 <[email protected]>
… shortcut via aria-keyshortcuts (coder#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.
Add per-template `browser_only` enforcement while preserving `CODER_BROWSER_ONLY` as a deployment-wide override.

Refs coder#29157. Supersedes coder#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).
…controls (coder#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.
…ing sharing dialogs (coder#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/[email protected]` depends on `@testing-library/[email protected]`,
while `@testing-library/[email protected]` resolves
`@testing-library/[email protected]`, 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.
…oder#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._
…at cost beside the avatar (coder#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.
…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
coder#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 <[email protected]>
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"
/>
…x variant (coder#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"
/>
@ibetitsmike ibetitsmike added the sync Upstream sync label Nov 20, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T02:52:02.310706Z e7a0d8b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7a0d8bcb1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

name: "About this cost",
}),
);
await screen.findByRole("dialog");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wait for the tooltip role instead of a dialog

ChatCostTooltip uses the non-interactive InfoTooltip, whose Radix content exposes role="tooltip", so this findByRole("dialog") times out after the hover and fails the Storybook/Pixel capture. The same incorrect wait occurs in PartialCostTooltip and ProjectChatsListView.PartialCost; remove the wait because hover is sufficient state setup, or target tooltip.

AGENTS.md reference: site/AGENTS.md:L72-L76

Useful? React with 👍 / 👎.

Comment on lines +520 to +521
expect(canvas.queryByText("Connect via SSH")).not.toBeInTheDocument();
expect(canvas.queryByText("VS Code Desktop")).not.toBeInTheDocument();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move browser-only assertions into Vitest

This story's play function asserts which controls are absent, turning Pixel state setup into a behavior test. The repository contract requires Storybook play functions to prepare the screenshot only and places valuable behavior assertions in Vitest, so keep this story for the visual state and move these checks to an AgentRow unit test.

AGENTS.md reference: site/AGENTS.md:L72-L76

Useful? React with 👍 / 👎.

Comment on lines +107 to +111
await user.keyboard("{Escape}");
await waitFor(() => {
expect(screen.queryByRole("tooltip")).not.toBeInTheDocument();
});
expect(trigger).toHaveAttribute("aria-expanded", "true");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace the tooltip presence assertion with a behavior outcome

The new Escape test uses not.toBeInTheDocument() as its outcome and then inspects aria-expanded, even though the added stories already own these rendered states. FE1 requires Vitest coverage to assert a non-visual callback, request, or state outcome rather than DOM presence, so restructure this test around an observable interaction result and leave tooltip visibility to Pixel.

AGENTS.md reference: site/AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

</Link>
{/* Outside the link because the cost tooltip trigger is a button. */}
<span className="flex shrink-0 items-center gap-3">
<ChatPRStateIcon chat={chat} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the PR indicator inside the chat link

For chats with a pull-request status, this indicator used to be inside the row's link, but it now sits in a separate span with no click handler. Clicking that visible part of an otherwise navigable row therefore does nothing; move only the cost tooltip trigger outside the link while retaining the PR indicator as part of the chat navigation target.

Useful? React with 👍 / 👎.

@ibetitsmike
ibetitsmike merged commit 080e195 into main Nov 20, 2026
11 checks passed
@ibetitsmike
ibetitsmike deleted the mike/issue-362-sync-upstream-284b0af2f7 branch November 20, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sync Upstream sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants