Skip to content

Feat/two pages for flags#28

Open
TheBjoRedCraft wants to merge 5 commits into
version/26.1from
feat/two-pages-for-flags
Open

Feat/two pages for flags#28
TheBjoRedCraft wants to merge 5 commits into
version/26.1from
feat/two-pages-for-flags

Conversation

@TheBjoRedCraft
Copy link
Copy Markdown
Member

No description provided.

@TheBjoRedCraft TheBjoRedCraft self-assigned this May 13, 2026
Copilot AI review requested due to automatic review settings May 13, 2026 13:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a two-page UI for editing protection flags in the Paper menu system, updating navigation and registrations accordingly.

Changes:

  • Split the flags editor into two views (ProtectionEditFlagsViewA and ProtectionEditFlagsViewB) and register both in the view frame.
  • Update the protection info menu to open the first flags page.
  • Add next/previous navigation items for moving between the two flags pages and bump the plugin version.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/kotlin/dev/slne/surf/protect/paper/PaperMain.kt Registers the new flags editor views with the view framework.
src/main/kotlin/dev/slne/surf/protect/paper/menu/view/ProtectionInfoView.kt Updates the “edit flags” entry point to open page A.
src/main/kotlin/dev/slne/surf/protect/paper/menu/view/flags/ProtectionEditFlagsViewA.kt Implements flags editor page A with a “next page” navigation button.
src/main/kotlin/dev/slne/surf/protect/paper/menu/view/flags/ProtectionEditFlagsViewB.kt Implements flags editor page B with a “previous page” navigation button.
src/main/kotlin/dev/slne/surf/protect/paper/menu/util/view-util.kt Adjusts previous/next navigation item display formatting.
gradle.properties Bumps snapshot version to 3.2.2-SNAPSHOT.
Comments suppressed due to low confidence (2)

src/main/kotlin/dev/slne/surf/protect/paper/menu/view/flags/ProtectionEditFlagsViewA.kt:30

  • paginationState is built from EditableProtectionFlags.entries.chunked(27)[0], but this view’s layout only exposes 21 'R' slots (3 rows × 7). Since the view doesn’t call pagination.advance()/back() anywhere, only the first page renders and the remaining flags in this chunk become unreachable. Fix by slicing to the number of available 'R' slots (e.g., 21) or by wiring up Pagination navigation like ProtectionListView does.
    src/main/kotlin/dev/slne/surf/protect/paper/menu/view/flags/ProtectionEditFlagsViewA.kt:33
  • ProtectionEditFlagsViewA and ProtectionEditFlagsViewB duplicate nearly all logic (state toggling, item rendering, click handling). This duplication makes future flag/UX changes easy to miss between pages (and has already led to page-size coupling issues). Consider extracting the shared logic into a single parameterized view (e.g., taking a page index) or a shared helper/base to keep behavior consistent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/kotlin/dev/slne/surf/protect/paper/menu/util/view-util.kt
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.

2 participants