Skip to content

fix: correct command tab completion - #43

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 ArmourShop, including the current prefix and applicable permission or sender context.

  • ARMOURSHOP-01: Admin-only token delete completion uses an async active-unused-code snapshot backed by the existing 30-second generational cache; successful revocation invalidates it. Clickable listtokens actions are preserved.

Validation: tfmc-mvn -o -B --no-transfer-progress clean verify passed (229 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: a6590af9-297a-497c-a7a0-c58d07ec2d2a
📥 Commits

Reviewing files that changed from the base of the PR and between bed0c24 and 94196fc.

📒 Files selected for processing: 4
  • src/main/java/net/tfminecraft/armourshop/managers/CommandManager.java
  • src/main/java/net/tfminecraft/armourshop/pack/delete/ActiveTokenCodeCache.java
  • src/test/java/net/tfminecraft/armourshop/managers/CommandManagerTest.java
  • src/test/java/net/tfminecraft/armourshop/pack/delete/PackDeletionTest.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

  • New Features
    • Administrators can now receive suggestions for active token codes when completing the third argument of the token deletion command. Suggestions match the entered prefix without regard to case.
  • Bug Fixes
    • Active token suggestions are refreshed after a token is successfully revoked, so deleted tokens do not remain in the suggestions. Failed revocations leave the existing suggestions unchanged.

The change adds a cache for active token codes, uses it to suggest matching codes during admin token-deletion completion, and invalidates it after successful revocation. Tests cover cache refresh and completion filtering.

Changes: Active token deletion suggestions

Layer / File(s) Summary
Load and refresh active token codes
src/main/java/net/tfminecraft/armourshop/pack/delete/ActiveTokenCodeCache.java, src/test/java/net/tfminecraft/armourshop/pack/delete/PackDeletionTest.java
The cache loads active codes, removes duplicates while preserving order, and exposes snapshot and invalidation operations. Tests cover worker-scheduled fetching, refreshes, failed results, and empty results.
Connect the cache to token deletion
src/main/java/net/tfminecraft/armourshop/managers/CommandManager.java, src/test/java/net/tfminecraft/armourshop/managers/CommandManagerTest.java
Successful token revocation invalidates the cache. Admin completion for the third token-deletion argument returns cached codes filtered by the entered prefix. Tests cover matching and excluded paths.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~18 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 94196

No actionable merge-blocking risk is established; the change is ready for normal merge checks.

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