Skip to content

fix(sandbox): restore mobile scroll behavior on details page#347

Merged
ben-fornefeld merged 3 commits into
mainfrom
cursor/81e2453a
May 27, 2026
Merged

fix(sandbox): restore mobile scroll behavior on details page#347
ben-fornefeld merged 3 commits into
mainfrom
cursor/81e2453a

Conversation

@ben-fornefeld

@ben-fornefeld ben-fornefeld commented May 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Restore the mobile scroll behavior on the sandbox details page that broke in refactor(dashboard): move tabs to route segments #317 (refactor(dashboard): move tabs to route segments). The sandbox details header can scroll away again, the tab bar pins at the top, and the tab content fills the remaining viewport (100svh − navbar − statusbar − tabbar) perfectly.
  • Replace the tab list with a Select dropdown on mobile (opt-in, scoped to this layout only). The desktop TabsList with the orange active-tab indicator is unchanged.
  • Inline the kill button (tabsHeaderAccessory) on the same row as the Select on mobile, flush to the right edge, with a continuous bottom-border line spanning the full width.

Implementation notes

  • <Tabs> is now the mobile scroll container (max-md:overflow-y-auto). An inner wrapper uses max-md:h-full (= 100% of the scroll container) plus flex flex-col so the content area derives its height from the scroll container via flex-1 instead of subtracting hardcoded chrome heights — no magic numbers.
  • max-md:shrink-0 on header / accessory / inner wrapper prevents flex children from being squished, so total content exceeds the container and triggers overflow scroll.
  • Mobile SelectTrigger uses <div> (not <span>) for the icon+label so it doesn't match [&>span]:line-clamp-1 (which would have stacked them vertically).
  • The accessory wrapper takes max-md:flex-1 max-md:justify-end and carries the border-b so the bottom line stays continuous across the full row width on both breakpoints.

Rebuild the sandbox details layout so the page header can scroll away on
mobile, the tab bar pins at the top, and the tab content fills the
remaining viewport. Replace the tab list with a Select on mobile and
keep the kill button inline with it.
@cla-bot cla-bot Bot added the cla-signed label May 27, 2026
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment May 27, 2026 9:16pm
web-juliett Ready Ready Preview, Comment May 27, 2026 9:16pm

Request Review

@cursor

cursor Bot commented May 27, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Scoped UI/layout changes to sandbox details and an optional DashboardTabsList variant; other dashboard tabs keep the default behavior.

Overview
Fixes mobile layout on the sandbox details page after the route-segment tabs refactor: the page scrolls again (header can leave the viewport), the tab row sticks at the top, and tab content uses flex to fill the remaining height instead of hard-coded viewport math.

Adds an opt-in mobileVariant="select" on DashboardTabsList (used only in sandbox layout): on max-md, horizontal tabs become a dropdown that navigates via router.push, with headerAccessory (e.g. kill) on the same row and a full-width bottom border; desktop tabs and the orange indicator are unchanged.

SandboxLayout wraps header, tabs, and children in nested flex containers (max-md:overflow-y-auto, shrink-0, flex-1) so only that page picks up the new behavior.

Reviewed by Cursor Bugbot for commit 23746af. Bugbot is set up for automated code reviews on this repo. Configure here.

…bsList

Make the mobile dropdown opt-in via a `mobileVariant: 'tabs' | 'select'`
prop so it can be reused by other tab lists. Sandbox details layout now
consumes DashboardTabsList again instead of inlining the tab and select
primitives.
Copilot AI review requested due to automatic review settings May 27, 2026 20:27

Copilot AI left a comment

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.

Pull request overview

Restores expected mobile scrolling/pinning behavior on the sandbox details page after the route-segment tab refactor, and introduces an optional mobile-only tab selector UI for this layout.

Changes:

  • Add an opt-in mobileVariant="select" mode to DashboardTabsList to render tabs as a Select on mobile while keeping the desktop tab list unchanged.
  • Rework the sandbox details layout structure to make the tabs area the mobile scroll container and keep the tab bar sticky while allowing the header to scroll away.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/ui/dashboard-tabs.tsx Adds mobileVariant and implements a mobile Select-based tab switcher while preserving existing desktop tabs behavior.
src/features/dashboard/sandbox/layout.tsx Adjusts layout flex/overflow/sticky structure and enables the new mobile select variant for sandbox details tabs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ui/dashboard-tabs.tsx
@ben-fornefeld ben-fornefeld merged commit b9d6672 into main May 27, 2026
15 checks passed
@ben-fornefeld ben-fornefeld deleted the cursor/81e2453a branch May 27, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants