Skip to content

Forgiving name matching for /island go (#3024)#3031

Merged
tastybento merged 2 commits into
developfrom
feature/3024-forgiving-go-matching
Jul 11, 2026
Merged

Forgiving name matching for /island go (#3024)#3031
tastybento merged 2 commits into
developfrom
feature/3024-forgiving-go-matching

Conversation

@tastybento

Copy link
Copy Markdown
Member

What

First slice of the #3024 design rule (missing/unmatched command argument should help, not just show usage): make /island go <name> forgiving about how the destination is typed.

Why

New players fail basic flows because /[gm] go required an exact, case-sensitive match against island and home names, then dumped the whole list on any miss. Typing myisland, hom, or adding a stray double-space produced no teleport — exactly the command friction the Player-helper initiative targets.

How

New IslandGoCommand.resolveName(typed, names) tries matching in decreasing order of confidence:

  1. Exact match — unchanged behaviour, always wins.
  2. Case / colour / whitespace-insensitive exact match.
  3. Unique case-insensitive prefix (e.g. homHome).

Anything ambiguous (more than one candidate at a step) falls through to the existing unknown-home list rather than guessing. The resolved canonical name is used for the home-teleport lookup, so named-home teleports still target the correct home.

Tests

IslandGoCommandTest: added unit tests for every resolveName branch (exact, case/space-insensitive, unique prefix, ambiguous prefix, ambiguous normalized, no-match, blank) plus two integration tests through execute (wrong-case island name, home-name prefix). Existing tests unchanged and green.

Follow-up

The general openPicker(User, List<String>) hook on CompositeCommand — the rest of #3024 — will be a separate PR.

🤖 Generated with Claude Code

tastybento and others added 2 commits July 11, 2026 15:59
The go/home command previously required an exact, case-sensitive match of
the typed destination against island and home names, and dumped the full
name list on any miss. New players who type "myisland", "hom" or add a
stray space got no teleport.

Add IslandGoCommand.resolveName: exact match still wins (unchanged
behaviour), then a case/colour/whitespace-insensitive exact match, then a
unique case-insensitive prefix. Ambiguous inputs fall through to the
existing unknown-home list rather than guessing. The resolved canonical
name is used for the home teleport lookup so named-home teleports still
target the right home.

This is the cheap first slice of the "missing/unmatched argument opens a
picker" rule; the openPicker hook on CompositeCommand follows separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G7UmQDCP5MGHEZqFiw44zH
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G7UmQDCP5MGHEZqFiw44zH
@tastybento tastybento merged commit d5481ba into develop Jul 11, 2026
1 check passed
@tastybento tastybento deleted the feature/3024-forgiving-go-matching branch July 11, 2026 23:27
@sonarqubecloud

Copy link
Copy Markdown

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