Skip to content

Add a read-only vote streak progression menu - #1716

Merged
BenCodez merged 3 commits into
masterfrom
feature/vote-streaks-menu
Oct 16, 2026
Merged

BenCodez merged 3 commits into
masterfrom
feature/vote-streaks-menu

Conversation

@BenCodez

@BenCodez BenCodez commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Adds /vote streaks, a separate read-only inventory view of existing daily, weekly and monthly vote streaks and enabled configured milestones. It shows progress without claiming rewards or changing progression. Existing /vote, /vote streak and production menus retain their behavior; this feature is separate from the experimental GUI test branch.

Existing enabled custom commands matching streaks, including aliases, retain precedence. Added actual root-dispatch regression coverage.

Permission: VotingPlugin.Commands.Vote.Streaks (or the existing player command bundle). Optional title in GUI.yml: CHEST.VoteStreaks.Name, default &6Vote streaks; existing files need no manual migration. User loading stays on the persistence worker, inventory work uses the player owner scheduler, and exact holder/session checks isolate interactions and invalidate stale callbacks.

Validation for the candidate published as ccfe5f1cf132ceef257fa87e1598901b52adbe70 (current master integrated; both streak-menu and setup-reminder shutdown cleanup retained):

  • 30 focused streak and setup-reminder lifecycle tests passed.
  • Clean Maven package: 2,546 unit tests passed, one optional test skipped, plus five packaged-artifact tests passed.
  • Initial independent source review: No findings; this existing-PR follow-up received focused lead inspection of registration, dispatch, permissions and reload paths.
  • Complete changed-file and base-to-HEAD disclosure validation, native commit hooks and whitespace checks passed.

JAR SHA-256: 2811600d12548a09985f391b05f4c1f60cb96fcc78a6ed4e3cbfea2ad6531c08 (10,671,890 bytes, exceeding the advisory 10 MiB target). Package/resource checks passed. Hosted checks and reviews for this new commit remain pending; local source validation is not hosted clearance. These are unit/mocked integration and artifact checks; live Spigot/Paper/Folia and visual-client verification remain unperformed. External live-unload tools that disable owner scheduling are unsupported; use the plugin reload or a normal server restart. See docs/vote-streaks-menu.md for configuration and manual testing.

Summary by CodeRabbit

  • New Features
    • Added a read-only /vote streaks menu showing current and best daily, weekly, and monthly streaks, plus paginated milestone progress.
    • Added a dedicated permission for access; the menu can be customized through the GUI configuration.
  • Documentation
    • Added a guide covering the menu, its displayed information, configuration, and navigation.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T17:31:34.920604Z ccfe5f1 New commits
🔒 Security Review ✅ Completed 2026-10-15T15:06:40.955431Z c6a099f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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: 5b2f6a17-a632-4760-8981-b24530f66030
📥 Commits

Reviewing files that changed from the base of the PR and between 2b59b83 and ccfe5f1.

📒 Files selected for processing: 3
  • VotingPlugin/src/main/java/com/bencodez/votingplugin/commands/CommandLoader.java
  • VotingPlugin/src/test/java/com/bencodez/votingplugin/streaks/VoteStreaksCommandTest.java
  • docs/vote-streaks-menu.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

⏰ Context from checks skipped due to timeout: 3
  • GitHub Check: build
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (actions)
🔇 Additional comments: 3
VotingPlugin/src/main/java/com/bencodez/votingplugin/commands/CommandLoader.java: 1

4072-4073: LGTM!

VotingPlugin/src/test/java/com/bencodez/votingplugin/streaks/VoteStreaksCommandTest.java: 1

39-73: LGTM!

docs/vote-streaks-menu.md: 1

7-8: LGTM!

📝 Walkthrough

The change adds a read-only /vote streaks inventory menu. It displays daily, weekly, and monthly streak values and paginated milestone data. The plugin registers the command and menu, adds menu configuration and a permission, and manages menu sessions during player events, reloads, and shutdown.

Changes: Vote Streaks Menu

