feat: editable adversary name in runner with uniqueness validation (#68)#76
Merged
Conversation
Tap the adversary name in the expanded card to rename it inline. Validates that the trimmed name is non-empty and unique across all slots; shows an inline error on conflict. Empty input reverts silently. Mutation routes through EncounterSession.renameAdversary(id:name:).
Covers all 7 items from the test plan: tap-to-edit, Done button, Return key, duplicate name error, empty-field revert, Cancel revert, and collapse button accessibility. Includes a two-same-adversary navigation helper for the uniqueness validation scenario.
- AdversaryRunnerCard: add @focusstate for immediate keyboard focus on rename, add AX identifiers to Done/Cancel buttons, clean up nameError init - AdversaryRunnerSection: include active conditions in collapsed row accessibilityLabel (PR #75 broke this by switching from accessibilityValue to an explicit label that omitted condition state) - EncounterUITestCase: new shared base class for RunnerUITests and RenameAdversaryUITests, eliminating ~180 lines of duplicated helpers - Navigation helpers: fix iOS 26 toolbar overflow — builder toolbar items collapse into OverflowBarButtonItem; use builder.add-adversary-button (in-form) for compendium and tap overflow before "Run Encounter" - replaceText: remove redundant initial tap on iOS; triple-tap alone handles both pre-focused (@focusstate) and unfocused states correctly All 9 iOS UI tests and all macOS unit tests pass.
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
AdversaryRunnerCardheader to rename it inline"Name already in use"inline on conflict@Observable EncounterSessionEncounterSession.renameAdversary(id:name:)(added in feat: add renameAdversary(id:name:) to EncounterSession DHModels#23); the view does not write toAdversaryStatedirectlyPackage update
Depends on gwillish/DHModels#23 (already merged).
Package.resolvedis gitignored; Xcode will pick up the newrenameAdversarymethod on next resolve frommain.Test plan
xcodebuild test -scheme Encounter -destination 'platform=macOS')"Name already in use"error appears inlineCloses #68