Skip to content

fix(ADFA-3473): Resolve find in file dialog visibility issue#1295

Merged
dara-abijo-adfa merged 2 commits into
stagefrom
bug/ADFA-3473-make-find-in-file-dialog-visible
May 13, 2026
Merged

fix(ADFA-3473): Resolve find in file dialog visibility issue#1295
dara-abijo-adfa merged 2 commits into
stagefrom
bug/ADFA-3473-make-find-in-file-dialog-visible

Conversation

@dara-abijo-adfa
Copy link
Copy Markdown
Contributor

  • Prevent the keyboard from overlapping the find in file dialog
  • Hide bottom sheet peek when the keyboard is open

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

Review Change Stack

📝 Walkthrough

Release Notes

Fix: Find in File Dialog Keyboard Overlap Issue

User-Facing Improvements

  • Prevents soft keyboard from overlapping the "find in file" dialog
  • Automatically hides bottom sheet peek area when keyboard is open
  • Improved dialog visibility and usability when performing search operations

Technical Implementation

  • FullscreenManager: Now tracks fullscreen state to conditionally adjust editor container bottom margin based on AppBar collapse/expand events
  • EditorBottomSheet: Peek height is now dynamically adjusted (set to 0 when keyboard is visible) and gesture insets are consistently ignored
  • EditorSearchLayout: Search UI root element changed to use WRAP_CONTENT height instead of MATCH_PARENT for better layout control
  • layout_find_in_file.xml: Search buttons updated with fixed padding and minimum width constraints to ensure proper sizing
  • SwipeRevealLayout: Overlapping content now positioned based on measured height instead of container boundaries

⚠️ Risks and Best Practice Considerations

  • Gesture Navigation Conflict: EditorBottomSheet unconditionally disables gesture inset handling (isGestureInsetBottomIgnored = true), which may interfere with edge gesture navigation on devices using gesture-based navigation
  • Material Design Deviation: layout_find_in_file.xml buttons set android:minWidth="0dp", removing Material Design minimum sizing. Note: This pattern is established throughout the codebase (markdown-preview-plugin, snackbar_custom.xml, etc.), indicating intentional compact layout design choice
  • Multiple Layout Coordinate Changes: Four separate UI components were modified with layout parameter adjustments, increasing risk of unintended side effects and rendering inconsistencies on different screen sizes/devices
  • State Synchronization Complexity: FullscreenManager fullscreen state tracking adds conditional logic for margin calculations; improper state transitions could result in incorrect bottom spacing

Walkthrough

This PR updates the editor UI to refine fullscreen state tracking, gesture inset handling for the IME, overlapping view positioning, and search UI layout and styling. The changes span FullscreenManager, EditorBottomSheet, SwipeRevealLayout, EditorSearchLayout, and the find-in-file layout resource.

Changes

Editor UI Layout and Inset Fixes

Layer / File(s) Summary
Fullscreen state tracking and AppBar margin
app/src/main/java/com/itsaky/androidide/activities/editor/FullscreenManager.kt
isFullscreenState boolean tracks fullscreen status; default editor bottom margin changes from lazy to eager evaluation; AppBar offset listener conditionally adjusts container bottom margin only when not fullscreen.
Bottom sheet IME and gesture inset behavior
app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt
Gesture insets are unconditionally ignored; peek height is set to 0 when IME is visible, otherwise to collapsed height. Both setImeVisible and setOffsetAnchor enforce this behavior consistently.
Overlapping view layout positioning
app/src/main/java/com/itsaky/androidide/ui/SwipeRevealLayout.kt
Overlapping child positioned using its measured height instead of parent-provided bottom boundary, narrowing vertical bounds to measured content.
Search UI height and button styling
editor/src/main/java/com/itsaky/androidide/editor/ui/EditorSearchLayout.kt, editor/src/main/res/layout/layout_find_in_file.xml
Search UI root height changes from MATCH_PARENT to WRAP_CONTENT; all four search buttons (prev, next, replace, close) receive android:minWidth="0dp", android:paddingHorizontal="4dp", and explicit bottom constraints.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • appdevforall/CodeOnTheGo#1114: Both PRs modify editor UI inset/behavior code (notably EditorBottomSheet and SwipeRevealLayout) impacting how insets, IME, and overlapping/swipe-reveal layout are handled.
  • appdevforall/CodeOnTheGo#1101: Both PRs modify app-bar/immersive/fullscreen behavior affecting editor container bottom-margin and app-bar offset handling.
  • appdevforall/CodeOnTheGo#1149: Both PRs modify editor fullscreen handling and state synchronization in FullscreenManager.

