Feat: Enhance mobile portrait UI for no-scroll experience#3
Merged
Conversation
This commit redesigns the user interface for mobile portrait view to ensure all primary sections (board, captured pieces, game info/actions) are accessible without requiring the main page to scroll. The desktop layout remains unchanged.
Key changes include:
1. **Compact Captured Pieces for Mobile:**
* `CapturedPiecesDisplay.tsx` now uses responsive styling (text size, padding, gaps) to be significantly more compact on smaller screens.
2. **Toggleable Mobile Info Overlay:**
* Introduced `MobileInfoOverlay.tsx`, a new component that appears as an overlay on mobile screens.
* This overlay contains the game status message, `NotationDisplay` (move history), and the "Reset Game" button.
* The overlay itself is scrollable if its content is long.
* A new "Info" button (icon) in the header (visible only on mobile) toggles this overlay.
* State for overlay visibility (`isInfoOverlayVisible`) and a toggle handler (`toggleInfoOverlay`) were added to `App.tsx`.
3. **Revised Mobile Layout in `AppLayout.tsx`:**
* On mobile screens (smaller than `lg`):
* The two desktop sidebars (`leftSidebarContent` and `rightSidebarContent`) are now hidden.
* Captured pieces (using the compact `CapturedPiecesDisplay`) are rendered directly above and below the chessboard.
* The layout order on mobile is: Black's Captured Pieces -> Chessboard -> White's Captured Pieces.
* The desktop three-column layout is preserved for `lg` screens and up.
* Props passed from `App.tsx` to `AppLayout.tsx` were updated to support this new structure (e.g., passing raw captured piece data).
4. **Board Area Refinements for Mobile:**
* Padding around the chessboard wrapper in `App.tsx` (passed as `mainContent`) is now responsive (reduced on smaller screens).
* The main layout gap in `AppLayout.tsx` is also responsive.
* The existing smallest square size (`w-10 h-10`) was deemed adequate after these padding adjustments.
5. **Responsiveness Review:**
* A thorough code review confirmed that responsive classes are applied correctly and the intended layouts for mobile and desktop are achieved.
These changes significantly improve the user experience on mobile portrait devices by providing a dedicated, non-scrolling interface for the core application content.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit redesigns the user interface for mobile portrait view to ensure all primary sections (board, captured pieces, game info/actions) are accessible without requiring the main page to scroll. The desktop layout remains unchanged.
Key changes include:
Compact Captured Pieces for Mobile:
CapturedPiecesDisplay.tsxnow uses responsive styling (text size, padding, gaps) to be significantly more compact on smaller screens.Toggleable Mobile Info Overlay:
MobileInfoOverlay.tsx, a new component that appears as an overlay on mobile screens.NotationDisplay(move history), and the "Reset Game" button.isInfoOverlayVisible) and a toggle handler (toggleInfoOverlay) were added toApp.tsx.Revised Mobile Layout in
AppLayout.tsx:lg):leftSidebarContentandrightSidebarContent) are now hidden.CapturedPiecesDisplay) are rendered directly above and below the chessboard.lgscreens and up.App.tsxtoAppLayout.tsxwere updated to support this new structure (e.g., passing raw captured piece data).Board Area Refinements for Mobile:
App.tsx(passed asmainContent) is now responsive (reduced on smaller screens).AppLayout.tsxis also responsive.w-10 h-10) was deemed adequate after these padding adjustments.Responsiveness Review:
These changes significantly improve the user experience on mobile portrait devices by providing a dedicated, non-scrolling interface for the core application content.