Skip to content

fix: correct command tab completion - #58

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

  • MAGIC-01: ResonanceCommand is an explicit empty completer, including the res alias via PluginCommand executor fallback.
  • MAGIC-02: Artifact path completes magic.artifact plus finite primary/element/rarity keys, registered values, extra type keys and closing/continuation delimiters. It preserves the typed token, respects selected type rarity brackets and leaves numeric caps manual.
  • MAGIC-03: Weapon attunement suggestions apply ElementVisibility.shownOnCharge.
  • MAGIC-04: Weapon parts follow selected archetype, already occupied categories and selected core limits; incompatible core choices and terminal extra parts are suppressed.
  • MAGIC-05: Artifact roll/give rarities follow enabled selected types and hasRarity. Random primaries require an eligible finite positive-weight type in the configured random pool.
  • MAGIC-06: Non-player completion keeps console-capable reload, weapon give, artifact roll/give/path and resonance administration, excluding player-only actions at every depth.

Validation: tfmc-mvn -o -B --no-transfer-progress clean verify passed (643 tests, zero failures/errors; 0 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: 34dd678e-cf06-4985-b727-0c983ae12903
📥 Commits

Reviewing files that changed from the base of the PR and between 5c1439d and 2579046.

📒 Files selected for processing: 9
  • src/main/java/net/tfminecraft/magic/command/ArtifactPathCompletion.java
  • src/main/java/net/tfminecraft/magic/command/MagicCommand.java
  • src/main/java/net/tfminecraft/magic/command/ResonanceCommand.java
  • src/main/java/net/tfminecraft/magic/command/WeaponGiveCommand.java
  • src/test/java/net/tfminecraft/magic/CommandEdgeCoverageTest.java
  • src/test/java/net/tfminecraft/magic/CommandTest.java
  • src/test/java/net/tfminecraft/magic/CompletionRegressionTest.java
  • src/test/java/net/tfminecraft/magic/WeaponGiveTest.java
  • src/test/java/net/tfminecraft/magic/command/ArtifactPathCompletionTest.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
    • Artifact path suggestions now guide you through valid types, supported rarities and available keys, while filtering out invalid or duplicate selections.
    • Artifact roll suggestions now reflect enabled types, supported rarities and eligibility for random rolls.
    • Weapon assembly suggestions now show applicable elements and parts based on the selected weapon, existing parts and available slots.
    • Console command suggestions are limited to supported commands; resonance commands no longer show tab-completion suggestions.

Tab completion now filters command suggestions by sender and input context. Artifact suggestions follow path grammar and available types. Weapon suggestions follow element visibility and assembly constraints.

Changes: Command completion

Layer / File(s) Summary
Sender-aware command routes
src/main/java/net/tfminecraft/magic/command/MagicCommand.java, src/main/java/net/tfminecraft/magic/command/ResonanceCommand.java, src/test/java/net/tfminecraft/magic/CompletionRegressionTest.java
Command suggestions are restricted by sender type and command depth. ResonanceCommand returns no suggestions. Regression tests cover console routes and resonance aliases.
Artifact completion rules
src/main/java/net/tfminecraft/magic/command/ArtifactPathCompletion.java, src/main/java/net/tfminecraft/magic/command/MagicCommand.java, src/test/java/net/tfminecraft/magic/CommandEdgeCoverageTest.java, src/test/java/net/tfminecraft/magic/CommandTest.java, src/test/java/net/tfminecraft/magic/CompletionRegressionTest.java, src/test/java/net/tfminecraft/magic/command/ArtifactPathCompletionTest.java
Artifact path completion validates prior segments and suggests valid continuations. Roll rarity suggestions depend on matching enabled types and, for random, pool membership and finite positive weight. Tests cover valid and invalid completion inputs.
Weapon assembly suggestions
src/main/java/net/tfminecraft/magic/command/WeaponGiveCommand.java, src/test/java/net/tfminecraft/magic/WeaponGiveTest.java
Element suggestions exclude elements not shown on charge. Part suggestions account for archetype, enabled status, compatibility, selected categories, and core slots.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 25790

Console users can discover the weapon-give route, and no actionable merge-blocking issue remains after normal 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:L 100-499 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 765f822 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