Skip to content

Conversation

@veloce
Copy link
Contributor

@veloce veloce commented May 25, 2025

Closes #1785
Closes #1783
Closes #1773

It also fixes a UI bug of the bottom bar introduced in #1781

@veloce veloce force-pushed the puzzle_immersive_mode branch from 3f91642 to 767d326 Compare May 25, 2025 11:17
@veloce veloce requested a review from Copilot May 25, 2025 11:37
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

This pull request introduces several improvements for small screens and enhances puzzle immersive mode as well as game screen behavior. Key changes include:

  • Updating UI thresholds and renaming functions/constants to improve small screen handling and move list display implementation.
  • Refactoring async state handling using new switch-case patterns and integrating Android gesture exclusion for immersive mode.
  • Adjusting layout calculations and updating settings to fix the bottom UI bar bug.

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/src/widgets/board_table.dart Updated move list display condition based on board preferences.
lib/src/view/settings/board_settings_screen.dart Added a new switch tile to toggle move list display.
lib/src/view/puzzle/streak_screen.dart Refactored widget state management with pop scope adjustments.
lib/src/view/puzzle/storm_screen.dart Converted async handling to switch-case and updated error handling.
lib/src/view/puzzle/puzzle_screen.dart Passed board keys and updated async patterns for puzzle loading.
lib/src/view/game/game_screen_providers.dart Renamed function for real-time game checks.
lib/src/view/game/game_screen.dart Introduced Android gesture exclusion and updated navigation bar theming.
lib/src/view/game/game_player.dart Adjusted font sizes and removed unnecessary widgets for layout stability.
lib/src/utils/screen.dart Renamed and updated height estimation function used across the app.
lib/src/model/settings/board_preferences.dart Added toggle for move list display and updated default settings.
lib/src/constants.dart Revised threshold value for small screens.
lib/src/app.dart Updated the NavigationBarTheme based on the new height estimation.
Comments suppressed due to low confidence (3)

lib/src/utils/screen.dart:5

  • The updated estimateHeightMinusBoard function no longer subtracts the top and bottom padding from the MediaQuery; please confirm that this change is intentional for devices with display cutouts.
double estimateHeightMinusBoard(BuildContext context) { return size.height - boardSize - kToolbarHeight - kBottomBarHeight; }

lib/src/view/game/game_screen_providers.dart:125

  • The function was renamed from shouldPreventGoingBack to isRealTimePlayableGame; please ensure that the new naming consistently reflects its behavior across the codebase.
Future<bool> isRealTimePlayableGame(Ref ref, GameFullId gameId) {

lib/src/constants.dart:63

  • The threshold value has been changed from 160 to 190; please verify that this adjustment aligns with the intended UI design for small screens.
const kSmallHeightMinusBoard = 190;

Comment on lines 64 to 65
final remaingHeight = estimateHeightMinusBoard(context);
final playerFontSize = remaingHeight <= kSmallHeightMinusBoard ? 15.0 : 16.0;
Copy link

Copilot AI May 25, 2025

Choose a reason for hiding this comment

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

The variable name 'remaingHeight' appears to have a typo; consider renaming it to 'remainingHeight' for clarity.

Suggested change
final remaingHeight = estimateHeightMinusBoard(context);
final playerFontSize = remaingHeight <= kSmallHeightMinusBoard ? 15.0 : 16.0;
final remainingHeight = estimateHeightMinusBoard(context);
final playerFontSize = remainingHeight <= kSmallHeightMinusBoard ? 15.0 : 16.0;

Copilot uses AI. Check for mistakes.
veloce added 5 commits May 25, 2025 14:02
Also better detect small screens to hide the list automatically.

Closes #1785
Fixes a regression introduced with 93ef0a9.
Refactor GameBody and GameScreen to simplify logic.
- immersive mode on android when puzzle is not finished
- on both platforms, prevent pop screen with a confirmation dialog

Closes #1773
@veloce veloce force-pushed the puzzle_immersive_mode branch from 767d326 to 4906abb Compare May 25, 2025 12:03
@veloce veloce merged commit 8c509d6 into main May 26, 2025
1 of 2 checks passed
@veloce veloce deleted the puzzle_immersive_mode branch May 26, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants