Forgiving name matching for /island go (#3024)#3031
Merged
Conversation
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
|
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.



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] gorequired an exact, case-sensitive match against island and home names, then dumped the whole list on any miss. Typingmyisland,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:hom→Home).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 everyresolveNamebranch (exact, case/space-insensitive, unique prefix, ambiguous prefix, ambiguous normalized, no-match, blank) plus two integration tests throughexecute(wrong-case island name, home-name prefix). Existing tests unchanged and green.Follow-up
The general
openPicker(User, List<String>)hook onCompositeCommand— the rest of #3024 — will be a separate PR.🤖 Generated with Claude Code