Skip to content

fix(ui): use the full window width next to a display cutout on the short edge - #6809

Open
ToteMeiSter wants to merge 2 commits into
nextcloud:masterfrom
ToteMeiSter:fix/display-cutout-landscape
Open

ToteMeiSter wants to merge 2 commits into
nextcloud:masterfrom
ToteMeiSter:fix/display-cutout-landscape

Conversation

@ToteMeiSter

Copy link
Copy Markdown
Contributor

On a foldable with a camera hole on the inner screen, the chat and the conversation list show a black bar along the cutout edge after the device is rotated to landscape. The bar has the width of the cutout and spans the full height. In portrait there is no bar. The current release from the store shows the same bar on this device.

Cause

  • ChatActivity and ConversationsListActivity use AppTheme. AppTheme and its parents do not set windowLayoutInDisplayCutoutMode, so the window uses the default mode. Only FullScreenImageTheme and ImagePickerTheme.NonFullScreen set shortEdges (res/values-v27/styles.xml).
  • Edge-to-edge (adjustUIForAPILevel35) and the insets listener in ChatActivity are only active on API 35 and higher.
  • In landscape the cutout is on a side edge without a system bar. In the default mode the window is then kept out of the cutout area, which leaves the black bar.

Fix

  • New theme AppTheme.DisplayCutout: empty in values/styles.xml, windowLayoutInDisplayCutoutMode=shortEdges in values-v28/styles.xml. Only ChatActivity and ConversationsListActivity use it.
  • keepContentOutOfDisplayCutout() (AppCompatActivityExtensions.kt): below API 35 it adds the left and right cutout insets to the padding of android.R.id.content, so the content does not go under the camera. If there is no cutout on a side, the inset is 0. From API 35 the existing edge-to-edge handling applies and the function does nothing.
  • Other screens on AppTheme are not changed.

Tests

  • New Robolectric test DisplayCutoutPaddingTest (API 31, 2 tests): the left/right cutout inset goes into the padding, the top padding is not changed, and a cutout that moves to the other side updates the padding. Without the inset handling both tests fail.
  • The test does not cover the theme attribute and how the system places the window.
  • Checked on a device: Huawei DEL-LX9 (Build.VERSION.SDK_INT = 31), landscape on the inner screen: the black bar is gone.

🖼️ Screenshots

🏚️ Before 🏡 After
black bar next to the camera hole in landscape no bar

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The analysis, the code, the test and this description were made with Claude Code (Assisted-by trailer in the commit) and reviewed by the author. The fix was verified by the author on the device above.

🤖 Generated with Claude Code

…ort edge

With windowLayoutInDisplayCutoutMode=default (AppTheme), the system moves the whole
window away from a cutout that is not inside the status bar. On a foldable with a camera
hole on the short edge of the inner screen this leaves a black bar in landscape, so the
chat and the conversation list do not use the full width.

Chat and conversation list use AppTheme.DisplayCutout (shortEdges, API 28+) and pad
their content by the left and right cutout inset below API 35.

Assisted-by: Claude-Code:claude-opus-5-5
Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3ce4b66b-3adf-4d58-aa77-3cee2b449af9
📥 Commits

Reviewing files that changed from the base of the PR and between ffc6be2 and e3bcfb8.

📒 Files selected for processing (2)
  • app/src/main/java/com/nextcloud/talk/utils/AppCompatActivityExtensions.kt
  • app/src/main/res/values/styles.xml
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/main/res/values/styles.xml
  • app/src/main/java/com/nextcloud/talk/utils/AppCompatActivityExtensions.kt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The chat and conversation list activities now use a theme that enables layout into short-edge display cutouts. New extensions apply horizontal cutout inset padding below API 35. ChatActivity calls the activity extension after setting its content view. Robolectric tests cover right-side cutout padding and padding updates when the cutout moves to the left.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to e3bcf

The cutout change has no established merge-blocking issue; it is ready for normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main UI fix: using the full window width beside a display cutout on the short edge.
Description check ✅ Passed The description explains the cause, fix, tests, and device verification, and includes screenshots and most checklist items. The TODO section is omitted, and the backport and milestone checklist items …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1dfb1f3e-12b2-415f-a426-3b1e5180d656
📥 Commits

Reviewing files that changed from the base of the PR and between 1e9c2f1 and ffc6be2.

📒 Files selected for processing (7)
  • app/src/main/AndroidManifest.xml
  • app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
  • app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt
  • app/src/main/java/com/nextcloud/talk/utils/AppCompatActivityExtensions.kt
  • app/src/main/res/values-v28/styles.xml
  • app/src/main/res/values/styles.xml
  • app/src/test/java/com/nextcloud/talk/utils/DisplayCutoutPaddingTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@mahibi

mahibi commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Hi @ToteMeiSter thank you for your contributions.
We will review them soon

The conversation list is a Compose screen whose Scaffold and top bar already
keep out of the display cutout by WindowInsets.safeDrawing. Padding
android.R.id.content by the cutout as well narrowed the list beyond the
cutout-safe area on API 28 to 34. The padding stays for the view based chat.

Assisted-by: Claude-Code:claude-opus-5-5
Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
@ToteMeiSter

Copy link
Copy Markdown
Contributor Author

This is a bug fix and all CodeRabbit review threads are resolved. Once it is approved and merged, would it be possible to backport it to stable-25.0.x (e.g. for 25.0.3)? The bug is present in v25.0.2.

Suggested command for a maintainer after merge: /backport to stable-25.0.x

This comment was drafted with AI assistance (Claude Code).

@ToteMeiSter

Copy link
Copy Markdown
Contributor Author

Re-checked on the device after the review fix e3bcfb8 (Huawei DEL-LX9, SDK_INT 31, inner screen, landscape): no black bar along the cutout and no double cutout padding in the conversation list and the chat.

Drafted with AI assistance (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants