Skip to content

ux: auth usability pass — 9 fixes from Nielsen heuristics + Don't Make Me Think#48

Merged
dmccoystephenson merged 9 commits into
mainfrom
ux/auth-usability-pass-2
Jun 7, 2026
Merged

ux: auth usability pass — 9 fixes from Nielsen heuristics + Don't Make Me Think#48
dmccoystephenson merged 9 commits into
mainfrom
ux/auth-usability-pass-2

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

A second usability-pass batch over the auth UI (login, register, and the auth bits of the game screen), kicked off by a reported inconsistency: the password box didn't match the username box. Every commit is one self-contained Nielsen / Krug fix, scoped small for easy review.

Round 1 — input consistency & affordances

  1. Login + Register — the password input is styled to match the username input; the rule only targeted input[type="text"], so the password box fell back to browser-default chrome (Nielsen Implement Army Management (Split, Merge, Display) #4).
  2. Login + Register — the username field is focused on load so typing starts without a click; the post-register handoff still jumps to password when the username is pre-filled (Nielsen Implement Enhanced UI with Mouse Controls and HUD #7).
  3. Login + Register — a Show/Hide toggle on password fields lets players verify what they typed (Nielsen Implement Enhanced UI with Mouse Controls and HUD #7, Krug: conventions over invention).

Round 2 — recognition & guidance

  1. Login vs Register — a subtitle names each screen ("Log in to your account" / "Create your account") so the near-identical screens are recognizable (Nielsen Implement Basic Rule-Based AI Opponent #6, Implement Army Movement System with Pathfinding #2).
  2. Register — persistent hint text states the username/password rules so they survive typing, instead of vanishing with the placeholder (Nielsen Implement Basic Rule-Based AI Opponent #6, Implement Castle Capture and Win/Loss Conditions #5).
  3. Login + Register — the cross-links ("Create one" / "Log in") are styled in the accent color so they read as obviously clickable, not muted prose (Krug self-evident labels, Nielsen Implement Army Management (Split, Merge, Display) #4).

Round 3 — error prevention & control

  1. Register — a Confirm Password field blocks submission on mismatch, so a typo in the masked field doesn't silently create an unintended password (Nielsen Implement Castle Capture and Win/Loss Conditions #5).
  2. Game — Logout is restyled off the destructive red into a neutral secondary color; logout isn't destructive and shouldn't wear the Delete color (Nielsen Implement Army Management (Split, Merge, Display) #4).
  3. Login + Register — a "Caps Lock is on" warning appears while typing a password, surfacing a top cause of failed logins the masked field hides (Nielsen Implement Castle Capture and Win/Loss Conditions #5, Implement tile-by-tile army movement with Manhattan pathfinding #9).

Test plan

  • Username and password boxes are visually identical on both screens.
  • Page loads with the cursor already in the username field.
  • Show/Hide reveals and re-masks the password; label + aria-label update.
  • Login and Register each show their own subtitle; cross-links are accent-colored and underline on hover.
  • Register shows the field-requirement hints; mismatched Confirm Password blocks submit with an inline error.
  • Turning on Caps Lock while in a password field shows the warning; it clears on blur.
  • The game's Logout button is no longer red.

🤖 Generated with Claude Code

BuildTools and others added 9 commits June 7, 2026 16:50
The input styling rule targeted only input[type="text"], so the password box
fell back to the browser's default chrome — a different border, background,
height, and font from the username box right above it. On a dark themed form
that mismatch is glaring and makes the screen look half-finished, undermining
trust right at the sign-in step (Nielsen #4: consistency and standards).

This extends the base, focus, and mobile input rules to cover
input[type="password"] as well, so both fields share one appearance. Done as a
shared selector rather than a per-field class so any future input type inherits
the same treatment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Both the login and register screens opened with no field focused, so the very
first thing a player had to do was click into the username box before they
could type. For a screen whose entire purpose is "type two things and submit,"
that wasted click is exactly the kind of friction Krug's "don't make me think"
warns against (Nielsen #7: flexibility and efficiency of use).

This adds the autofocus attribute to the username input on both forms. On the
login screen the post-register handoff still wins — when the username is
pre-filled, focus jumps to the password field instead — so the cursor always
lands on the first thing the player actually needs to fill in.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Password input is masked with no way to reveal it, so a player who fat-fingers
their password has no way to check what they typed before submitting — they
just get a generic "login failed" and start guessing. Masked-only fields are a
known driver of failed logins, and a reveal toggle is now a platform
convention players expect (Nielsen #7: flexibility and efficiency; Krug:
conventions over invention).

This adds an inline "Show"/"Hide" button inside the password field on both the
login and register screens that flips the input between password and text and
updates its own label and aria-label. The control is keyboard-focusable and
type="button" so it never submits the form.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The login and register screens were visually near-identical: both opened with
just the "🏰 Barony" title and two fields, so the only way to tell which one
you were on was to read the field labels and button text. A player who clicked
"Create one" and then got distracted had no at-a-glance confirmation they'd
landed on the right screen (Nielsen #6: recognition rather than recall; #2:
match between system and the real world).

This adds a subtitle under the title — "Log in to your account" on login,
"Create your account" on register — so each screen states what it is the moment
it loads.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The username and password rules (3–50 characters; at least 8 characters) lived
only in the placeholder text, which disappears the instant the player starts
typing. So the requirements vanished exactly when they became relevant, and the
player only learned the password was too short after submitting and getting an
error back (Nielsen #6: recognition rather than recall; #5: error prevention).

This adds a persistent hint line under each field that states the rule and stays
visible while the player types, so they can satisfy the requirement on the first
try instead of discovering it through a failed submit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The "Don't have an account? Create one" and "Already have an account? Log in"
links had no styling of their own, so they rendered in the muted gray of the
surrounding helper text with no clear affordance — the one navigation path
between the two screens looked like ordinary prose a player could easily skim
past (Krug: an actionable thing should look obviously actionable; Nielsen #4).

This styles the cross-links in the theme's accent color with bold weight and an
underline on hover, so the way to switch between signing in and signing up reads
as a real, tappable link.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Registration took a single password field, so a typo in that one masked input
created an account with a password the player didn't intend — and they wouldn't
find out until the next login failed, with no way to know whether they
mistyped now or then. For a credential you can't see as you type, one field is
a silent error waiting to happen (Nielsen #5: error prevention).

This adds a "Confirm Password" field and blocks submission with an inline
"Passwords do not match" message when the two differ, so a mistyped password is
caught at registration instead of locking the player out of the account they
just made.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Logout button wore a saturated red (#8b3a3a → #a04040 on hover), the
universal color for destructive actions like Delete or Surrender. Logging out
isn't destructive — your account and game are saved — so dressing it in danger
red both overstated the stakes and competed for attention with genuinely
risky in-game controls (Nielsen #4: consistency and standards — a color that
means "danger" elsewhere shouldn't mean "routine sign-out" here).

This restyles Logout in the theme's neutral brown with a subtle border, so it
reads as the secondary, safe, reversible action it actually is.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Because password fields are masked, a player with Caps Lock on can't see that
every character is the wrong case — they just get "login failed" and retype the
same thing, confused. Caps Lock is one of the most common reasons a known-good
password is rejected, and nothing on the screen pointed to it (Nielsen #5:
error prevention; #9: help users diagnose errors).

This shows a "⚠ Caps Lock is on" warning while the player types in any password
field on the login and register screens, detected via the key event's
getModifierState, and hides it on blur. It surfaces the problem before the
player wastes a failed submit on it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dmccoystephenson dmccoystephenson merged commit f4ead5f into main Jun 7, 2026
2 checks passed
@dmccoystephenson dmccoystephenson deleted the ux/auth-usability-pass-2 branch June 7, 2026 22:57
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.

1 participant