Skip to content

Fix horizontal ChapterNavigator overlapping system nav buttons in landscape#1660

Draft
cuong-tran wants to merge 1 commit into
masterfrom
cursor/fix-chapter-navigator-landscape-insets-53da
Draft

Fix horizontal ChapterNavigator overlapping system nav buttons in landscape#1660
cuong-tran wants to merge 1 commit into
masterfrom
cursor/fix-chapter-navigator-landscape-insets-53da

Conversation

@cuong-tran

@cuong-tran cuong-tran commented May 22, 2026

Copy link
Copy Markdown
Collaborator

In landscape mode with floating system navigation buttons, the horizontal ChapterNavigator (NavBarType.Bottom) spans the full screen width without accounting for system navigation bar insets, causing it to overlap with the floating nav buttons.

Changes

  • Add modifier parameter to ChapterNavigator and ChapterNavigatorVert (standard Compose convention, defaults to Modifier)
  • In ReaderAppBars, pass WindowInsets.navigationBars.only(WindowInsetsSides.Horizontal) to the horizontal ChapterNavigator so it respects system navigation bar padding on the left/right edges
  • The ReaderBottomBar already handles its own windowInsetsPadding(WindowInsets.navigationBars) independently

Files changed

  • ChapterNavigator.kt — added modifier parameter to both ChapterNavigator and ChapterNavigatorVert, applied to root layout elements
  • ReaderAppBars.kt — added WindowInsetsSides/only imports, passed horizontal navigation bar insets modifier to the bottom ChapterNavigator

Add a 👍 reaction to pull requests you find important.

Open in Web Open in Cursor 

Summary by Sourcery

Ensure the reader chapter navigator respects system navigation insets in landscape mode to avoid overlapping system navigation buttons.

New Features:

  • Allow ChapterNavigator and ChapterNavigatorVert composables to accept an optional Modifier parameter for external layout and insets control.

Bug Fixes:

  • Apply horizontal navigation bar window insets to the bottom ChapterNavigator in ReaderAppBars to prevent overlap with floating system navigation buttons in landscape.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

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 a UI layout issue where the horizontal 'ChapterNavigator' overlaps with system navigation buttons when the device is in landscape mode. By introducing a configurable modifier to the navigation components and applying appropriate window insets, the UI now correctly respects system navigation bar boundaries.

Highlights

  • Modifier Support: Added a 'modifier' parameter to 'ChapterNavigator' and 'ChapterNavigatorVert' components to allow external styling and layout adjustments.
  • System Navigation Insets: Updated 'ReaderAppBars' to apply horizontal navigation bar insets to the 'ChapterNavigator', preventing overlap with floating system navigation buttons in landscape mode.
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 the 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 counterproductive. 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.


In landscape view the buttons hide, / The navigator spans too wide. / With insets set to keep the space, / The UI finds its proper place.

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.

@sourcery-ai

sourcery-ai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a standard Compose modifier parameter to ChapterNavigator variants and wires it through ReaderAppBars so the horizontal chapter navigator respects horizontal navigation bar insets in landscape, preventing overlap with system navigation buttons.

File-Level Changes

Change Details Files
Introduce a modifier parameter to ChapterNavigator and ChapterNavigatorVert and apply it to their root layouts.
  • Add a Modifier parameter with a default value to ChapterNavigator and pass it through when delegating to ChapterNavigatorVert
  • Replace the hardcoded Modifier on the ChapterNavigator Row with the passed-in modifier before existing fillMaxWidth and padding calls
  • Add a Modifier parameter with a default value to ChapterNavigatorVert and use it instead of a hardcoded Modifier on the root Column
app/src/main/java/eu/kanade/presentation/reader/components/ChapterNavigator.kt
Apply horizontal navigation bar insets to the bottom ChapterNavigator in ReaderAppBars.
  • Import WindowInsetsSides and only from androidx.compose.foundation.layout
  • Pass a Modifier.windowInsetsPadding(WindowInsets.navigationBars.only(WindowInsetsSides.Horizontal)) into the horizontal ChapterNavigator call in ReaderAppBars so it avoids overlapping system nav buttons
app/src/main/java/eu/kanade/presentation/reader/appbars/ReaderAppBars.kt

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Copy link
Copy Markdown
Contributor

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 introduces a modifier parameter to the ChapterNavigator and ChapterNavigatorVert components to handle window insets, specifically ensuring that horizontal navigation bars are respected. While the implementation allows for better layout control, feedback indicates that several call sites for vertical navigators in ReaderAppBars.kt were not updated, which may result in UI elements overlapping with system navigation buttons in landscape mode.

totalPages = totalPages,
onPageIndexChange = onPageIndexChange,
// KMK -->
modifier = modifier,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The call sites for vertical navigators in ReaderAppBars.kt (around lines 175 and 209) were not updated to pass the horizontal inset modifier. This means the vertical sliders might still overlap with system navigation buttons in landscape mode, even though ChapterNavigatorVert now supports the modifier parameter. Consider applying the same inset logic to those call sites as well.

References
  1. Avoid making purely positive or complimentary comments that do not suggest any action or improvement.

…dscape

In landscape mode with floating system navigation buttons, the horizontal
ChapterNavigator (NavBarType.Bottom) spanned the full screen width without
accounting for system navigation bar insets, causing it to overlap with the
floating nav buttons.

Add a modifier parameter to ChapterNavigator/ChapterNavigatorVert and pass
WindowInsets.navigationBars horizontal insets from ReaderAppBars when the
navigator is displayed horizontally at the bottom.

Co-authored-by: Cuong-Tran <cuong-tran@users.noreply.github.com>
@cursor cursor Bot force-pushed the cursor/fix-chapter-navigator-landscape-insets-53da branch from 122870a to c6b9a35 Compare May 22, 2026 18:38
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