Layer / File(s) Summary
Read-only streak snapshots
VotingPlugin/src/main/java/com/bencodez/votingplugin/specialrewards/votestreak/VoteStreakHandler.java, VotingPlugin/src/main/java/com/bencodez/votingplugin/streaks/VoteStreaksSnapshot.java, VotingPlugin/src/test/java/com/bencodez/votingplugin/streaks/VoteStreaksReadOnlyTest.java, VotingPlugin/src/test/java/com/bencodez/votingplugin/streaks/VoteStreaksSnapshotTest.java
The handler builds display snapshots from enabled definitions and existing streak values. The snapshot records normalize values, limit milestone rows, and provide five-item pagination. Tests cover snapshot contents, reload behavior, and pagination.
Asynchronous menu and lifecycle
VotingPlugin/src/main/java/com/bencodez/votingplugin/streaks/VoteStreaksMenu.java, VotingPlugin/src/test/java/com/bencodez/votingplugin/streaks/VoteStreaksMenuTest.java
The menu loads snapshots asynchronously, renders streak and milestone data, and supports navigation, refresh, and close controls. It validates sessions and handles inventory, player, reload, and shutdown events. Tests cover scheduling, session invalidation, event handling, and failure cleanup.
Command registration and configuration
VotingPlugin/src/main/java/com/bencodez/votingplugin/VotingPluginMain.java, VotingPlugin/src/main/java/com/bencodez/votingplugin/commands/CommandLoader.java, VotingPlugin/src/main/java/com/bencodez/votingplugin/streaks/VoteStreaksCommand.java, VotingPlugin/src/main/java/com/bencodez/votingplugin/config/GUI.java, VotingPlugin/src/main/resources/GUI.yml, VotingPlugin/src/main/resources/plugin.yml, VotingPlugin/src/test/java/com/bencodez/votingplugin/streaks/VoteStreaksCommandTest.java, docs/vote-streaks-menu.md
The plugin registers and manages the menu and registers the Streaks command. Configuration sets the menu title, and the plugin descriptor adds its permission. Tests and documentation describe command registration and menu behavior.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Player
  participant VoteStreaksCommand
  participant VoteStreaksMenu
  participant VoteStreakHandler
  participant BukkitInventory
  Player->>VoteStreaksCommand: Run Streaks command
  VoteStreaksCommand->>VoteStreaksMenu: Open menu
  VoteStreaksMenu->>VoteStreakHandler: Read display snapshot on worker
  VoteStreakHandler-->>VoteStreaksMenu: Return streak snapshot
  VoteStreaksMenu->>BukkitInventory: Render snapshot on player owner
  BukkitInventory-->>Player: Display streaks and milestones
Loading
Merge Risk: ⚪ Minimal · up to ccfe5

The change adds a read-only streaks menu and registers a permission-gated command. No actionable merge-blocking risk was identified in the supplied changes.

Security architecture risk: 🔵 Low · up to ccfe5

The new view is restricted to a permitted player's own progress and does not invoke reward-granting or progression-changing operations. Session and inventory controls contain the new path, but live-server reload and shutdown behavior remains unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The new player-controlled entrypoint takes no target-account selector. Persistence lookup uses the invoking player's captured UUID and name, limiting the displayed account data to that identity. Requests consume shared plugin worker and session capacity within explicit limits.

Trust Boundaries and Controls

  • observed — The command requires a Player sender. The menu independently checks online status and permission at admission, asynchronous completion, rendering and interaction. Opening a managed inventory requires the matching player object, current session and exact holder, so the control does not rely solely on external command-handler enforcement.

Resilience and Maintainability Implications

  • observed — Admission is bounded to 16 loads and 128 sessions. Worker failures and rejection release load capacity and retire matching sessions. Inventory closure, quit, world change and death invalidate sessions, while delayed cleanup avoids closing an inventory adopted by a newer request.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 5.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 89 functions across 11 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding a read-only vote streak progression menu.
Full details: Docstring Coverage

Explanation

Docstring coverage is 5.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 89 functions across 11 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b59b83123

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

*/
private void loadVoteCommand() {
plugin.setVoteCommand(new ArrayList<>());
com.bencodez.votingplugin.streaks.VoteStreaksCommand.register(plugin);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve custom /vote streaks command precedence

When AddCustomCommands is enabled and an existing custom entry uses Args: [streaks], this registers the built-in handler first, while custom handlers are appended later in loadVoteCommand() around line 4051; CommandVote stops after the first matching runCommand, so a drop-in upgrade silently replaces the administrator's configured message or commands with this menu. Skip the built-in on a custom collision or otherwise retain custom-handler precedence.

AGENTS.md reference: AGENTS.md:L44-L47

Useful? React with 👍 / 👎.

@BenCodez
BenCodez merged commit f79e4c5 into master Oct 16, 2026
6 checks passed
@BenCodez
BenCodez deleted the feature/vote-streaks-menu branch October 16, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant