ux: no-scroll split-army — selected-army panel under the map#52
Merged
Conversation
Splitting an army meant scrolling past the map, the status, policy, and settings panels to the Armies list at the very bottom, then finding the army by #id — even though the player had just clicked that army on the map at the top of the screen. The action lived nowhere near where the player was working (Nielsen #7: flexibility and efficiency of use). This adds a compact "selected army" panel immediately below the map. The markup and styling land here; the next commits wire it to the canvas selection and make its Split button act on the selected army, so a split needs no scrolling. By default it shows a one-line hint ("Click one of your armies on the map to select it") to make the select-then-act flow discoverable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The panel existed but showed nothing useful: it wasn't connected to which army the player had clicked, so the selection on the map and the place you'd act on it were still disconnected (Nielsen #6: recognition rather than recall). This refreshes the panel whenever the selection changes — selecting, re-selecting, moving, or right-click-deselecting an army — and on every game tick (so the soldier count stays current). It resolves the selected army fresh from game state, shows "Army #N — S soldiers at (x, y)", and falls back to the hint when nothing is selected or the army no longer exists (e.g. after a merge). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
With the panel wired to the selection, this makes its Split button actually work: panelSplit() validates the amount against the selected army's soldier count and issues the SPLIT command, so the player can split right where they selected the army instead of scrolling to the list (Nielsen #7: flexibility and efficiency). The SPLIT request is factored into a shared sendSplitCommand() used by both the panel and the existing list control, so there's one code path; it also now sends the player back to login on a 401 (expired/revoked session) like the other game actions, which the old list-only path didn't. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Split Army button was red (#8b3a3a → #a04040), the color reserved for destructive actions like Delete or Surrender. Splitting an army is a routine, non-destructive move, so the red both overstated it and clashed with the now neutral-colored Logout button — the same inconsistency flagged there (Nielsen #4: consistency and standards). This restyles Split in the theme's neutral action brown and adds a clear disabled state (used by the under-map panel when an army has too few soldiers to split). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Fixes #51. Splitting an army required scrolling past the map, status, policy, and settings panels to the Armies list at the bottom, then finding the army by
#id. This brings the action to where the player already is: a compact "selected army" panel directly under the map that acts on the army you clicked.Round — bring army actions to the map
sendSplitCommand()used by the list too, and now redirects to login on a 401 like the other actions.Test plan
🤖 Generated with Claude Code