Skip to content

1786 make UI mobile friendly - #2407

Merged
grzanka merged 10 commits into
masterfrom
1786-make-ui-mobile-friendly
Nov 26, 2026
Merged

grzanka merged 10 commits into
masterfrom
1786-make-ui-mobile-friendly

Conversation

@cnuart

@cnuart cnuart commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements to the application's responsive design, focusing on enhancing the mobile user experience. The main changes include adding a mobile navigation drawer with a hamburger menu, updating grid layouts and panels to adjust their positioning and sizing on smaller screens, and improving text wrapping and alignment for better readability. These updates ensure the interface remains user-friendly and visually coherent across different device sizes.

Mobile navigation and layout improvements:

  • Added a mobile navigation drawer using MUI's Drawer and a floating hamburger IconButton that appears only on mobile; the navigation panel now overlays the content on small screens and closes when a tab is selected or the backdrop is clicked. (src/WrapperApp/WrapperApp.tsx, [1] [2] [3] [4]
  • Updated the main grid layout (StyledAppGrid) to adjust row and column structure based on screen size, allowing sidebars to drop below content on mobile instead of remaining as fixed columns. (src/WrapperApp/WrapperApp.tsx, src/WrapperApp/WrapperApp.tsxL40-R64)

Responsive sidebar and panel adjustments:

  • Modified the editor and simulations sidebars to move below the main content on mobile, using responsive gridRow settings. (src/WrapperApp/WrapperApp.tsx, [1] [2]
  • Improved the HeaderPanel and its child components to wrap and center content on mobile, ensuring menus and titles are accessible and well-aligned. (src/WrapperApp/components/Header/HeaderPanel.tsx, src/WrapperApp/components/Header/HeaderPanel.tsxR21-R43)
  • Enhanced the ResultsPanel layout to stack controls vertically on small screens and horizontally on larger ones, improving usability. (src/WrapperApp/components/Results/ResultsPanel.tsx, src/WrapperApp/components/Results/ResultsPanel.tsxR112-R115)

Text and content wrapping:

  • Improved text wrapping and max-width for the editor title bar and simulator panels, preventing content overflow and ensuring readability on all devices. (src/ThreeEditor/components/Editor/Header/EditorTitlebar.tsx, [1]; src/WrapperApp/components/Panels/ExamplePanel.tsx, [2]

@grzanka
grzanka requested a balanced review from Copilot September 1, 2026 18:19
@grzanka grzanka linked an issue Sep 1, 2026 that may be closed by this pull request
@grzanka
grzanka marked this pull request as ready for review September 1, 2026 18:23

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.

🔵 Needs a closer look

These are visual responsive-layout changes involving multi-breakpoint CSS grid line juggling whose correctness can only be reliably confirmed by human review on actual devices.

Pull request overview

This PR makes the YAPTIDE web UI responsive for mobile and smaller viewports. The core layout in WrapperApp uses a CSS grid with fixed drawer/content/sidebar columns; the change introduces breakpoint-based overrides so that, on small screens, the desktop navigation drawer is replaced by an off-canvas overlay opened via a hamburger button, and the sidebars flow below the main content instead of remaining fixed-width columns. Several header, results, and example panels get responsive flex/width adjustments to avoid overflow on narrow screens.

Changes:

  • Add a mobile navigation experience in WrapperApp (fixed hamburger IconButton + Drawer overlay) and responsive grid template columns/rows via md/lg breakpoints, gated by useMediaQuery(down('md')).
  • Move the editor and simulation sidebars to a stacked row below the content on mobile using responsive gridRow values.
  • Apply responsive flex/width/typography tweaks in HeaderPanel, EditorTitlebar, ResultsPanel, and ExamplePanel to prevent overflow on small screens.
File summaries
File Description
src/WrapperApp/WrapperApp.tsx Adds mobile nav overlay + hamburger, responsive grid columns/rows, and stacked sidebars below content on mobile.
src/WrapperApp/components/Header/HeaderPanel.tsx Allows the header to wrap and centers items on small screens via responsive flex props.
src/ThreeEditor/components/Editor/Header/EditorTitlebar.tsx Lets the project title wrap and caps its width per breakpoint to avoid overflow.
src/WrapperApp/components/Results/ResultsPanel.tsx Stacks the results header row vertically on xs with responsive alignment/gap.
src/WrapperApp/components/Panels/ExamplePanel.tsx Makes example cards full-width with a 500px max so they no longer overflow narrow viewports.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/WrapperApp/WrapperApp.tsx Resolved
@grzanka

grzanka commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Review

What it does: On screens narrower than md, the fixed nav column is replaced by a pull-out menu that opens from a floating hamburger button. The sidebars move below the main content. The header, title, results and example panels now wrap or stack instead of overflowing.

Issues

  1. Merge conflicts, and the build will probably break after the rebase.

    • master now uses @mui/material ^9.5.0.
    • In v9, the Drawer type no longer has PaperProps; only slotProps.paper is defined.
    • The PR uses PaperProps={{ elevation: 1, sx: … }} (WrapperApp.tsx), so it will likely fail type-checking after the rebase. It should use slotProps={{ paper: { elevation: 1, sx: … } }}.
  2. The desktop nav briefly shows on mobile at load.

    • useMediaQuery returns false on its first render by default, so phones render the desktop nav first and then swap to the mobile layout.
    • Fix: pass useMediaQuery(theme.breakpoints.down('md'), { noSsr: true }), or hide the desktop nav with responsive display instead of rendering it conditionally.
  3. The two files switch layouts at different screen widths.

    • WrapperApp switches at md, but HeaderPanel and EditorTitlebar switch at lg.
    • Between md and lg (900–1200px), the page keeps the desktop layout (200px nav + content + 370px sidebar) while the header already wraps and centres.
    • The down('lg') block only changes the row heights. Its comment says the sidebar "merges into the content column", but that actually happens only below md. Either the comment or the breakpoint is wrong.
  4. The magic number 180 in minmax(calc(100vh - 180px), 1fr). It needs a named constant or a comment explaining what it stands for.

  5. The hamburger button is fixed at the bottom-left (bottom: 20, left: 10, zIndex: drawer + 1). It sits above all content, so it will likely cover:

    • the 3D viewport's corner controls in the editor
    • the start of the stacked sidebar content (editor and simulation forms) when scrolled to the bottom

    A top-left button inside the header row would be the more standard spot and wouldn't cover content.

  6. The mobile editor sidebar may stretch too tall. On mobile the sidebar goes into a row sized auto. EditorSidebar was built to fill a full-height column with its own scrolling, so on a phone it could grow very tall or lose its internal scrolling. This needs checking on a real device.

  7. Minor issues:

    • open and setOpen are still passed to NavPanel in the mobile menu, but NavPanel never reads them (it hardcodes open={true}). This is harmless, and the props could be dropped from NavPanelProps in a follow-up.
    • The comment on MOBILE_NAV_DRAWER_WIDTH says it matches the desktop column's 200px, but the value is duplicated, not shared. A single constant used in both places would keep them in sync.
    • EditorTitlebar's maxWidth: { xs: '40vw', lg: '60vw' } caps the title at 60% of the window even on wide desktops. On desktop the layout used to size it, so this could change how long titles look there.
    • The PR has no screenshots or tests. For a layout PR, before/after screenshots at three widths (about 375, 1000 and 1440px) would make review much easier.

Good

  • The ExamplePanel change (width: 100%; maxWidth: 500px) and the ResultsPanel stacking are small, safe fixes.
  • Closing the mobile menu after picking a tab (handleMobileNavChange) is good UX.
  • Using named grid lines for the extra mobile row fits the existing grid layout well.

Verdict: The approach is reasonable. It needs a rebase onto master with the slotProps fix (point 1), and points 2–3 should be fixed before merging. Points 5–6 need a manual check on a phone.

🤖 Generated with Claude Code

cnuart added 2 commits November 20, 2026 12:40
…-friendly

# Conflicts:
#	src/ThreeEditor/components/Editor/Header/EditorTitlebar.tsx
@cnuart

cnuart commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Fixed:

  1. PaperProps → slotProps={{ paper: { … } }}: updated after merging master; tsc --noEmit is clean.
  2. Replaced the magic 180 with a named MOBILE_CONTENT_VERTICAL_OFFSET plus a comment explaining what it accounts for.
  3. Removed the unused open/setOpen from NavPanelProps (and the now-dead state in WrapperApp).
  4. Introduced a single NAV_DRAWER_WIDTH constant shared by the desktop grid column and the mobile overlay.
  5. EditorTitlebar now caps the title only below lg (maxWidth: { xs: '40vw', lg: 'none' }), restoring the previous desktop sizing.

@grzanka
grzanka added this pull request to the merge queue Nov 26, 2026
Merged via the queue into master with commit 3b25f3f Nov 26, 2026
10 checks passed
@grzanka
grzanka deleted the 1786-make-ui-mobile-friendly branch November 26, 2026 18:31
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.

Make UI mobile friendly

3 participants