Commit Graph
23 Commits
Author SHA1 Message Date
Jake Howell ea8ba0c678 refactor: remove MUI and Emotion (#27821)
> 🤖 This PR was modified by Coder Agents on behalf of Jake Howell.

Until we meet again.

## Stack

- #27636
- #27718 
- #27719 
- #27722
- #27723
- #27724
- #27728
- #27730
- #27732
- #27762
- #27763
- #27786
- #27787
- #27788
- #27789
- #27790
- #27791 
- #27817 
- #27820
- #28009

## Final removal (`c39b664`)

Removes the last of MUI and Emotion now that every surface has been
migrated:

- **Dependencies**: drops `@mui/material` and
`@emotion/{cache,css,react,styled}` from `package.json` /
`pnpm-lock.yaml`, and deletes the `@types/emotion.d.ts` and
`@types/mui.d.ts` module augmentations.
- **Theming**: replaces the Emotion `CacheProvider`, MUI `ThemeProvider`
/ `StyledEngineProvider`, and `CssBaseline` in `ThemeProvider` with a
lightweight `theme/context.tsx` that exposes `ThemeContextProvider` and
a `useTheme` hook.
- **Global styles**: moves the base `body` styles (background, text
color, font, antialiasing) that `CssBaseline` previously provided into
`index.css`, and drops the temporary MUI modal/popover scrollbar-gutter
workaround.
- **Cleanup**: removes the MUI → shadcn / Emotion → Tailwind migration
guidance from `site/AGENTS.md`, updates the Storybook `preview.tsx`, and
adjusts assorted components (`Command`, `Slider`, `Switch`, `Tabs`,
`SyntaxHighlighter`, timing charts) and theme files to consume the new
context instead of MUI/Emotion.
2026-08-17 14:04:48 +07:00
Andrew Aquino 94605fa193 refactor(site): set square elements' dimensions with size- classes (#27071)
Finds all class combinations like `w-N h-N` and replaces them with
`size-N`.

- find: `/w-(\d+) h-\1(?=\s|")/g`, or `/h-(\d+) w-\1(?=\s|")/g`
- replace with: `size-$1`

The positive lookahead `/(?=\s|")/` matches whitespace or a double quote
character after the number, to prevent false matches where the numbers
aren't the same but share the same left digits:


https://github.com/coder/coder/blob/b3766d62be9487732c7e657cf737e739cc5413da/site/src/pages/WorkspacesPage/WorkspacesTable.tsx#L124

Unfortunately we don't have a way to automatically enforce this, since
there's no Biome equivalent for `eslint-plugin-tailwindcss`'s
[`enforces-shorthand`
rule](https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/HEAD/docs/rules/enforces-shorthand.md)
2026-07-07 15:50:58 -07:00
TJ d1d4b89bd7 fix(site): scope menu item icon sizing to direct children (#26040)
The descendant selector `[&_img]:size-icon-sm` in `menuItemClass` was
matching the `<img>` nested inside `<Avatar>` on the User settings row
of the mobile menu, pinning the avatar image to `1.125rem` instead of
letting it fill its Avatar container. The same descendant rule also
applied to nested SVGs.

Switch both rules to direct-child selectors (`[&>svg]`, `[&>img]`),
matching the symmetric `shrink-0` rules already next to them and the
same pattern used in `Button.tsx`. Menu items that contain nested
`<img>`s already set their own sizes explicitly (`w-4 h-4` in
`ProxySettingsSub`, `!size-3.5` in `WorkspacePill`), so this only stops
overriding components like `Avatar` that manage their own internal
sizing.

Also removes the now-dead `[&_img]:w-full [&_img]:h-full` workaround in
`UserDropdownContent.tsx` that fought the same bug per-item; that menu
item no longer renders an `<img>`, and the root fix makes the workaround
unnecessary anyway.

Refs
[CODAGT-552](https://linear.app/codercom/issue/CODAGT-552/mobile-menu-user-avatar-image-is-undersized-inside-its-container)

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

**Repro (before):** mobile viewport, user has an image avatar set, open
hamburger menu, observe the avatar in the User settings row is smaller
than its bordered square.

**Root cause:** `site/src/components/DropdownMenu/menuClasses.ts` set
`[&_img]:size-icon-sm` using a Tailwind descendant selector (`_`). That
matches every `<img>` *inside* a menu item, including the one nested
inside `<AvatarPrimitive.Root>`. The Avatar's inner image is supposed to
be `aspect-square size-full object-contain` and inherit its size from
the Avatar root (`--avatar-default` ≈ 24px by default), but the
descendant rule overrides that and pins it to 1.125rem.

**Prior workaround:** `UserDropdownContent.tsx` previously added
`[&_img]:w-full [&_img]:h-full` per-item to fight the same bug on
desktop. That menu item no longer renders an `<img>`, so the override
was already dead code; removed here for hygiene.

**Safety check on the wider change:** every other menu item that
contains a nested `<img>` already sets its own sizes explicitly:
- `ProxySettingsSub` (`MobileMenu.tsx`): `<ExternalImage className="w-4
h-4" />`
- `WorkspacePill.tsx`: `[&_svg]:!size-3.5 [&_img]:!size-3.5` on the menu
content

Direct-child icons (`ChevronRightIcon`, `CircleHelpIcon`, `XIcon`,
lucide icons in `UserDropdownContent.tsx`) remain direct children of the
menu item, so `[&>svg]:size-icon-sm` keeps sizing them as before.

</details>

---

_Authored by Coder Agent on behalf of @tracyjohnsonux._
2026-06-04 00:22:00 -07:00
Ben Potter f6eccbab23 feat(site/src): add ports submenu to WorkspacePill in agents chat (#24887)
Adds a **Ports (n) >** submenu item to the `WorkspacePill` dropdown
shown in the `/agents` chat UI when a workspace is attached, sitting
alongside VS Code, Terminal, and other app items.

The submenu shows a **Listening Ports** section with clickable port
links that open in a new tab, a **Shared Ports** section with
sharing-level icons when any ports are shared, and a **Manage sharing**
footer link to the workspace detail page. Port data is fetched on a 5s
polling interval while the dropdown is open and only when the agent is
connected. The trigger is disabled when the workspace is not running.

Also adds `DropdownMenuSub`, `DropdownMenuSubTrigger`, and
`DropdownMenuSubContent` to the shared `DropdownMenu` component for use
here and future consumers.

![ports submenu
demo](https://raw.githubusercontent.com/coder/coder/screenshots/ports-submenu/ports-submenu-demo.gif)

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

- `host` for port-forward URL construction comes from
`useProxy().proxy.preferredWildcardHostname`, the same source used by
`PortForwardButton` on the workspace detail page.
- Port queries are gated on `isOpen && agent.status === "connected"` so
no requests fire when the dropdown is closed or the agent is
disconnected.
- Shared ports that overlap with listening ports are deduplicated: they
only appear in the Shared section.
- Port sharing controls (create/update/delete) are intentionally
excluded to keep the agents toolbar lightweight; the "Manage sharing"
link surfaces the workspace page for that.
- The port count badge on the trigger (`Ports (n)`) uses the raw
listening-port count, matching the existing `PortForwardButton` behavior
on the workspace detail page.
</details>

> Generated by [Coder Agent](https://coder.com)
2026-05-04 11:56:51 -05:00
Jake Howell 67c57abb63 chore: tighten .vscode IDE and typescript configuration (#24537)
This branch tightens import hygiene and editor guidance to reduce
accidental use of legacy or discouraged patterns.
It also updates consumers too, by propagating the new `lucide-react`
import convention across the existing UI surfaces that reference those
icons.

- Updated `.vscode/settings.json` to prefer non-relative imports and
improve TypeScript auto-import behavior.
- Re-enabled and expanded Biome restricted-import enforcement in
`biome.jsonc` for migration guardrails.
- Added/used `lucide-react` `-Icon` naming conventions for clarity and
consistency.
- Updated consumers too across components, modules, and pages so the new
import rules are applied end-to-end.
2026-04-21 13:45:08 +10:00
Jaayden HalkoandCoder Agents 410f9a5e19 feat: allow renaming of agent chat title (#24489)
Co-authored-by: Coder Agents <noreply@coder.com>
2026-04-20 14:00:46 +01:00
Jake Howell ba0a64d483 chore: move to using radix-ui over @radix-ui/react-* (#23911)
This pull-request moves using to using the plain `radix-ui` package over
`@radix-ui/react-*` packages. Put simply, now we're not going to run
into issues with inconsistent radix dependencies. This will have no
effect to how the code is built, but will give us a single place to
import from.
2026-04-02 18:49:33 +11:00
Kayla はな 4fab372bdc chore: modernize utils/ imports (#23698) 2026-03-26 16:20:25 -06:00
Kayla はな e045f8c9e4 chore: additional typescript import modernization (#23536) 2026-03-24 16:04:39 -06:00
ケイラ b1f48f8d47 chore: disallow forwardRef (#21906) 2026-02-12 13:31:03 -07:00
Jake Howell ad1cdb3a1c feat: implement <DropdownRadio* /> to <PresetMenu /> (#21910)
This pull-request implements a `<CheckboxRadioGroup />` and
`<CheckboxRadioItem />` to our filtering menus. This means that people
will be able to actively see what preset filter is applied when opening
the filtering dropdown menu.

| Old | New | 
| --- | --- |
| <img width="286" height="407" alt="OLD_FILTER_MENU"
src="https://github.com/user-attachments/assets/791ba518-a949-4f69-b0e7-ad09ec521971"
/> | <img width="286" height="407" alt="NEW_FILTER_MENU"
src="https://github.com/user-attachments/assets/7e789d75-cb4c-4ad0-8c32-5a7087fb1626"
/> |
2026-02-04 21:27:11 +11:00
Jake Howell 912fbab11a feat: refactor <ProxyMenu /> (#21807)
This pull-request takes the old `<ProxyMenu />` in the header and makes
it so that we're inline with the latest and greatest of components from
codebase rather than MUI. Furthermore, we're reintroducing the
`<DropdownRadioGroup />` and `<DropdownRadioItem />` components.

<img width="3516" height="2390" alt="CleanShot 2026-01-31 at 13 49
28@2x"
src="https://github.com/user-attachments/assets/7f8de8e9-7645-446e-9495-0b20194cc759"
/>

### Preview

| Old | New |
| --- | --- |
| <img width="418" height="499" alt="LATENCY_OLD"
src="https://github.com/user-attachments/assets/86e9166a-7045-48c9-91f1-4593f85274d4"
/> | <img width="418" height="499" alt="LATENCY_NEW"
src="https://github.com/user-attachments/assets/a1cf80af-d11f-4bc7-99fd-a41c54a7b153"
/> |
2026-02-03 23:16:55 +11:00
Bruno Quaresma e96d69ba95 feat: delete task from sidebar (#20023)
This adds a way to delete a task from the sidebar. Once this PR is
merged, I’ll also add the option to the table list.

https://github.com/user-attachments/assets/75d714ef-afe1-4d9c-b907-1eab3a59f26b

Right now, after deleting a task, the data still shows—that’s a separate
issue related to how task data is loaded in the FE. A proper tasks
endpoint is now available, and that should be addressed as part of
[https://github.com/coder/internal/issues/904](https://github.com/coder/internal/issues/904).

Related to https://github.com/coder/coder/issues/19525
2025-09-30 10:02:02 -03:00
Bruno Quaresma accdcb8b77 chore: upgrade biome to v2 (#19362)
Guide for migration: https://biomejs.dev/guides/upgrade-to-biome-v2/
2025-08-14 18:25:15 -03:00
ケイラ 4f1db8b866 chore: upgrade to storybook 9 (#18983) 2025-08-08 14:36:27 -06:00
ケイラ 232c72ffd6 feat: group apps together on workspace page (#18018) 2025-05-29 12:01:51 -06:00
Bruno Quaresma e0718a600e feat: group external apps on task page (#18107)
https://github.com/user-attachments/assets/ac03f9ad-9b89-400b-aabe-fade2997319b
2025-05-29 14:10:27 -03:00
Bruno Quaresma 67e40244a4 feat: add extra workspace actions in the workspaces table (#17775)
**Demo:**
<img width="1624" alt="Screenshot 2025-05-12 at 16 53 36"
src="https://github.com/user-attachments/assets/7f125b31-5ce8-4c1f-8e26-c3136346cae3"
/>
2025-05-13 18:53:43 -03:00
Jaayden Halko d9ef6ed8ae chore: replace MoreMenu with DropdownMenu (#17615)
Replace MoreMenu with DropDownMenu component to match update design
patterns.

Note: This was the result of experimentation using Cursor to make the
changes and Claude Code for fixing tests.

One key takeaway is that verbose e2e logging, especially benign
warnings/errors can confuse Claude Code in running playwright and
confirming its work.


<img width="201" alt="Screenshot 2025-05-01 at 00 00 52"
src="https://github.com/user-attachments/assets/4905582e-902e-4b61-adc8-14cab6bd006b"
/>
<img width="257" alt="Screenshot 2025-05-01 at 00 01 07"
src="https://github.com/user-attachments/assets/5befc420-724a-4c57-9a9d-330a39867fae"
/>
<img width="270" alt="Screenshot 2025-05-01 at 00 01 20"
src="https://github.com/user-attachments/assets/9cbf07cb-7d44-4228-ae6f-216e9f2faed0"
/>
<img width="224" alt="Screenshot 2025-05-01 at 00 01 30"
src="https://github.com/user-attachments/assets/9fe95916-3d9d-4600-9b1f-8a620e152a53"
/>
2025-05-01 13:14:11 -04:00
brettkolodny f108f9d71f chore: setup knip and remove unused exports, files, and dependencies (#17608)
Closes [coder/interal#600](https://github.com/coder/internal/issues/600)
2025-04-30 15:08:25 -04:00
ケイラ deb95f948a chore: remove unused code (#16815) 2025-03-05 13:53:21 -07:00
Bruno Quaresma 49fadb801d refactor: update the navbar to match the new designs (#15964)
Update the navbar to match the designs in [this Figma
file](https://www.figma.com/design/WfqIgsTFXN2BscBSSyXWF8/Coder-kit?node-id=656-2354&t=4a6pX5tQU5Ti2Oyi-0).
Related to https://github.com/coder/coder/issues/15617.

**Desktop preview:**


https://github.com/user-attachments/assets/01ce7cd2-baaa-49c4-9e9a-bf6e675151da

**Mobile preview:**


https://github.com/user-attachments/assets/155e2521-7293-4368-a5f5-425179d76326

For a closer look, you can check Chromatic snapshots or test the changes
locally.

**A few considerations:**
- I made some adjustments to improve the design, such as removing the
chevron from the profile menu and reducing the size of the chevrons in
the dropdowns. I’ve documented these changes in the [Figma
file](https://www.figma.com/design/WfqIgsTFXN2BscBSSyXWF8/Coder-kit?node-id=656-2354&t=4a6pX5tQU5Ti2Oyi-0)
so @chrifro can review them after returning from vacation.
- Some of the design questions involve how the proxy and account
dropdown menus should look on desktop and mobile. For desktop, I decided
to retain the current styles, and for mobile, I tried to infer how they
should look based on the existing design.
- There is some duplicated logic between the regular/desktop navbar
menus and the mobile menus, which could lead to inconsistencies and make
maintenance harder in the future. I plan to address this in a follow-up
PR to keep this review manageable.
- I’ve added tests to minimize inconsistencies and potential bugs while
working on this refactor.
2024-12-30 14:25:00 -03:00
Bruno Quaresma 809c6114be chore: add DropdownMenu component (#15941)
Related to https://github.com/coder/coder/issues/15617
2024-12-20 14:12:48 -03:00