Skip to content

fix: entry list text align#327

Merged
klikli-dev merged 2 commits intoversion/1.21.1from
fix/bookmark-text-align
Mar 10, 2026
Merged

fix: entry list text align#327
klikli-dev merged 2 commits intoversion/1.21.1from
fix/bookmark-text-align

Conversation

@klikli-dev
Copy link
Copy Markdown
Owner

Closes #324

- Increase vertical spacing between entries in list screens
- Reduce the number of entries per page to accommodate larger spacing
- Vertically center text in buttons when it needs to be scaled down
- Adjust background highlight dimensions for list items

Fixes #324 - maybe at least
@klikli-dev klikli-dev merged commit b2fc3cf into version/1.21.1 Mar 10, 2026
@klikli-dev klikli-dev deleted the fix/bookmark-text-align branch March 10, 2026 12:19
klikli-dev added a commit that referenced this pull request Mar 10, 2026
* Fix bookmark text alignment

* fix: improve book list spacing and alignment

- Increase vertical spacing between entries in list screens
- Reduce the number of entries per page to accommodate larger spacing
- Vertically center text in buttons when it needs to be scaled down
- Adjust background highlight dimensions for list items

Fixes #324 - maybe at least
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses visual inconsistencies in the book UI, specifically focusing on the alignment and spacing of list items within category, entry, and search screens. By refining the rendering of list buttons and adjusting the vertical layout, the changes aim to provide a more polished and readable user experience.

Highlights

  • Enhanced UI Alignment: Improved the vertical alignment and background rendering for category and entry list buttons across various book screens.
  • Adjusted List Spacing: Increased the vertical spacing between list items to improve readability and visual separation.
  • Updated Page Capacity: Modified the number of entries displayed per page in several book screens to correctly reflect the new vertical spacing.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • common/src/main/java/com/klikli_dev/modonomicon/client/gui/book/bookmarks/BookBookmarksScreen.java
    • Reduced ENTRIES_PER_PAGE from 13 to 11 and ENTRIES_IN_FIRST_PAGE from 11 to 9.
    • Increased the vertical spacing for entry buttons from i * 11 to i * 13.
  • common/src/main/java/com/klikli_dev/modonomicon/client/gui/book/button/CategoryListButton.java
    • Adjusted the guiGraphics.fill coordinates to expand the background fill area vertically.
    • Modified the y coordinate for text rendering and added a vertical translation to center scaled text.
  • common/src/main/java/com/klikli_dev/modonomicon/client/gui/book/button/EntryListButton.java
    • Adjusted the guiGraphics.fill coordinates to expand the background fill area vertically.
    • Modified the y coordinate for text rendering and added a vertical translation to center scaled text.
  • common/src/main/java/com/klikli_dev/modonomicon/client/gui/book/index/BookCategoryIndexScreen.java
    • Reduced ENTRIES_PER_PAGE from 13 to 11 and ENTRIES_IN_FIRST_PAGE from 11 to 9.
    • Increased the vertical spacing for entry buttons from i * 11 to i * 13.
  • common/src/main/java/com/klikli_dev/modonomicon/client/gui/book/index/BookParentIndexScreen.java
    • Reduced ENTRIES_PER_PAGE from 13 to 11 and ENTRIES_IN_FIRST_PAGE from 11 to 9.
    • Increased the vertical spacing for category buttons from i * 11 to i * 13.
  • common/src/main/java/com/klikli_dev/modonomicon/client/gui/book/search/BookSearchScreen.java
    • Reduced ENTRIES_PER_PAGE from 13 to 11 and ENTRIES_IN_FIRST_PAGE from 11 to 9.
    • Increased the vertical spacing for entry buttons from i * 11 to i * 13.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses text alignment issues in entry lists, and the changes appear to be effective. The logic for vertical text centering in CategoryListButton and EntryListButton is well-implemented. The adjustments to ENTRIES_PER_PAGE are also consistent with the new item spacing. I have one suggestion to improve maintainability by replacing a magic number with a named constant, which I've noted in the relevant files.

for (int i = 0; i < count && (i + start) < this.visibleEntries.size(); i++) {
var address = this.visibleEntries.get(start + i);
Button button = new EntryListButton(this.getBook().getEntry(address.entryId()), address, this.bookLeft + x, this.bookTop + y + i * 11, this::handleButtonEntry);
Button button = new EntryListButton(this.getBook().getEntry(address.entryId()), address, this.bookLeft + x, this.bookTop + y + i * 13, this::handleButtonEntry);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The magic number 13 is used for vertical spacing. To improve maintainability and readability, it would be better to define it as a constant, for example public static final int ENTRY_VERTICAL_SPACING = 13; at the class level, and use that constant here.

void addEntryButtons(int x, int y, int start, int count) {
for (int i = 0; i < count && (i + start) < this.visibleEntries.size(); i++) {
Button button = new EntryListButton(this.visibleEntries.get(start + i), this.bookLeft + x, this.bookTop + y + i * 11, this::handleEntryListButton);
Button button = new EntryListButton(this.visibleEntries.get(start + i), this.bookLeft + x, this.bookTop + y + i * 13, this::handleEntryListButton);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The magic number 13 is used for vertical spacing. To improve maintainability and readability, it would be better to define it as a constant, for example public static final int ENTRY_VERTICAL_SPACING = 13; at the class level, and use that constant here.

protected void addEntryButtons(int x, int y, int start, int count) {
for (int i = 0; i < count && (i + start) < this.visibleEntries.size(); i++) {
Button button = new CategoryListButton(this.visibleEntries.get(start + i), this.bookLeft + x, this.bookTop + y + i * 11, this::handleButtonEntry);
Button button = new CategoryListButton(this.visibleEntries.get(start + i), this.bookLeft + x, this.bookTop + y + i * 13, this::handleButtonEntry);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The magic number 13 is used for vertical spacing. To improve maintainability and readability, it would be better to define it as a constant, for example public static final int ENTRY_VERTICAL_SPACING = 13; at the class level, and use that constant here.

void addEntryButtons(int x, int y, int start, int count) {
for (int i = 0; i < count && (i + start) < this.visibleEntries.size(); i++) {
Button button = new EntryListButton(this.visibleEntries.get(start + i), this.bookLeft + x, this.bookTop + y + i * 11, this::handleButtonEntry);
Button button = new EntryListButton(this.visibleEntries.get(start + i), this.bookLeft + x, this.bookTop + y + i * 13, this::handleButtonEntry);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The magic number 13 is used for vertical spacing. To improve maintainability and readability, it would be better to define it as a constant, for example public static final int ENTRY_VERTICAL_SPACING = 13; at the class level, and use that constant here.

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.

The text for the entries in the bookmark screen renders one pixel too low

1 participant