Skip to content

fix: correct command tab completion - #95

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

ryanbarlow97 merged 2 commits into
mainfrom
fix/command-tab-completion-20261015

Conversation

@ryanbarlow97

Copy link
Copy Markdown
Contributor

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

  • ACTIVITY-01: Complete online and known previously played offline names only while the offline name remains in the same Bukkit cache used by execution. Startup enumeration and joins maintain names; completion makes no blocking profile lookups. Regression covers cache expiry and renamed accounts.
  • ACTIVITY-02: Each root action is checked against its actual permission, including activity.admin=true with activity.check=false.

Validation: tfmc-mvn -o -B --no-transfer-progress clean verify passed (961 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: 96806d85-a1ff-4f63-bf0c-91437b54623f
📥 Commits

Reviewing files that changed from the base of the PR and between 087fc83 and 80fac05.

📒 Files selected for processing: 4
  • src/main/java/net/tfminecraft/activitytf/ActivityPlugin.java
  • src/main/java/net/tfminecraft/activitytf/commands/ActivityCommand.java
  • src/test/java/net/tfminecraft/activitytf/ActivityPluginTest.java
  • src/test/java/net/tfminecraft/activitytf/commands/ActivityCommandTest.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

  • Improvements
    • Command suggestions now include subcommands available to the player, while continuing to respect permissions.
    • Player-name suggestions include online players and previously seen players still available in the server’s cached records.
    • Suggestions match without regard to letter case and reflect a player’s updated name after they join.

ActivityCommand now tracks previously known player names, updates them on player joins, and offers cached names in player-argument tab completion. Tab completion also filters subcommands by the sender’s permission.

Changes: Player name completion

Layer / File(s) Summary
Track known player names
src/main/java/net/tfminecraft/activitytf/ActivityCommand.java, src/main/java/net/tfminecraft/activitytf/ActivityPlugin.java, src/test/java/net/tfminecraft/activitytf/ActivityPluginTest.java
ActivityCommand loads names from previously played offline players and updates them on player joins. ActivityPlugin loads the names and registers ActivityCommand as a listener. Startup tests verify listener registration.
Suggest permitted commands and player names
src/main/java/net/tfminecraft/activitytf/commands/ActivityCommand.java, src/test/java/net/tfminecraft/activitytf/commands/ActivityCommandTest.java
Tab completion filters subcommands by permission and combines online names with known names still present in Bukkit’s offline-player cache. Tests cover case-insensitive matching, renamed players, excluded names and permission filtering.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 80fac

This change makes command tab completion suggest permitted subcommands and known player names. No actionable merge-blocking risk was found in the supplied context.

- [ ] 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 a795808 into main Oct 15, 2026
4 checks passed
@ryanbarlow97
ryanbarlow97 deleted the fix/command-tab-completion-20261015 branch October 15, 2026 18:49
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