feat: edit a finished match (names, commanders, partners)#65
Open
Jshewmaker wants to merge 13 commits into
Open
feat: edit a finished match (names, commanders, partners)#65Jshewmaker wants to merge 13 commits into
Jshewmaker wants to merge 13 commits into
Conversation
Inline edit mode on the Match Details screen to update player names, commanders, and partner commanders, persisted via updateGameStats. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bite-sized TDD plan: shared commander mapper, CommanderPickerCubit + full-screen picker, MatchEditCubit draft/save, editable widgets, and inline edit-mode wiring into the Match Details screen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
What & why
Adds inline editing of a finished match from the Match Details screen. After a game is over, a user can correct what was recorded for each player:
A pencil action in the app bar flips the screen into edit mode (app bar shows Save ✓ / Cancel ✕); tapping a commander opens a full-screen Scryfall search picker. Saving persists changes to the current user's saved copy of the match via the existing
updateGameStats, and the change reflects back automatically through the liveMatchHistoryBlocstream.Spec:
docs/superpowers/specs/2026-06-18-edit-match-details-design.mdPlan:
docs/superpowers/plans/2026-06-18-edit-match-details.mdHow it works
MatchEditCubit— owns a draftList<Player>during the edit session;save()buildsgame.copyWith(players: draft)and callsupdateGameStats(game:, playerId: currentUserId). Save-error keeps the draft; cancel restores.CommanderPickerCubit+CommanderPickerView— a lightweight, isolated full-screen picker that searches Scryfall and returns aCommander(primary or partner).magicCardToCommanderhelper — extracted from the live-game flow so both flows use one mapping (removes duplication).EditablePlayerTile/MatchEditPlayersList/MatchDetailsAppBarActions— small, independently-tested widgets wired into both the phone and tablet views.While editing, the Winner/Metadata cards are hidden and a single editable players list is shown — a deliberate refinement that avoids two competing editable controls for the winner.
Scope
users/{uid}/matches/{gameId}), mirroring existing delete/ownership behavior. Other participants' synced copies are not updated — a candidate follow-up.Testing
flutter test— 24/24 passing.MatchEditCubit(draft mutation, save success capturing the merged game, save-error preserves draft, cancel restores) andCommanderPickerCubit(legendary filter, failure path).EditablePlayerTile(all callbacks incl. partner add/change/remove), app-bar actions (edit↔save/cancel), and the players list (picker → draft update).flutter analyze lib/match_detailsintroduces 0 new lints (8 pre-existing info-level lints predate this feature).Optional follow-ups (non-blocking, from final review)
MatchEditCubittoviewingafter the success snackbar (currently rests at stickysuccess; behavior correct today).MatchDetailsView.🤖 Generated with Claude Code