Skip to content

fix(site): improve agents page mobile view#24508

Open
tracyjohnsonux wants to merge 19 commits intomainfrom
cleanup/agents-mobile-view
Open

fix(site): improve agents page mobile view#24508
tracyjohnsonux wants to merge 19 commits intomainfrom
cleanup/agents-mobile-view

Conversation

@tracyjohnsonux
Copy link
Copy Markdown
Contributor

@tracyjohnsonux tracyjohnsonux commented Apr 18, 2026

Summary

Mobile view cleanup for the agents page — all changes are behind the md: breakpoint so desktop is unchanged.

Dropdowns: Full-width on mobile with dynamic positioning via a --mobile-dropdown-bottom CSS custom property set by a ResizeObserver on the chat input box. Three position variants: -bottom (above chat input), -top (below header), -top-below-header (below sidebar header). Viewport branching uses a new isBelowMdViewport() helper (< 768px) so 640–767 px landscape phones pick the mobile branch instead of the desktop flyout.

Layout: On the main agents page, mobile ordering is header → chat list → chat input using CSS order and contents on the content wrapper. The chat input aligns to the bottom of available space. The sidebar list uses a top/bottom fade mask on mobile to hint at scrollable content.

Header: Settings, Analytics, sound, and notification icons consolidated into a single meatball menu dropdown on mobile. Sound/notification toggles use e.preventDefault() to keep the menu open for state feedback. Chime and notification state is lifted into AgentCreatePage and passed down, so the mobile meatball menu and the desktop ChimeButton/WebPushButton stay in sync.

Workspace pill: Icon-only on mobile (size-7 round button with StatusIcon), full pill on desktop. Tooltip hidden on mobile to prevent ghost tooltip after dropdown close.

Plus menu: Workspace picker replaces the flyout with an inline sub-panel on mobile (back button + search list). Desktop flyout unchanged. modal={false} prevents double-tap when switching between dropdowns.

Model selector: Truncated via shrink + min-w-0 on mobile (flex-based, no fixed max-width), inline provider/context subtext per item, tooltip hidden on mobile. Added open / onOpenChange / onTriggerTouchStart props for external control.

Consistency: All back/close buttons normalized to ArrowLeftIcon. Right panel, sidebar settings, header mobileBack, and workspace sub-panel all match the chat top bar pattern.

Misc polish: Chat tree nodes use select-none + -webkit-touch-callout:none on coarse pointers to suppress the long-press selection/callout on mobile.

Files changed (18)
  • site/src/index.css — mobile dropdown CSS with 3 position variants
  • site/src/utils/mobile.ts — new isBelowMdViewport() helper (<768px)
  • site/src/pages/AgentsPage/AgentChatPageView.tsx — bottom padding pb-3
  • site/src/pages/AgentsPage/AgentCreatePage.tsx — lift chime + webpush state; pass handlers to header and buttons
  • site/src/pages/AgentsPage/AgentsPageView.tsxcontents wrapper + sidebar border-b
  • site/src/pages/AgentsPage/components/AgentChatInput.tsxResizeObserver composer ref, plusMenuView state, inline workspace picker, modal={false}, mobile branching via isBelowMdViewport, bg
  • site/src/pages/AgentsPage/components/AgentCreateForm.tsxorder-last + items-end on mobile
  • site/src/pages/AgentsPage/components/AgentPageHeader.tsx — meatball menu (controlled chime/webpush props), ArrowLeftIcon, order-first, padding, desktop/mobile branching via matchMedia
  • site/src/pages/AgentsPage/components/AgentPageHeader.stories.tsx — new Storybook coverage + play assertions that toggle state stays in sync across breakpoints
  • site/src/pages/AgentsPage/components/ChimeButton.tsx — optional controlled enabled / onToggle props
  • site/src/pages/AgentsPage/components/WebPushButton.tsx — optional controlled webPush / onToggle props
  • site/src/pages/AgentsPage/components/ChatElements/CompactOrgSelector.tsx — full-width dropdown class
  • site/src/pages/AgentsPage/components/ChatElements/ModelSelector.tsx — truncation, inline subtext, tooltip hidden on mobile, new props (open, onOpenChange, onTriggerTouchStart)
  • site/src/pages/AgentsPage/components/ChatTopBar.tsx — full-width dropdown class
  • site/src/pages/AgentsPage/components/ContextUsageIndicator.tsx — full-width dropdown class (mobile branch)
  • site/src/pages/AgentsPage/components/Sidebar/AgentsSidebar.tsxArrowLeftIcon, filter dropdown class, top/bottom fade mask on scroll area, select-none on tree nodes
  • site/src/pages/AgentsPage/components/Sidebar/SidebarTabView.tsxArrowLeftIcon, padding, back button placement
  • site/src/pages/AgentsPage/components/WorkspacePill.tsx — compact icon trigger, tooltip hidden on mobile, full-width dropdown class

