Skip to content

feat(ui): mobile-first responsive design improvements#2757

Merged
rafavalls merged 7 commits intomainfrom
rafavalls/mobile-first-ui
Mar 19, 2026
Merged

feat(ui): mobile-first responsive design improvements#2757
rafavalls merged 7 commits intomainfrom
rafavalls/mobile-first-ui

Conversation

@rafavalls
Copy link
Collaborator

@rafavalls rafavalls commented Mar 18, 2026

What is this contribution about?

Comprehensive mobile-first UI refactor to improve usability and layout across mobile, tablet, and desktop devices. The changes implement responsive spacing, adaptive components, and mobile-optimized interactions throughout the chat interface, navigation, and admin pages.

Key Changes

  • Viewport Configuration: Added mobile viewport meta tag for proper scaling and touch behavior
  • Responsive Spacing: Applied sm: and md: Tailwind breakpoints for adaptive spacing across layouts
  • Adaptive Dialogs: Modal dialogs switch to drawer component on mobile for better UX
  • Mobile Keyboard Handling: Skip autofocus on mobile to prevent unwanted keyboard popups
  • Responsive Widths: Constrain popover widths to viewport with collision padding on mobile
  • Touch Optimization: Added touch-action CSS for smooth scrolling on mobile
  • Visibility Adjustments: Hide non-essential UI elements on small screens (e.g., focus hints, dense layouts)

How to Test

  1. Open the application in mobile browser (or use DevTools device emulation)
  2. Verify chat input area displays correctly with responsive min-height
  3. Test popover/modal dialogs open as drawers on mobile, dialogs on desktop
  4. Check that spacing is appropriate for small screens (no overflow or crowding)
  5. Verify sidebar and navigation adapt properly to viewport width
  6. Test touch interactions and scrolling performance

Screenshots/Demonstration

Visual changes are responsive - test in multiple viewport sizes:

  • Mobile (< 640px): Compact layout with touch-friendly spacing
  • Tablet (640px-1024px): Medium layout
  • Desktop (> 1024px): Full layout with all UI hints visible

Summary by cubic

Mobile-first refactor that improves layout, touch interactions, and navigation across the app on phones and tablets. Desktop behavior stays the same while chat, settings, sidebar, and org pages become responsive.

  • New Features

    • Added mobile viewport meta tag and switched dialogs to drawers on mobile using @deco/ui Drawer (model picker, connect/share, settings, inspectors, connections/agents, home chat).
    • Mobile behaviors via useIsMobile: skip autofocus on popovers, larger tap targets, auto-close sidebar on nav, and mobile headers/back controls in settings and project settings; popovers/menus fit the viewport with collision padding and dvh/dvw, scroll areas use [touch-action:pan-y] and mobile max-heights.
    • Responsive grids/spacing across pages (KPI rows stack, store grids adapt, auth form compacts); hover-only actions are hidden on small screens; persisted agent connections accordion open state in Virtual MCP details via localStorage; @deco/ui tweaks—taller bottom Drawer cap (95vh), faster Sheet animations, smaller default Input/Textarea.
  • Bug Fixes

    • Monitoring dashboard grid row height now derives from viewport width (>=1024px → 5 cols, else 2) and recalculates on window resize to keep tiles square.
    • Settings modal on mobile now opens the requested section directly (e.g., open("org.billing")) instead of hiding behind the sidebar.
    • Moved localStorage write for agent connections accordion state from reducer to Collapsible onOpenChange to avoid side effects and double-invocation issues.
    • Replaced template-literal classNames with cn() in settings and project settings to satisfy lint rules and unblock CI.

Written for commit c066b40. Summary will update on new commits.

@github-actions
Copy link
Contributor

🧪 Benchmark

Should we run the Virtual MCP strategy benchmark for this PR?

React with 👍 to run the benchmark.

Reaction Action
👍 Run quick benchmark (10 & 128 tools)

Benchmark will run on the next push after you react.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

Release Options

Should a new version be published when this PR is merged?

React with an emoji to vote on the release type:

Reaction Type Next Version
👍 Prerelease 2.179.3-alpha.1
🎉 Patch 2.179.3
❤️ Minor 2.180.0
🚀 Major 3.0.0

Current version: 2.179.2

Deployment

  • Deploy to production (triggers ArgoCD sync after Docker image is published)

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 41 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/mesh/src/web/components/monitoring/dashboard-view.tsx">

<violation number="1" location="apps/mesh/src/web/components/monitoring/dashboard-view.tsx:454">
P2: Responsive column count was updated to 2 on small screens, but row-height math still hardcodes 5 columns, causing incorrect widget sizing on mobile.</violation>
</file>

<file name="apps/mesh/src/web/components/settings-modal/index.tsx">

<violation number="1" location="apps/mesh/src/web/components/settings-modal/index.tsx:105">
P2: Direct section opens on mobile are hidden behind the sidebar because `mobileShowContent` starts false and is only set true via sidebar navigation.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/mesh/src/web/components/monitoring/dashboard-view.tsx">

<violation number="1" location="apps/mesh/src/web/components/monitoring/dashboard-view.tsx:459">
P2: This column-count check is using the container width, but the `lg:grid-cols-5` breakpoint is based on viewport width. On narrower desktop containers, the row height will be calculated for 2 columns while CSS is rendering 5.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

rafavalls and others added 5 commits March 19, 2026 10:52
Optimizations for mobile and tablet devices across chat, sidebar, and page layouts:
- Add viewport meta tag for proper mobile scaling
- Use responsive spacing with sm: and md: breakpoints
- Implement responsive modal/drawer patterns (dialog on desktop, drawer on mobile)
- Add touch-action optimizations for better scrolling on mobile
- Improve mobile keyboard handling to prevent unwanted popups
- Constrain popover widths to viewport with collision padding
- Adjust text visibility and spacing for smaller screens
- Use useIsMobile hook for device-specific behavior

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
…bile

- dashboard-view: row-height ResizeObserver now derives column count from
  container width (>=1024px → 5 cols, else 2 cols) so gap math matches the
  responsive grid instead of always assuming 5 columns
- settings-modal: sync mobileShowContent with isOpen transitions so direct
  section opens (e.g. open("org.billing") from inbox) show the content pane
  on mobile instead of being hidden behind the sidebar

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace template literal className interpolations with cn() calls in
settings-modal and project-settings layout to satisfy the
require-cn-classname lint rule and unblock CI.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… calculation

The column-count check was using container width, but lg:grid-cols-5
uses viewport width. Switch to window.innerWidth to stay in sync with
the Tailwind breakpoint, and add a window resize listener so row height
recalculates when the viewport crosses the 1024px threshold.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@rafavalls rafavalls force-pushed the rafavalls/mobile-first-ui branch from d53e54f to 9df57da Compare March 19, 2026 13:52
Open/close state is now remembered across agent navigations so if you
expand the Connections section it stays expanded when switching agents.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/mesh/src/web/components/details/virtual-mcp/index.tsx">

<violation number="1" location="apps/mesh/src/web/components/details/virtual-mcp/index.tsx:84">
P2: Keep the reducer pure; persisting to `localStorage` here can make the connections toggle throw before state updates apply.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

…dler

Reducers must be pure; side effects in reducers can cause bugs when
React calls the reducer multiple times (e.g. in Strict Mode). Move the
localStorage.setItem call to the Collapsible onOpenChange callback.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@rafavalls rafavalls merged commit 04de8b7 into main Mar 19, 2026
15 checks passed
@rafavalls rafavalls deleted the rafavalls/mobile-first-ui branch March 19, 2026 14:50
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.

1 participant