Skip to content

basic mobile design#186

Open
interim17 wants to merge 1 commit intosmall-screenfrom
mobile
Open

basic mobile design#186
interim17 wants to merge 1 commit intosmall-screenfrom
mobile

Conversation

@interim17
Copy link
Contributor

A more complete fix than #185

If the gang doesn't want to make changes late in the game, I'll just close this, but it's a much nicer look/feel.

Style tweaks all around, big change is a hamburger menu for the recipe panel.

Screenshot 2026-03-19 at 5 09 25 PM Screenshot 2026-03-19 at 5 14 38 PM Screenshot 2026-03-19 at 5 14 44 PM

@interim17 interim17 requested a review from Copilot March 20, 2026 00:25
@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 31.51% 663 / 2104
🔵 Statements 31.51% 663 / 2104
🔵 Functions 39.42% 41 / 104
🔵 Branches 72.72% 144 / 198
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/App.tsx 0% 0% 0% 0% 1-9, 18-23, 25, 27-28, 30-42, 44, 46-48, 50-56, 58-71, 73-117, 119-127, 129-165, 167-172, 174-181, 183-188, 190-219, 221-228, 230-241, 243, 245
src/components/StatusBar/index.tsx 0% 0% 0% 0% 1-7, 9-13, 24-25, 27-28, 32-37, 39-42, 44-48, 50-56, 58-59, 62-71, 73-81, 83-90, 92-96, 98-102, 104, 106
Generated in workflow #246

@github-actions
Copy link

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://AllenCell.github.io/cellpack-client/pr-preview/pr-186/

Built to branch gh-pages at 2026-03-20 00:25 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
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

Improves the app’s small-screen/mobile experience by introducing a hamburger-driven recipe panel, alongside responsive style refinements, and adds a dev-server host setting to ease mobile testing on LAN.

Changes:

  • Adds a small-screen hamburger menu / slide-in overlay for the recipe (PackingInput) panel.
  • Refines responsive styling for header/footer/status bar and the small-screen warning layout.
  • Updates Vite dev server configuration to bind to all network interfaces.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
vite.config.ts Exposes dev server on network (server.host: true) to support testing on mobile devices.
src/App.tsx Implements small-screen conditional layout and hamburger menu overlay/backdrop behavior.
src/App.css Adds styles for mobile menu overlay/backdrop and adjusts responsive header/footer/input sizing.
src/components/SmallScreenWarning/style.css Adjusts warning overlay layout/centering for small screens.
src/components/StatusBar/index.tsx Simplifies wrapper class usage for status bar layout.
src/components/StatusBar/style.css Updates status bar spacing and small-screen behavior.
package.json Adds @ant-design/icons dependency required by new/expanded icon usage.

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

Comment on lines +209 to +213
<PackingInput startPacking={async (...args) => {
const result = startPacking(...args);
setTimeout(() => setMenuOpen(false), 400);
return result;
}} />
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The inline startPacking={async (...args) => ...} loses the parameter types and relies on rest/any[], which can cause noImplicitAny/strict typing issues and makes the callsite harder to understand. Consider spelling out the three parameters (or typing the rest tuple) and awaiting startPacking if you intend to react to completion.

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +50
.mobile-menu-backdrop {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 499;
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

position: absolute for the mobile menu backdrop/overlay can scroll with the document and may fail to cover the viewport if the page scrolls. For an overlay menu, position: fixed is typically needed so it reliably covers the viewport and blocks background interaction.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +7
inset: 0;
width: 100svw;
height: 100svh;
display: flex;
align-items: center;
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

With inset: 0 this element is intended to be a full-viewport overlay, but constraining the overlay itself later (via max-width/margin) prevents it from actually filling the viewport and can break centering/click-blocking behavior. Consider keeping the container full-screen and instead constraining the inner alert.

Copilot uses AI. Check for mistakes.
Comment on lines +176 to +180
<Button
type="text"
icon={menuOpen ? <CloseOutlined /> : <MenuOutlined />}
onClick={() => setMenuOpen(!menuOpen)}
className="menu-toggle"
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The icon-only menu toggle button should have an accessible name/state for screen readers (e.g., aria-label like "Open menu"/"Close menu" and aria-expanded={menuOpen}). Without this, assistive tech users won’t know what the control does.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +10
max-width: 320px;
margin: 0 16px;
justify-content: center;
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

max-width: 320px + margin: 0 16px on the overlay container conflicts with the full-screen overlay intent and can leave most of the screen uncovered/click-through. Prefer applying width constraints to .ant-alert (or a wrapper) and use padding on the full-screen container for side gutters.

Copilot uses AI. Check for mistakes.
<h2 className="header-title">cellPACK Studio</h2>
<Button
type="text"
icon={<CloseOutlined />}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

This icon-only close button in the mobile menu header also needs an accessible label (e.g., aria-label="Close menu").

Suggested change
icon={<CloseOutlined />}
icon={<CloseOutlined />}
aria-label="Close menu"

Copilot uses AI. Check for mistakes.
<Button
type="text"
icon={menuOpen ? <CloseOutlined /> : <MenuOutlined />}
onClick={() => setMenuOpen(!menuOpen)}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

Using setMenuOpen(!menuOpen) can read a stale value if React batches updates; using the functional form (setMenuOpen(prev => !prev)) avoids that class of bugs and is safer for toggle handlers.

Suggested change
onClick={() => setMenuOpen(!menuOpen)}
onClick={() => setMenuOpen(prev => !prev)}

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +67
position: absolute;
top: 0;
left: 0;
width: 85%;
max-width: 360px;
height: 100%;
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

Same issue here: position: absolute + height: 100% depends on the containing block height. Switching to position: fixed (with inset: 0 / top: 0) avoids cases where the menu overlay doesn’t fully cover the viewport.

Suggested change
position: absolute;
top: 0;
left: 0;
width: 85%;
max-width: 360px;
height: 100%;
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: 85%;
max-width: 360px;

Copilot uses AI. Check for mistakes.
},
plugins: [react()],
server: {
host: true,
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

server.host: true makes the Vite dev server listen on all network interfaces, which can unintentionally expose the dev build to other machines on the network. Consider gating this behind an env var/CLI flag (or documenting it) so the default remains localhost-only.

Suggested change
host: true,
// Bind to all network interfaces only when explicitly enabled via env var.
// By default, Vite will bind to localhost for safer local development.
host:
process.env.VITE_BIND_ALL === 'true' ||
process.env.VITE_HOST_ALL === 'true'
? true
: 'localhost',

Copilot uses AI. Check for mistakes.
Comment on lines +196 to +197
className={`mobile-menu-backdrop ${menuOpen ? "open" : ""}`}
onClick={() => setMenuOpen(false)}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The backdrop is a clickable <div> but isn’t keyboard accessible. To avoid trapping keyboard-only users, consider using a semantic control (or adding role="button", tabIndex={0}, and an onKeyDown handler for Enter/Escape) so the menu can be dismissed without a pointer.

Suggested change
className={`mobile-menu-backdrop ${menuOpen ? "open" : ""}`}
onClick={() => setMenuOpen(false)}
className={`mobile-menu-backdrop ${menuOpen ? "open" : ""}`}
role="button"
tabIndex={0}
aria-label="Close menu"
onClick={() => setMenuOpen(false)}
onKeyDown={(event) => {
if (
event.key === "Enter" ||
event.key === " " ||
event.key === "Escape"
) {
setMenuOpen(false);
}
}}

Copilot uses AI. Check for mistakes.
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.

2 participants