🤖 Generated by Coder Agents

- Full-width dropdowns on mobile with dynamic positioning
- Compact workspace pill (icon-only on mobile)
- Model selector truncation with inline subtext
- Meatball menu consolidating header actions
- Inline workspace picker replacing flyout
- Consistent ArrowLeftIcon back buttons
- Mobile layout reordering (header → chat list → input)
- Solid chat input background on mobile
- Right panel back button and padding updates
@jaaydenh
Copy link
Copy Markdown
Contributor

@codex review

Copy link
Copy Markdown

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

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: 8eceec6e2e

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/AgentChatInput.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/AgentChatInput.tsx Outdated
@jaaydenh
Copy link
Copy Markdown
Contributor

@codex review

Copy link
Copy Markdown

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

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: 382b0ac358

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/AgentPageHeader.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/AgentChatInput.tsx Outdated
Copy link
Copy Markdown
Contributor

@jaaydenh jaaydenh left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the dropdown ResizeObserver cleanup and the 640–767px workspace-picker breakpoint mismatch on the current head. Fresh deep review on 382b0ac358 didn’t find any new issues beyond the existing current-head P2 on site/src/pages/AgentsPage/components/AgentPageHeader.tsx, where the duplicated mobile and hidden desktop header actions can drift out of sync across the md breakpoint.

Generated by Coder Agents.

…-view

Made-with: Cursor

# Conflicts:
#	site/src/index.css
#	site/src/pages/AgentsPage/components/AgentChatInput.tsx
@jaaydenh
Copy link
Copy Markdown
Contributor

@codex review

Copy link
Copy Markdown

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

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: a2f0de4bd2

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/AgentChatInput.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/AgentPageHeader.tsx Outdated
@jaaydenh
Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ 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".

@jaaydenh
Copy link
Copy Markdown
Contributor

@codex review

Copy link
Copy Markdown

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

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: d5aa984db8

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/AgentChatInput.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/AgentChatInput.tsx
@jaaydenh
Copy link
Copy Markdown
Contributor

@codex review

@jaaydenh jaaydenh self-assigned this Apr 21, 2026
Copy link
Copy Markdown

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

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: fdabbc8e43

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/ChatElements/ModelSelector.tsx
Comment thread site/src/pages/AgentsPage/components/AgentPageHeader.tsx Outdated
@jaaydenh
Copy link
Copy Markdown
Contributor

@codex review

Copy link
Copy Markdown

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

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: c7a86713d2

ℹ️ 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".

Comment thread site/src/pages/AgentsPage/components/Sidebar/AgentsSidebar.tsx
@coder coder deleted a comment from chatgpt-codex-connector Bot Apr 21, 2026
Copy link
Copy Markdown
Contributor

@DanielleMaywood DanielleMaywood left a comment

Choose a reason for hiding this comment

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

Sorry for the large review.

