Skip to content

fix: correct command tab completion - #40

Merged
ryanbarlow97 merged 1 commit into
mainfrom
fix/command-tab-completion-20261015
Oct 15, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
fix/command-tab-completion-20261015

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

Correct command suggestions to match the arguments accepted by TFMCWeb, including the current prefix and applicable permission or sender context.

  • TFMCWeb-01: Staff skin token completion remains available when ordinary create permission is added with regular skin disabled. Discord no-argument commands suppress fallback names; warning completes only its authorized target slot.
  • TFMCWeb-02: Staff skin token completion remains available when ordinary create permission is added with regular skin disabled. Discord no-argument commands suppress fallback names; warning completes only its authorized target slot.

Validation: tfmc-mvn -o -B --no-transfer-progress clean verify passed (180 tests, zero failures, errors or skips), including command-completion regressions. git diff --check passed.

Documentation: TF-Minecraft/Docs#266.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c9787f17-f746-4189-bc86-fc1ce8583573
📥 Commits

Reviewing files that changed from the base of the PR and between 952afb4 and f06ee7c.

📒 Files selected for processing: 6
  • src/main/java/net/tfminecraft/tfmcweb/managers/LinkDiscordCommand.java
  • src/main/java/net/tfminecraft/tfmcweb/managers/TokenCommand.java
  • src/main/java/net/tfminecraft/tfmcweb/managers/UnlinkDiscordCommand.java
  • src/main/java/net/tfminecraft/tfmcweb/managers/WarningCommand.java
  • src/test/java/net/tfminecraft/tfmcweb/managers/PlayerAndAdminCommandsTest.java
  • src/test/java/net/tfminecraft/tfmcweb/managers/TokenCommandTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Features
    • Added player-name suggestions for warning commands when the sender has permission.
    • Updated token command suggestions to include the staff-skin option when the relevant permissions and settings allow it.
    • Link and unlink commands do not offer tab-completion suggestions.

Tab completion now returns no suggestions for Discord link and unlink commands, filters online player names for the warning command, and updates token skin-route suggestions based on permissions and enabled scopes.

Changes: Command tab completion

Layer / File(s) Summary
Discord command completion
src/main/java/net/tfminecraft/tfmcweb/managers/LinkDiscordCommand.java, src/main/java/net/tfminecraft/tfmcweb/managers/UnlinkDiscordCommand.java, src/test/java/net/tfminecraft/tfmcweb/managers/PlayerAndAdminCommandsTest.java
Link and unlink commands implement TabCompleter and return empty suggestion lists. Tests cover player and console senders and multiple argument shapes.
Warning player-name suggestions
src/main/java/net/tfminecraft/tfmcweb/managers/WarningCommand.java, src/test/java/net/tfminecraft/tfmcweb/managers/PlayerAndAdminCommandsTest.java
The warning command suggests online player names matching the first argument, without case sensitivity, when the sender has tfmcweb.warning and supplies exactly one argument. Tests cover permission, match, and argument conditions.
Token route suggestions
src/main/java/net/tfminecraft/tfmcweb/managers/TokenCommand.java, src/test/java/net/tfminecraft/tfmcweb/managers/TokenCommandTest.java
The skin route is suggested when the matching regular or staff permission and scope are enabled. Tests cover staff suggestions and duplicate skin suppression.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to f06ee

Command completion changes match the inspected registration and route behavior. No actionable merge risk remains.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:M 30-99 effective changed lines (tests excluded in mixed PRs). label Oct 15, 2026
@ryanbarlow97
ryanbarlow97 marked this pull request as ready for review October 15, 2026 18:44
@ryanbarlow97
ryanbarlow97 merged commit f6f8647 into main Oct 15, 2026
4 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/command-tab-completion-20261015 branch October 15, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant