Skip to content

fix: correct command tab completion - #80

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

  • COOK-01: Complete in-game preview target/actions and qualitytest modes. Offer CompositionContext after successfully parsed compose/compose2 expressions, including spaces and multiple foods; keep pickup and incomplete expression positions empty.
  • COOK-02: Seed known offline names at command initialization and update by join events; merge with online names, deduplicate, prefix-filter and recheck nonblocking getOfflinePlayerIfCached so expired cache entries never escape. Retain admin and husbandry command ownership.
  • COOK-03: Filter existing genetics/care numeric presets against current token.

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

Documentation: TF-Minecraft/Docs#266.

@github-actions github-actions Bot added the size:M 30-99 effective changed lines (tests excluded in mixed PRs). label Oct 15, 2026
@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: 472d8611-d173-4afc-b08d-f8034e0cc12e
📥 Commits

Reviewing files that changed from the base of the PR and between 0dcb7ce and 35c4c4c.

📒 Files selected for processing: 5
  • src/main/java/net/tfminecraft/cooking/Cooking.java
  • src/main/java/net/tfminecraft/cooking/husbandry/HusbandryAnimalsCommand.java
  • src/main/java/net/tfminecraft/cooking/manager/CommandManager.java
  • src/test/java/net/tfminecraft/cooking/husbandry/HusbandryRemainingCoverageTest.java
  • src/test/java/net/tfminecraft/cooking/manager/CommandManagerCoverageTest.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
    • Animal command suggestions now include matching names from previously seen players, alongside players who are online. Suggestions are kept current as players join and are displayed without case-sensitive duplicates.
    • Command suggestions for previews, quality tests and husbandry spawn options now filter by the text entered so far. Quality-test context suggestions appear only for valid food expressions, including supported combinations.
  • Bug Fixes
    • Invalid or incomplete food expressions no longer produce quality-test context suggestions.

Command tab completion now includes cached offline animal names and prefix-filtered suggestions for preview, quality-test, composition, and husbandry spawn arguments.

Changes: Command tab completion

Layer / File(s) Summary
Animal-name completion
src/main/java/net/tfminecraft/cooking/husbandry/HusbandryAnimalsCommand.java, src/main/java/net/tfminecraft/cooking/Cooking.java, src/test/java/net/tfminecraft/cooking/husbandry/HusbandryRemainingCoverageTest.java
HusbandryAnimalsCommand caches offline-player names at construction and updates names when players join. Completion combines matching cached names that still resolve with matching online names, then de-duplicates and sorts them. Cooking.onEnable() registers the command as a listener. Tests cover cache updates, matching, and permission restrictions.
Command argument suggestions
src/main/java/net/tfminecraft/cooking/manager/CommandManager.java, src/test/java/net/tfminecraft/cooking/manager/CommandManagerCoverageTest.java
CommandManager filters preview, quality-test, composition, and husbandry spawn suggestions by the current input. Composition contexts are suggested only when the food expressions parse successfully. Tests cover matching, valid and invalid expressions, and sender restrictions.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 35c4c

This change improves command tab completion and carries no identified merge-blocking risk.

- [ ] 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.

@ryanbarlow97
ryanbarlow97 merged commit a6faeff 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