Main point: This module-full-width-dropdown and mobile-full-width-dropdown-bottom approach is 100% being done at the wrong level. If we're having to apply these to every dropdown then the correct fix is making sure the actual components are mobile friendly.

Comment thread site/src/index.css
Comment on lines +159 to +233
@layer components {
/* Map each stripe variant to a color token so the
pseudo-element rules can stay DRY. */
.navbar-stripe-devel {
--stripe-color: var(--content-warning);
}

.navbar-stripe-rc {
--stripe-color: var(--border-sky);
}

/* Thin stripe bars at the top and bottom edges of the
navbar. Using pseudo-elements keeps the stripes out of
the content area so nav links stay readable. */
.navbar-stripe-devel::before,
.navbar-stripe-devel::after,
.navbar-stripe-rc::before,
.navbar-stripe-rc::after {
content: "";
position: absolute;
left: 0;
right: 0;
height: 4px;
background: repeating-linear-gradient(
-45deg,
transparent,
transparent 4px,
hsl(var(--stripe-color) / 0.5) 4px,
hsl(var(--stripe-color) / 0.5) 8px
);
pointer-events: none;
}

.navbar-stripe-devel::before,
.navbar-stripe-rc::before {
top: 0;
}

.navbar-stripe-devel::after,
.navbar-stripe-rc::after {
bottom: 0;
}

@media (max-width: 767px) {
/*
* Full-width mobile dropdowns. We set a --mobile-dropdown-bottom
* custom property on the chat input container so the dropdown
* position tracks the actual input box, not a hardcoded offset.
*/
[data-radix-popper-content-wrapper]:has(> .mobile-full-width-dropdown) {
position: fixed !important;
left: 1rem !important;
width: calc(100vw - 2rem) !important;
min-width: 0 !important;
transform: none !important;
bottom: var(--mobile-dropdown-bottom, 5rem) !important;
top: auto !important;
}
[data-radix-popper-content-wrapper]:has(> .mobile-full-width-dropdown-top) {
bottom: auto !important;
top: var(--mobile-dropdown-top, 3.5rem) !important;
}
[data-radix-popper-content-wrapper]:has(
> .mobile-full-width-dropdown-top-below-header
) {
bottom: auto !important;
top: 5rem !important;
}
.mobile-full-width-dropdown {
width: 100% !important;
min-width: 0 !important;
max-width: none !important;
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we modifying the index.css btw? I'm not going to reject because of this but I just want to be really careful about us touching this as it can cascade across the entire frontend

side="top"
align="start"
className="w-48 p-1 [&_[role=menuitem]]:text-xs [&_[role=menuitem]]:py-1 [&_svg]:!size-3.5 [&_img]:!size-3.5"
className="mobile-full-width-dropdown mobile-full-width-dropdown-bottom w-48 p-1 [&_[role=menuitem]]:text-xs [&_[role=menuitem]]:py-1 [&_svg]:!size-3.5 [&_img]:!size-3.5"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can see we're introducing classes defined in index.css here? I'm really not too sure this is being done at the correct abstraction level

Comment thread site/src/pages/AgentsPage/components/WorkspacePill.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/WorkspacePill.tsx Outdated
<PopoverContent side="top" className="w-auto max-w-72 px-3 py-2">
<PopoverContent
side="top"
className="mobile-full-width-dropdown mobile-full-width-dropdown-bottom w-auto max-w-72 px-3 py-2"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same classes again

Comment thread site/src/pages/AgentsPage/components/AgentPageHeader.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/AgentPageHeader.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/AgentPageHeader.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/AgentPageHeader.tsx Outdated
<DropdownMenuContent
align="end"
className="[&_[role=menuitem]]:text-[13px]"
className="mobile-full-width-dropdown mobile-full-width-dropdown-top [&_[role=menuitem]]:text-[13px]"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same classes again

@jaaydenh jaaydenh marked this pull request as ready for review April 21, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants