Skip to content

Fix keyboard dismissal when opening message sheets#1417

Draft
agent-p1p wants to merge 1 commit into
masterfrom
pip/whitenoise-android-1396
Draft

Fix keyboard dismissal when opening message sheets#1417
agent-p1p wants to merge 1 commit into
masterfrom
pip/whitenoise-android-1396

Conversation

@agent-p1p

@agent-p1p agent-p1p commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • rebase onto current master after refactor: share keyboard-safe popup behavior #1418 and reuse its shared KeyboardSafePopup abstraction
  • migrate edit history and message info sheets without stealing composer focus or dismissing the visible IME
  • preserve the visual dismissal scrim, bottom anchoring, navigation insets, and modal accessibility semantics
  • make shared keyboard-safe overlays dismiss at overlay Back priority before the IME callback
  • leave the focusable forwarding search sheet unchanged; reaction details already use the shared popup from refactor: share keyboard-safe popup behavior #1418

Validation

  • ./gradlew :app:compileDevZapstoreDebugKotlin :app:compileDevPlayDebugKotlin :app:testDevZapstoreDebugUnitTest :app:testDevPlayDebugUnitTest :app:verifyRoborazziDevZapstoreDebug :app:verifyRoborazziDevPlayDebug :app:ktlintCheck :app:lintDevZapstoreDebug :app:lintDevPlayDebug --no-daemon --stacktrace
  • focused popup/sheet coverage tests on the Play debug variant
  • committed-tree conflict-marker, duplicate-function, diff, and base-parent sweeps

Manual IME behavior remains to be confirmed on the regenerated preview APK.

Fixes #1396


Open in Stage

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Changes

Keyboard-preserving conversation sheets

Layer / File(s) Summary
Keyboard-preserving sheet container
app/src/main/java/dev/ipf/whitenoise/android/ui/design/AppSheets.kt
Adds a non-focusable full-window popup with bottom-aligned content, scrim dismissal, back handling, and accessibility semantics.
Conversation sheet migrations
app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/reactions/Reactions.kt, app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/messages/EditHistory.kt, app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/messages/MessageFullScreen.kt
Migrates reaction details, edit history, and message info from ModalBottomSheet to KeyboardPreservingBottomSheet.
Container and migration coverage
app/src/test/java/dev/ipf/whitenoise/android/ui/KeyboardPreservingBottomSheetCoverageTest.kt
Adds static checks for overlay behavior, migrated sheets, and the retained focusable forward sheet.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Reaction, edit history, and message info sheets now use a non-focusable popup sheet, preserving keyboard state and dismissal behavior; Forward sheet remains modal.
Out of Scope Changes check ✅ Passed The changes are limited to the keyboard-safe bottom sheet abstraction, sheet migrations, and coverage tests, with no unrelated scope evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: keeping the keyboard from dismissing when opening message-related sheets.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pip/whitenoise-android-1396

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.

@stage-review

stage-review Bot commented Jul 15, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Enhance KeyboardSafePopup with overlay-priority dismissal
2 Create KeyboardPreservingBottomSheet component
3 Migrate message sheets to keyboard-preserving implementation
4 Verify sheet behavior and accessibility with tests
Open in Stage

Chapters generated by Stage for commit e4557a6 on Jul 18, 2026 8:33pm UTC.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Preview APK for PR #1417

Home-screen label: 1417 White Noise with the blueprint launcher icon — installs side-by-side with the production and staging apps.

Install directly — one tap, no GitHub sign-in (public, content-addressed .apk). ARM64 only.

Every push to this PR rebuilds and updates this comment.

@agent-p1p agent-p1p left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BLOCKING:
none

SUGGESTION:

  • Runtime IME/focus behavior is not exercised by the new coverage: app/src/test/java/dev/ipf/whitenoise/android/ui/KeyboardPreservingBottomSheetCoverageTest.kt:10-66 only parses source text. Keep the preview-APK manual check explicit, or add a Compose/instrumentation regression test when the harness can drive IME focus, sheet placement, Back, and scrim dismissal.

NITPICK:

  • app/src/main/java/dev/ipf/whitenoise/android/ui/design/AppSheets.kt:98 passes the raw onDismissRequest to Popup, while Back and scrim paths use currentOnDismissRequest. Use the updated reference there too for consistency and to avoid stale captures if Popup dismissal becomes active later.