Suggested reviewers

  • jatezzz
  • itsaky-adfa
  • jomen-adfa
  • Daniel-ADFA

Poem

A hoppy fix for layout grace,
Gesture insets now in place,
Fullscreen state will find its way,
Buttons styled bright today. 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. 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 directly addresses the main objective of the PR: resolving visibility issues with the find in file dialog.
Description check ✅ Passed The description is clearly related to the changeset, detailing specific fixes for keyboard overlap and bottom sheet visibility.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 bug/ADFA-3473-make-find-in-file-dialog-visible

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt (1)

345-367: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Race condition: setOffsetAnchor listener can override IME-driven peek height.

When setOffsetAnchor is called while the IME is visible, the OnGlobalLayoutListener (line 352) unconditionally sets peekHeight = collapsedHeight.roundToInt(), overriding the peekHeight = 0 set by setImeVisible. This would show the bottom sheet peek even when the keyboard is open, contradicting the PR objective.

🐛 Proposed fix to respect IME visibility when setting peek height
 				override fun onGlobalLayout() {
 					view.viewTreeObserver.removeOnGlobalLayoutListener(this)
 					anchorOffset = view.height + SizeUtils.dp2px(1f)
 
-					behavior.peekHeight = collapsedHeight.roundToInt()
+					behavior.peekHeight = if (isImeVisible) 0 else collapsedHeight.roundToInt()
 					behavior.expandedOffset = anchorOffset
 					behavior.isGestureInsetBottomIgnored = true
🤖 Prompt for 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.

In `@app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt` around lines
345 - 367, The OnGlobalLayoutListener inside setOffsetAnchor unconditionally
resets behavior.peekHeight which can override the IME-driven peekHeight set by
setImeVisible; modify the listener in setOffsetAnchor to check the current
IME-visible state (e.g., a boolean field used by setImeVisible) before assigning
behavior.peekHeight so that if IME is visible you do not set peekHeight (leave
it as 0), but still update anchorOffset, behavior.expandedOffset,
isGestureInsetBottomIgnored and padding/layout updates; reference
setOffsetAnchor, the anonymous OnGlobalLayoutListener, anchorOffset and
behavior.peekHeight when making the conditional change.
🤖 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.

Outside diff comments:
In `@app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt`:
- Around line 345-367: The OnGlobalLayoutListener inside setOffsetAnchor
unconditionally resets behavior.peekHeight which can override the IME-driven
peekHeight set by setImeVisible; modify the listener in setOffsetAnchor to check
the current IME-visible state (e.g., a boolean field used by setImeVisible)
before assigning behavior.peekHeight so that if IME is visible you do not set
peekHeight (leave it as 0), but still update anchorOffset,
behavior.expandedOffset, isGestureInsetBottomIgnored and padding/layout updates;
reference setOffsetAnchor, the anonymous OnGlobalLayoutListener, anchorOffset
and behavior.peekHeight when making the conditional change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 66dbb872-3a75-41b7-a09a-b94562bcfb7c

📥 Commits

Reviewing files that changed from the base of the PR and between 531cdcf and 2d91031.

📒 Files selected for processing (5)
  • app/src/main/java/com/itsaky/androidide/activities/editor/FullscreenManager.kt
  • app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt
  • app/src/main/java/com/itsaky/androidide/ui/SwipeRevealLayout.kt
  • editor/src/main/java/com/itsaky/androidide/editor/ui/EditorSearchLayout.kt
  • editor/src/main/res/layout/layout_find_in_file.xml

@dara-abijo-adfa dara-abijo-adfa merged commit b85bbc2 into stage May 13, 2026
2 checks passed
@dara-abijo-adfa dara-abijo-adfa deleted the bug/ADFA-3473-make-find-in-file-dialog-visible branch May 13, 2026 15:19
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