Merged
Conversation
Owner
austin-smith
commented
Feb 23, 2026
- Add game controls to the macOS menu bar: New Game, Redeal, Undo, Auto Finish, Hint, and Statistics.
- Connect menu bar actions to the active game scene so labels and enabled states stay in sync with current game state.
Introduce a GameCommand enum and a .gameCommand Notification.Name; add a new "Game" CommandMenu in the app that posts these notifications (New Game, Redeal, Undo, Auto Finish, Hint) with keyboard shortcuts. Update ContentView to observe .gameCommand notifications and handle them via a new handleGameCommand(_:) method that maps commands to existing UI actions (start/redeal/undo/auto-finish/hint). Also refactor applyObservers to chain command and game-state observers while preserving lifecycle and draw-mode change handling.
Replace the NotificationCenter-based game commands with a macOS Commands implementation using FocusedValues. Added GameMenuCommands.swift that defines GameMenuActions and GameMenuState and provides a Game CommandMenu with proper enable/disable logic and keyboard shortcuts. Removed the GameCommand enum and related notification names (openStatistics, gameCommand) from CommandNotifications. ComputerSolitaireApp now uses GameMenuCommands() instead of the inline CommandMenu. ContentView no longer listens for game/statistics notifications; it exposes focusedSceneValue entries for gameMenuActions and gameMenuState and supplies computed action/state wrappers to wire up menu behavior.
Rework the toolbar implementation for macOS in ContentView: wrap the view with .toolbar consistently, introduce ToolbarSpacer(.flexible) and .fixed spacers, convert individual ToolbarItem placements into ToolbarItemGroup(.primaryAction), and simplify button declarations to use Label with .labelStyle for consistent icon+title presentation. The hint button is now conditionally included inside the group and redundant ToolbarItem wrappers were removed to tidy up layout and improve alignment/appearance.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e07a05c103
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.