Skip to content

ux: no-scroll split-army — selected-army panel under the map#52

Merged
dmccoystephenson merged 4 commits into
mainfrom
ux/split-army-panel
Jun 8, 2026
Merged

ux: no-scroll split-army — selected-army panel under the map#52
dmccoystephenson merged 4 commits into
mainfrom
ux/split-army-panel

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

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

  1. Panel under the map — a compact selected-army panel is added right below the canvas; by default it shows a hint ("Click one of your armies on the map to select it") to make the select-then-act flow discoverable (Nielsen Implement Enhanced UI with Mouse Controls and HUD #7, Implement Basic Rule-Based AI Opponent #6).
  2. Driven by the map selection — the panel refreshes on every selection change and tick, showing "Army #N — S soldiers at (x, y)", and falls back to the hint when nothing is selected or the army no longer exists (Nielsen Implement Basic Rule-Based AI Opponent #6).
  3. Split from the panel — the panel's Split button validates against the selected army's soldier count and issues the SPLIT command, so no scrolling is needed; the request is factored into a shared sendSplitCommand() used by the list too, and now redirects to login on a 401 like the other actions.
  4. Split button off the destructive red — Split Army was the same red as Delete/Logout; recolored to the neutral action brown with a proper disabled state (Nielsen Implement Army Management (Split, Merge, Display) #4).

Test plan

  • Click one of your armies on the map → the under-map panel shows its stats and a split control (no scrolling).
  • Enter an amount and click Split → the army splits; a success toast appears; the panel reflects the new soldier count.
  • Select an army with 1 soldier → the split control is disabled with a "Needs 2+ soldiers" hint.
  • Right-click / move away → the panel returns to the hint.
  • The bottom Armies-list split still works; both Split buttons are neutral-colored, not red.

🤖 Generated with Claude Code

BuildTools and others added 4 commits June 7, 2026 18:45
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>
@dmccoystephenson dmccoystephenson merged commit 6b1191d into main Jun 8, 2026
2 checks passed
@dmccoystephenson dmccoystephenson deleted the ux/split-army-panel branch June 8, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the split-army UI — eliminate scrolling and make it intuitive

1 participant