SUMMARY: The shared non-focusable popup is a small, appropriate extraction and all three in-scope sheets use it; ForwardMessageSheet remains unchanged. I verified the resolved Compose dependency is ui-android:1.12.0-alpha03; its PopupLayout measures clipped popups from the host view getWindowVisibleDisplayFrame, so the zero-origin, bottom-aligned full-frame popup is bounded above the already-open IME rather than requiring an extra imePadding(). Overlay-priority Back, scrim consumption, navigation insets, and sensitive-path scope look correct. Targeted unit coverage, ktlint, and Android lint pass locally; all GitHub checks are green.
VERDICT: APPROVE
SENSITIVE_PATHS: none

@agent-p1p

Copy link
Copy Markdown
Contributor Author

Coordination with #1418: #1418 should land first as the shared keyboard-safe popup abstraction. Afterward, rebase this PR and migrate the remaining message sheets onto KeyboardSafePopup, preserving this PR’s accessibility and Back-priority safeguards as needed. Do not merge the current duplicate sheet implementation as-is after #1418.

@agent-p1p

Copy link
Copy Markdown
Contributor Author

Addressed the dismissal-callback consistency nit in 4a4e28e: Popup now uses the rememberUpdatedState-backed callback, matching Back and scrim dismissal. Focused unit coverage and ktlint pass locally. Runtime IME verification remains called out explicitly in the PR body for the preview APK.

@agent-p1p

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/main/java/dev/ipf/whitenoise/android/ui/design/AppSheets.kt`:
- Around line 61-155: The KeyboardPreservingBottomSheet implementation
duplicates popup and back-handling behavior that should come from the shared
abstraction. After rebasing onto PR `#1418`, replace the custom Popup, dispatcher
registration, and fallback BackHandler logic with KeyboardSafePopup, preserving
the existing sheet content, scrim dismissal, positioning, and modifier behavior
through that abstraction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f807769c-ee53-4b86-bcf8-64f26195385e

📥 Commits

Reviewing files that changed from the base of the PR and between 9550127 and 4a4e28e.

📒 Files selected for processing (5)
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/messages/EditHistory.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/messages/MessageFullScreen.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/conversation/reactions/Reactions.kt
  • app/src/main/java/dev/ipf/whitenoise/android/ui/design/AppSheets.kt
  • app/src/test/java/dev/ipf/whitenoise/android/ui/KeyboardPreservingBottomSheetCoverageTest.kt

Comment thread app/src/main/java/dev/ipf/whitenoise/android/ui/design/AppSheets.kt
@mubarakcoded

Copy link
Copy Markdown
Contributor

@agent-p1p what's blocking this PR?

Move edit history and message info onto the shared non-focusable popup so opening them preserves composer focus and the IME. Keep visual scrim and modal accessibility semantics, and make shared Back dismissal run before the IME callback.

Fixes #1396
@agent-p1p
agent-p1p force-pushed the pip/whitenoise-android-1396 branch from 4a4e28e to e4557a6 Compare July 18, 2026 20:32
@agent-p1p

Copy link
Copy Markdown
Contributor Author

@mubarakcoded #1418 was the blocker. It merged, but this branch had since drifted into conflicts. I rebased it onto current master, replaced the duplicate popup plumbing with KeyboardSafePopup, preserved the sheet accessibility/scrim and overlay-priority Back behavior, and force-pushed signed head e4557a6. Full local CI-equivalent checks pass for both debug flavors. Fresh GitHub checks and manual IME validation on the regenerated preview APK are the remaining gates.

@agent-p1p

Copy link
Copy Markdown
Contributor Author

Update: all GitHub checks are green at e4557a6, CodeRabbit marked its thread resolved, and the refreshed preview APK is available: https://nostr.download/1e7c2c76c249f6545b3ce7e859cfabc9379483e44678d4e6ffb4f8a7acbdecd4.apk. The only remaining blocker is manual IME behavior confirmation on that APK; the PR stays draft until that check is done.

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.

Reactor list / Edit History / Message Info sheets close the keyboard on open — should stay pinned above it, like the long-press menu (#284)

2 participants