Skip to content

ADFA-6251: Ignore output-panel drags that start above its visible edge - #2183

Open
Daniel-ADFA wants to merge 1 commit into
stagefrom
bugfix/ADFA-6251-sheet-drag-area
Open

Daniel-ADFA wants to merge 1 commit into
stagefrom
bugfix/ADFA-6251-sheet-drag-area

Conversation

@Daniel-ADFA

@Daniel-ADFA Daniel-ADFA commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-6251

Fixes #2078. Swiping up from just above the collapsed output panel opened it.

The sheet is padded at the top by the status-bar height so its tabs clear the status bar when expanded. Collapsed, that transparent strip (52dp on a Pixel) sits over the editor, and BottomSheetBehavior drags the sheet for any touch inside its bounds. EditorBottomSheetBehavior ignores gestures that start in that padding; both content_editor.xml layouts use it.

Tested on an arm64 emulator at font scale 1.0 and 2.0: a drag from the strip or 15px above the border leaves the sheet collapsed and goes to the editor; a drag from the header still opens it; a drag down from the expanded tabs still closes it. EditorBottomSheetBehaviorTest fails against the stock behavior.

The editor bottom sheet is padded at the top by the status-bar height
so its tabs clear the status bar when it expands to the top of the
window. While collapsed, that transparent padding sits above the
visible border, over the editor, and BottomSheetBehavior treats any
drag inside the view's bounds as a drag on the sheet. A swipe that
started up to a status bar's height above the border opened the panel.

EditorBottomSheetBehavior drops a gesture whose ACTION_DOWN lands in
the top padding, so the view underneath keeps it.
@Daniel-ADFA

Copy link
Copy Markdown
Contributor Author

close #2078

@Daniel-ADFA
Daniel-ADFA marked this pull request as ready for review October 24, 2026 10:21

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@Daniel-ADFA
Daniel-ADFA requested a review from a team October 24, 2026 10:21
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 191b2581-0f01-48b3-849e-bbfba6e912fc
Commits

Reviewing files that changed from the base of the PR and between 04c9e8f and 616e729.

Files selected for processing: 4
  • app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheetBehavior.kt
  • app/src/main/res/layout-land/content_editor.xml
  • app/src/main/res/layout/content_editor.xml
  • app/src/test/java/com/itsaky/androidide/ui/EditorBottomSheetBehaviorTest.kt

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Summary
  • Added EditorBottomSheetBehavior to ignore touch gestures that start in the output panel’s top padding. Those gestures remain with the view underneath; gestures that start on the visible panel can still drag it.
  • Updated both content_editor.xml layouts to use the custom behavior.
  • Added Robolectric tests for drags that start in the top padding and on the visible panel.
  • Risk: the behavior uses the child’s top padding as the gesture boundary. No test execution results were provided.

The editor bottom sheet now uses a custom behavior that ignores gestures starting above its top padding and delegates other gestures to the superclass. Robolectric tests cover gestures starting in the padding and on the visible sheet.

Changes: Editor bottom sheet gesture routing

Layer / File(s) Summary
Gesture routing and layout integration
app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheetBehavior.kt, app/src/main/res/layout*/content_editor.xml
The custom behavior returns false for gestures that start above the sheet’s top padding. Both editor layout variants use this behavior. Other gestures are delegated to the superclass.
Gesture path tests
app/src/test/java/com/itsaky/androidide/ui/EditorBottomSheetBehaviorTest.kt
Robolectric tests verify that a drag starting in the top padding leaves the sheet collapsed and delivers move events to the editor without cancellation. A drag starting on the visible sheet moves it into the dragging state.

Priority: Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: hal-eisen-adfa, jatezzz

Merge Risk: Minimal · up to 616e7

Drags starting above the visible panel border are excluded by the new behavior. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing output-panel drags that start above the visible edge.
Description check Passed The description directly explains the reported issue, the implemented behavior, affected layouts, testing scope, and linked issue.
Linked Issues check Passed Issue #2078 requires swipe detection to start at the visible output-panel border. EditorBottomSheetBehavior records the initial touch and bypasses BottomSheetBehavior when the touch starts in the …
Out of Scope Changes check Passed The changes are limited to the custom bottom-sheet behavior, its use in the two editor layouts, and focused automated tests. Each change supports issue #2078.
Full details: Linked Issues check

Explanation

Issue #2078 requires swipe detection to start at the visible output-panel border. EditorBottomSheetBehavior records the initial touch and bypasses BottomSheetBehavior when the touch starts in the sheet's top padding. Both content_editor.xml layouts use the behavior. EditorBottomSheetBehaviorTest verifies that padding drags remain collapsed and that visible-panel drags still move the sheet.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit taps the sheet, then starts to glide,
The padded edge lets editor events ride.
The visible top can move the panel high,
Two paths are checked as pixels hurry by.
I nibble code, then hop beneath the sky.

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

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.

Inaccurate swipe detection on ouput panel

1 participant