Add Modern UI and Cross-Platform Mobile Support#1
Open
vaibhavmannq wants to merge 9 commits intoPOSiTiiiV:mainfrom
Open
Add Modern UI and Cross-Platform Mobile Support#1vaibhavmannq wants to merge 9 commits intoPOSiTiiiV:mainfrom
vaibhavmannq wants to merge 9 commits intoPOSiTiiiV:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the Minesweeper UI with a dark flat theme and adds cross-platform mobile support by introducing dynamic configurations and rendering logic.
- Updated color palettes, tile/border radii, fonts, and button styles for a contemporary look.
- Added mobile detection and platform-adaptive constants to adjust grid dimensions, padding, and rendering.
- Refactored drawing methods in
tile.py,grid.py, andgame.pyto use new constants and responsive layouts; simplifiedmain.pyargument parsing.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| minesweeper/tile.py | Replaced image blits with vector drawing for tiles and flags. |
| minesweeper/grid.py | Switched to modern palette and minimal spacing in draw_grid. |
| minesweeper/game.py | Introduced IS_MOBILE detection, adaptive constants, refactored layouts and UI methods. |
| main.py | Simplified CLI parsing and added --mobile flag support. |
Comments suppressed due to low confidence (3)
minesweeper/game.py:23
- The code references
sys.argvfor mobile detection butsysis not imported in this file, which will cause a NameError. Addimport sysat the top.
'--mobile' in sys.argv or
main.py:8
- The code uses
argparse(and latersys) in this file without importing these modules, which will cause NameErrors. Addimport argparseandimport sysat the top ofmain.py.
parser = argparse.ArgumentParser(description='Run Minesweeper game')
minesweeper/game.py:564
- The updated
get_tile_at_posno longer accounts for the horizontal grid offset, but callers still expect positioning to considerGRID_X_OFFSET. This will miscompute columns when the grid is centered. Reintroduce offset handling or adjust callers accordingly.
def get_tile_at_pos(mouse_x: int, mouse_y: int, tile_size: int, buffer: int) -> tuple[int, int]:
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
🎨 Modern UI Redesign
📱 Cross-Platform Mobile Support
⚙️ Technical Improvements