[Agent] feat(pause-menu): dynamic CoreActions & CoreOptions tile integration#3266
Open
github-actions[bot] wants to merge 2 commits intodevelopfrom
Open
[Agent] feat(pause-menu): dynamic CoreActions & CoreOptions tile integration#3266github-actions[bot] wants to merge 2 commits intodevelopfrom
github-actions[bot] wants to merge 2 commits intodevelopfrom
Conversation
Contributor
Author
|
🤖 PR created. AI review starting automatically. |
7 tasks
824ff72 to
885eb97
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds dynamic CoreAction/CoreOption integration into the tile-based pause menu so emulator cores can surface quick actions and boolean option toggles directly in the grid UI.
Changes:
- Introduces
CoreActionTileProvider/CoreOptionTileProviderto map core-exposed actions/options intoPauseMenuTiles. - Injects these dynamic tiles into
PauseTileMenuViewand dispatches taps for core actions, core option toggles, and a “Core Settings” gateway tile. - Adds unit tests for both providers and wires
PVCoreBridgeinto the PVUIBase test target.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
PVUI/Sources/PVUIBase/PVEmulatorVC/CoreActionTileProvider.swift |
New provider(s) that convert CoreAction + boolean CoreOption into pause-menu tiles. |
PVUI/Sources/PVUIBase/PVEmulatorVC/PauseTileMenuView.swift |
Injects dynamic core tiles into the grid and handles their tap behaviors, including a confirmation dialog for multi-option actions. |
PVUI/Sources/PVUIBase/PVEmulatorVC/PVEmulatorViewController+CoreOptions.swift |
Adds a helper for forwarding CoreAction execution and reset behavior. |
PVUI/Tests/PVUIBaseTests/CoreActionTileProviderTests.swift |
Adds provider-focused unit tests with mock cores/options. |
PVUI/Package.swift |
Adds PVCoreBridge dependency to the PVUIBase tests target to compile the new tests. |
.changelog/3249.md |
Adds a changelog fragment describing the new dynamic tiles behavior. |
.changelog/3249.md
Outdated
Comment on lines
+2
to
+5
| - **CoreAction Tiles** — CoreActions exposed by the active emulator core now appear as orange bolt-icon tiles in the tile-based pause menu; actions that require a reset show a ⚠︎ warning badge. | ||
| - **CoreOption Toggle Tiles** — Boolean `CoreOption`s from the active core appear as inline ON/OFF toggle tiles directly in the pause menu grid. | ||
| - **Core Settings Tile** — A "Core Settings" tile is automatically injected when the core exposes any options, opening the full `CoreOptionsDetailView` sheet. | ||
| - **Multi-option Action Picker** — Core actions with multiple choices present a `confirmationDialog` inline so users can pick without leaving the pause menu. |
Comment on lines
+278
to
+280
| let currentValue = coreClass.storedValueForOption(Bool.self, key) ?? false | ||
| coreClass.setValue(!currentValue, forOption: option) | ||
|
|
Comment on lines
+503
to
+512
| ForEach(options, id: \.title) { opt in | ||
| Button(opt.title) { | ||
| pendingCoreAction = nil | ||
| dismissAction(false) | ||
| DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { | ||
| coreWithActions.selected(action: action) | ||
| self.emulatorVC.core.setPauseEmulation(false) | ||
| if action.requiresReset { | ||
| self.emulatorVC.core.resetEmulation() | ||
| } |
Comment on lines
+278
to
+279
| let currentValue = coreClass.storedValueForOption(Bool.self, key) ?? false | ||
| coreClass.setValue(!currentValue, forOption: option) |
Comment on lines
+105
to
+113
| case let .bool(display, defaultValue, _): | ||
| let current = coreClass.storedValueForOption(Bool.self, display.title) ?? defaultValue | ||
| result.append(PauseMenuTile( | ||
| id: tileID(forOptionKey: display.title), | ||
| icon: current ? "checkmark.square.fill" : "square", | ||
| label: display.title, | ||
| badge: current ? "ON" : "OFF", | ||
| colorKey: current ? .green : .gray, | ||
| dismissOnTap: false |
Comment on lines
+47
to
+59
| /// Triggers the given ``CoreAction`` on the active core. | ||
| /// | ||
| /// Called from ``PauseTileMenuView`` when a core-action tile is tapped. | ||
| /// The menu is responsible for dismissing itself; this method only | ||
| /// forwards the action and handles the reset side-effect. | ||
| public func handleCoreAction(_ action: CoreAction) { | ||
| guard let coreWithActions = core as? CoreActions else { return } | ||
| coreWithActions.selected(action: action) | ||
| core.setPauseEmulation(false) | ||
| if action.requiresReset { | ||
| core.resetEmulation() | ||
| } | ||
| } |
84437ff to
8972150
Compare
Member
|
@claude please fix copilot review issues |
Contributor
Author
✅ Fixes Pushed — AI Re-review QueuedCompleted
Fixes Applied
Completed: 2026-03-17 |
8972150 to
ce3688f
Compare
Contributor
Author
|
✅ Fixes pushed — addressed all 6 Copilot review issues:
|
390d4c9 to
15f852c
Compare
15f852c to
cb30442
Compare
…3249) - Add CoreActionTileProvider: maps CoreAction[] → PauseMenuTile[] (orange bolt tiles; ⚠︎ badge when requiresReset) - Add CoreOptionTileProvider: maps boolean CoreOptions → ON/OFF toggle tiles plus a "Core Settings" gateway tile - Inject dynamic core tiles into PauseTileMenuView (after primary tiles) - Handle coreAction_*, coreOption_*, coreSettings tile IDs in dispatcher - Show confirmationDialog for multi-option CoreActions inline - Add handleCoreAction() helper on PVEmulatorViewController - Add unit tests: CoreActionTileProviderTests, CoreOptionTileProviderTests - Add PVCoreBridge as direct dep of PVUIBaseTests for mock conformances Part of #3249 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Drop trailing periods from changelog fragment entries - Use valueForOption (MD5-aware) instead of storedValueForOption in CoreActionTileProvider and the option-toggle handler - Scope setValue calls with currentGameMD5 so per-game overrides apply - Add @State coreOptionRefreshToken + reference in coreTiles so the tile grid re-renders immediately after a toggle - Fix confirmationDialog to build a new CoreAction with the selected CoreActionOption marked selected:true so cores can distinguish picks - Switch both action dispatch paths to call handleCoreAction, removing duplicated selected/setPause/reset logic from PauseTileMenuView Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cb30442 to
dc131a9
Compare
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.
Summary
Implements dynamic tile integration for CoreActions and CoreOptions in the tile-based pause menu (depends on #3248, now merged).
[CoreAction]→[PauseMenuTile](orange bolt icon, ⚠︎ badge whenrequiresReset)CoreOptions → inline ON/OFF toggle tiles; appends a Core Settings tile when any options existcoreTilescomputed property injects core tiles after primary tiles; handlescoreAction_*,coreOption_*, andcoreSettingsIDs in the dispatcher; shows.confirmationDialogfor multi-option actionshandleCoreAction(_:)helperCoreActionTileProviderTests(10 tests) +CoreOptionTileProviderTests(12 tests) using mockCoreOptionalconformancesAcceptance Criteria Status
CoreActionTileProvidermaps[CoreAction]→[PauseMenuTile]CoreOptionTileProvidermaps booleanCoreOptions → toggle tilesPauseTileMenuViewbased on active coreconfirmationDialogTest plan
CoreActions(e.g. multi-disc) — verify bolt tiles appearrequiresResetaction tile — verify ⚠︎ badge visible and reset occursconfirmationDialogappearsCoreOptionsDetailViewsheet opensswift testin PVUI:CoreActionTileProviderTestsandCoreOptionTileProviderTestspassPart of #3249
Depends on: #3248
🤖 Generated with Claude Code