Skip to content

Add pagination to help commands (/is help [page])#2859

Merged
tastybento merged 3 commits intodevelopfrom
copilot/add-advanced-help-page
Mar 14, 2026
Merged

Add pagination to help commands (/is help [page])#2859
tastybento merged 3 commits intodevelopfrom
copilot/add-advanced-help-page

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 14, 2026

The /is help command dumped all commands in one unnavigable wall of text. This adds paginated help so players can use /is help, /is help 2, etc. to browse commands 10 at a time.

Core changes

  • DefaultHelpCommand: Replaced the depth-based recursive display model with a flat, paginated one.

    • Numeric arg is now a 1-indexed page number (was: recursion depth — a confusing internal detail that leaked into the public API)
    • getHelpEntries(User) — new protected method that collects all permission-visible commands into a flat list; designed to be overridden by subclasses
    • addHelpEntry(User, CompositeCommand, List) — permission/hidden-aware entry builder
    • COMMANDS_PER_PAGE = 10 (protected constant)
    • Page indicator (Page X of Y) shown only when totalPages > 1
    • tabComplete override returns valid page numbers
  • BentoBoxHelpCommand: Replaced execute override with a getHelpEntries override — addon commands are now included in the paginated list naturally, and the previous double-footer bug is gone.

  • en-US.yml: Added commands.help.page: '&7 Page &e[page]&7 of &e[total]'

Behavior example

/is help        → Page 1 of 3 (commands 1–10)
/is help 2      → Page 2 of 3 (commands 11–20)
/is help 3      → Page 3 of 3 (commands 21–N)

showPrettyHelp is retained for backward compatibility with any existing subclasses.

Original prompt

This section details on the original issue you should resolve

<issue_title>/is help changes</issue_title>
<issue_description>### Description
I would like a more advanced help page to be added that has multiple pages so that when typing /is help 1 you get page 1 with enough commands for all of them to be readable and with /is help 2 you get a second page of commands and so on.

Is your feature request related to a problem?

You cannot read the entire help page with the current /is help command

Describe the solution you'd like us to implement.

I would like a more advanced help page to be added that has multiple pages so that when typing /is help 1 you get page 1 with enough commands for all of them to be readable and with /is help 2 you get a second page of commands and so on.

Describe alternatives you've considered.

Making a custom version I would use for myself

Additional context

</issue_description>

Comments on the Issue (you are @copilot in this section)

@tastybento Duplicate of https://github.com//issues/8, but I'll close that one and keep this one open.

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot AI changed the title [WIP] Add advanced help page with multiple pages Add pagination to help commands (/is help [page]) Mar 14, 2026
Copilot AI requested a review from tastybento March 14, 2026 19:39
@tastybento tastybento marked this pull request as ready for review March 14, 2026 19:51
@tastybento
Copy link
Copy Markdown
Member

@copilot There are test failures. Fix them.

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 14, 2026

@copilot There are test failures. Fix them.

Fixed in 313a49f. The failures were all NullPointerException: Cannot invoke "String.isEmpty()" because "entry[1]" is null — test mocks for getTranslationOrNothing returned null when not explicitly stubbed. Added null guards in addHelpEntry (params != null ? params : "") in both DefaultHelpCommand and BentoBoxHelpCommand, and also hardened the display loop with entry[1] == null || entry[1].isEmpty(). All tests now pass.

@sonarqubecloud
Copy link
Copy Markdown

@tastybento tastybento merged commit fe91685 into develop Mar 14, 2026
3 checks passed
@tastybento tastybento deleted the copilot/add-advanced-help-page branch March 14, 2026 20:45
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.

/is help changes

2 participants