Skip to content

Hard-level responsive grid: adapt rows/cols by orientation (portrait vs. landscape) #22

Description

@pekomon

Summary
Hard difficulty grid should adapt to device orientation to keep cells readable. In portrait, use a tall grid; in landscape, use a wide grid. Keep mine density consistent with the current Hard baseline.

Details

  • Portrait: 14 (cols) x 24 (rows)
  • Landscape: 24 (cols) x 14 (rows)
  • Mines: keep ~Hard density (~20.625%) calculated from the original 30x16 with 99 mines → round(0.20625 * cols * rows) ≈ 69 for 14x24 and 24x14.
  • Apply only to Hard difficulty. Easy/Medium remain as-is (Phase 1 scope was UI baseline).
  • Orientation detection must be multiplatform-safe. Suggested approach:
    • Common: use BoxWithConstraints to infer aspect ratio (width > height → landscape).
    • Derive grid (cols, rows) from aspect ratio per rules above.
    • Avoid platform-specific APIs in commonMain.

Acceptance Criteria

  • Hard difficulty renders 14x24 in portrait and 24x14 in landscape.
  • Mines count uses a density consistent with Hard (≈20.6%), rounded to nearest integer.
  • No crashes on orientation changes; grid re-composes correctly.
  • Spotless/KtLint/Detekt pass; no global rule changes.
  • Works on Android, iOS, Desktop, and Wasm.

Non-Goals (this issue)

  • Zooming/pinch-to-zoom
  • Persisted settings or dynamic scaling beyond the two layouts

Labels

  • project:minesweeper, phase:2, enhancement, ux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase:2Phase 2project:minesweeperAll issues/PRs for the Minesweeper subprojectuxUser experience / usability

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions