Skip to content

Fix drag velocity settling for embedded sheets with outside interaction - #244

Merged
dokar3 merged 1 commit into
mainfrom
fix/embedded-sheet-drag-velocity
Aug 15, 2026
Merged

Fix drag velocity settling for embedded sheets with outside interaction#244
dokar3 merged 1 commit into
mainfrom
fix/embedded-sheet-drag-velocity

Conversation

@dokar3

@dokar3 dokar3 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Fix #243

Summary by CodeRabbit

  • New Features

    • Added an embedded bottom-sheet demo showcasing peek, expand, collapse, close, theming, background controls, and outside-interaction settings.
    • Added navigation to the embedded sheet demo across supported platforms.
  • Bug Fixes

    • Improved sheet settling after drag and fling gestures by preserving and applying release velocity.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 933c3fda-229a-41b9-9e09-75b6e2fd4acb

📥 Commits

Reviewing files that changed from the base of the PR and between 639beae and 0e72bf4.

📒 Files selected for processing (9)
  • sample/src/androidMain/kotlin/com/dokar/sheets/sample/SampleNavigation.kt
  • sample/src/commonMain/kotlin/com/dokar/sheets/sample/EmbeddedSheetDemoScreen.kt
  • sample/src/commonMain/kotlin/com/dokar/sheets/sample/SampleScreen.kt
  • sample/src/desktopMain/kotlin/com/dokar/sheets/sample/SampleNavigation.kt
  • sample/src/iosMain/kotlin/com/dokar/sheets/sample/SampleNavigation.kt
  • sample/src/wasmJsMain/kotlin/com/dokar/sheets/sample/SampleNavigation.kt
  • sheets-core/src/commonMain/kotlin/com/dokar/sheets/BottomSheetState.kt
  • sheets-core/src/commonMain/kotlin/com/dokar/sheets/CoreBottomSheetLayout.kt
  • sheets-core/src/commonMain/kotlin/com/dokar/sheets/SheetNestedScrollConnection.kt

📝 Walkthrough

Walkthrough

Changes

Embedded sheet sample and gesture settling

Layer / File(s) Summary
Drag velocity propagation
sheets-core/src/commonMain/kotlin/com/dokar/sheets/*
onDragStopped stores an explicit velocity. Drag and nested-scroll handlers now pass their velocities to the sheet state.
Embedded sheet demo
sample/src/commonMain/kotlin/com/dokar/sheets/EmbeddedSheetDemoScreen.kt
Adds a themed embedded sheet demo with background interaction, behavior switches, state controls, tap tracking, and collapsible content.
Sample navigation wiring
sample/src/commonMain/kotlin/com/dokar/sheets/SampleScreen.kt, sample/src/*Main/kotlin/com/dokar/sheets/sample/SampleNavigation.kt
Adds the “Embedded sheet” action and platform-specific navigation to and from the demo route. Android navigation also removes unused imports.

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

Merge Risk: ⚪ Minimal · up to 0e72b

The change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant SampleScreen
  participant SampleNavigation
  participant EmbeddedSheetDemoScreen
  participant BottomSheetLayout
  participant BottomSheetState

  SampleScreen->>SampleNavigation: Open embedded sheet demo
  SampleNavigation->>EmbeddedSheetDemoScreen: Render demo route
  EmbeddedSheetDemoScreen->>BottomSheetLayout: Configure embedded sheet
  BottomSheetLayout->>BottomSheetState: Apply drag velocity
  BottomSheetState-->>EmbeddedSheetDemoScreen: Update sheet position
  EmbeddedSheetDemoScreen->>SampleNavigation: Navigate back
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: fixing drag-velocity settling for embedded sheets with outside interaction enabled.
Linked Issues check ✅ Passed The changes propagate drag and fling velocity into sheet settling and add an embedded-sheet demo for the reported interaction scenario [#243].
Out of Scope Changes check ✅ Passed The navigation, demo screen, and velocity-handling changes directly support the embedded-sheet settling fix and linked issue requirements.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/embedded-sheet-drag-velocity

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.

@dokar3
dokar3 merged commit 21ca54f into main Aug 15, 2026
2 checks passed
@dokar3
dokar3 deleted the fix/embedded-sheet-drag-velocity branch August 15, 2026 06:29
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.

allowOutsideInteraction=true breaks Expanded -> Peeked settling because drag velocity is not tracked

1 participant