Skip to content

mobile: styling updates and smoother animation#312441

Merged
rebornix merged 4 commits intomainfrom
rebornix/growing-dingo
Apr 24, 2026
Merged

mobile: styling updates and smoother animation#312441
rebornix merged 4 commits intomainfrom
rebornix/growing-dingo

Conversation

@rebornix
Copy link
Copy Markdown
Member

The previous code wrote inline position/top/left/width/height/zIndex on the sidebar Part container from layoutMobileSidebar(). Those styles were applied AFTER the grid had already made the wrapper visible and the browser had painted one frame, producing a visible snap on every toggle.

The geometry was redundant with the existing layout anyway: the mobile top bar is a flex sibling above the grid, so the grid (and therefore the .split-view-view wrapper which fills the grid via CSS) is already correctly positioned below the top bar. The Part fills the wrapper. No inline positioning is needed.

Drop the inline style writes; keep the mobile-overlay-sidebar class toggle (used for background) and the explicit sidebarPart.layout() call so the Part's internal sizing matches the drawer dimensions even on the first paint.

Remove 22 !important declarations from mobileChatShell.css where the
.phone-layout class already wins by specificity. Kept !important only
where it fights SplitView inline styles, Part.layoutContents inline
sizing, or an equal-specificity desktop rule. Added a top-of-file
policy comment documenting the three legitimate reasons to use
!important here so future additions don't accrete out of habit.

Verified against a 393x852 iPhone emulation with the mock agent host:
welcome screen, sidebar overlay, session opening, and chat input
layout are unchanged.

Also updated the vscode-dev-workbench skill to call out that npm run
dev must run in the vscode-dev folder (not vscode) and that the mock
agent host is a separate process that must be started in addition to
the dev server.
Replace the hamburger icon (Codicon.menu) in the mobile titlebar with
the agents-app sidebar toggle icon (layoutSidebarLeftOff /
layoutSidebarLeft), matching desktop/web. The icon flips based on
SideBarVisibleContext, and the aria-label toggles between "Open
sessions" and "Close sessions".

Make the mobile sidebar cover the full viewport width below the top
bar instead of an 85%/360px drawer with scrim. The toggle button in
the top bar stays visible and is the dismiss affordance. Removes the
no-longer-needed backdrop element and its CSS.
The previous code wrote inline position/top/left/width/height/zIndex
on the sidebar Part container from layoutMobileSidebar(). Those styles
were applied AFTER the grid had already made the wrapper visible and
the browser had painted one frame, producing a visible snap on every
toggle.

The geometry was redundant with the existing layout anyway: the
mobile top bar is a flex sibling above the grid, so the grid (and
therefore the .split-view-view wrapper which fills the grid via CSS)
is already correctly positioned below the top bar. The Part fills
the wrapper. No inline positioning is needed.

Drop the inline style writes; keep the mobile-overlay-sidebar class
toggle (used for background) and the explicit sidebarPart.layout()
call so the Part's internal sizing matches the drawer dimensions
even on the first paint.
Copilot AI review requested due to automatic review settings April 24, 2026 21:56
@rebornix rebornix self-assigned this Apr 24, 2026
@rebornix rebornix changed the title mobile: fix one-frame snap when toggling sidebar drawer mobile: styling updates and smoother animation Apr 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes post-layout inline geometry writes for the sessions mobile sidebar drawer to prevent a one-frame “snap” during open/close, shifting sizing/positioning responsibility back to CSS while ensuring the sidebar Part still lays out correctly on first paint.

Changes:

  • Drops inline position/top/left/width/height/zIndex updates from layoutMobileSidebar() and relies on CSS-driven geometry.
  • Updates the mobile titlebar “hamburger” to reflect sidebar open/closed state via SideBarVisibleContext (icon + aria-label).
  • Refines phone-layout CSS (including a documented !important policy) and updates sidebar drawer overlay styling.
Show a summary per file
File Description
src/vs/sessions/browser/workbench.ts Removes inline sidebar drawer geometry writes and backdrop handling; keeps explicit sidebar layout() to match CSS sizing.
src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts Makes the sidebar toggle icon/label react to SideBarVisibleContext.
src/vs/sessions/browser/parts/mobile/mobileChatShell.css Documents !important usage policy and reduces !important usage in phone-layout rules.
src/vs/sessions/browser/parts/media/sidebarPart.css Adjusts phone sidebar overlay drawer styling and removes JS-driven backdrop styling.
.github/skills/vscode-dev-workbench/SKILL.md Clarifies local dev server/mock-agent-host startup instructions for Agents window testing.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/browser/workbench.ts
Comment thread src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts
@rebornix rebornix marked this pull request as ready for review April 24, 2026 22:42
@rebornix rebornix merged commit f6efdfe into main Apr 24, 2026
26 checks passed
@rebornix rebornix deleted the rebornix/growing-dingo branch April 24, 2026 23:44
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 24, 2026
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