Feat/two pages for flags#28
Open
TheBjoRedCraft wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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 (
ProtectionEditFlagsViewAandProtectionEditFlagsViewB) 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
paginationStateis built fromEditableProtectionFlags.entries.chunked(27)[0], but this view’s layout only exposes 21 'R' slots (3 rows × 7). Since the view doesn’t callpagination.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 likeProtectionListViewdoes.
src/main/kotlin/dev/slne/surf/protect/paper/menu/view/flags/ProtectionEditFlagsViewA.kt:33ProtectionEditFlagsViewAandProtectionEditFlagsViewBduplicate 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.