Skip to content

fix: correct command tab completion - #42

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

@ryanbarlow97 ryanbarlow97 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Correct command suggestions to match accepted DenarEconomy arguments, sender permissions and the current token.

  • DECO-01: Replace give target placeholder with sorted online active-character account names and remove literal amount placeholders; keep coin types and bank/pouch options with permission and prefix matching.
  • DECO-02: Complete staff history targets, cached character names/UUIDs, known ledger IDs, and unclaimed legacy owner IDs followed by their own character IDs. Only eligible account/move/legacy argument completions request a coalesced next-task refresh of cold, dirty or 100-tick-old snapshots. Saved-player UUID discovery runs once on first demand; join events retain later owners even if they disconnect before a refresh. History remains online-only, and multiword names return only the replacement suffix.
  • DECO-03: Return explicit empty pouch completion, suppressing Paper/Bukkit online-player fallback.

Ledger/directory snapshots are lazy, coalesced and refreshed on demand after a 100-tick TTL or relevant changes. Startup and idle ticks perform no completion discovery. A one-time saved-owner index plus join UUID tracking preserves offline candidates without repeated saved-player enumeration. Tab handling queries neither ledger nor saved-player profiles.

Validation: tfmc-mvn -o -B --no-transfer-progress clean verify passed (273 tests, zero failures/errors/skips); 56 focused tests passed. Existing 100% line/branch/instruction gates and git diff --check passed. Regression proofs cover cold/warm/idle behavior, join/logout between refreshes, legacy ownership, permissions and multiword suffixes.

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: 622bbe53-9c5d-4ed4-ade7-835e29833443
📥 Commits

Reviewing files that changed from the base of the PR and between 2f72b25 and 8eda71d.

📒 Files selected for processing: 3
  • src/main/java/net/tfminecraft/denareconomy/DenarEconomy.java
  • src/main/java/net/tfminecraft/denareconomy/managers/CommandManager.java
  • src/test/java/net/tfminecraft/denareconomy/managers/CommandManagerTest.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
    • Added context-aware command suggestions for character names and IDs, ledger accounts, and unclaimed legacy accounts.
    • Suggestions now refresh after player joins and successful account operations, with case-insensitive matching.
    • Empty or unmatched completion requests now return no suggestions instead of placeholders.

Command completion now suggests eligible players, characters, ledger accounts and unclaimed legacy accounts. Candidate snapshots refresh on demand and after specified events or successful operations.

Changes: Command Completion

Layer / File(s) Summary
Build and refresh completion snapshots
src/main/java/net/tfminecraft/denareconomy/DenarEconomy.java, src/main/java/net/tfminecraft/denareconomy/managers/CommandManager.java, src/test/java/net/tfminecraft/denareconomy/managers/CommandManagerTest.java
Startup registers the completion listener. CommandManager schedules snapshot builds and marks the cache dirty after player joins and successful give, legacy claim and move operations. Tests cover deferred discovery and refresh behaviour.
Provide command suggestions
src/main/java/net/tfminecraft/denareconomy/managers/CommandManager.java, src/test/java/net/tfminecraft/denareconomy/managers/CommandManagerTest.java
Completion now returns matching player, character, account and unclaimed-owner suggestions. Tests cover filtering, eligibility, permissions and refreshed suggestions.

Priority: ➖ Normal

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant DenarEconomy
  participant CommandManager
  participant BukkitScheduler
  participant Ledger
  participant Characters
  DenarEconomy->>CommandManager: startCompletionRefresh
  CommandManager->>BukkitScheduler: queue snapshot refresh
  BukkitScheduler->>CommandManager: run refresh
  CommandManager->>Ledger: read account rows
  CommandManager->>Characters: gather character data
Loading

Suggested reviewers: drefvelin

Merge Risk: ⚪ Minimal · up to 8eda7

No confirmed issue currently prevents merging. Handling of malformed ledger rows remains unverified.

- [ ] 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
@github-actions github-actions Bot added size:L 100-499 effective changed lines (tests excluded in mixed PRs). and removed size:M 30-99 effective changed lines (tests excluded in mixed PRs). labels Oct 15, 2026
@ryanbarlow97
ryanbarlow97 marked this pull request as ready for review October 15, 2026 18:44
@ryanbarlow97
ryanbarlow97 merged commit a09987c 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:L 100-499 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant