feat(bottom-sheet): add dismissal controls - #14
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesBottomSheet dismissal controls
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR adds coordinated dismissal controls while preserving existing defaults and reports focused tests and builds passing; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant BottomSheet
participant BottomSheetDismissalAction
participant CustomCloseAction
participant EnvironmentDismissAction
BottomSheet->>BottomSheetDismissalAction: request dismissal
alt dismissal enabled and custom action exists
BottomSheetDismissalAction->>CustomCloseAction: invoke onClose
else dismissal enabled without custom action
BottomSheetDismissalAction->>EnvironmentDismissAction: invoke dismiss
else dismissal disabled
BottomSheetDismissalAction-->>BottomSheet: return without action
end
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Issue being fixed or feature implemented
Hosts need to prevent a bottom sheet from being dismissed while a protected operation such
as signing, proving, or broadcasting is in progress. A host-level
interactiveDismissDisabledworkaround blocks the swipe but leaves DashUIKit's built-inclose button active.
What was done?
isDismissalEnabledbinding that controls interactive dismissal and theclose button together
showsCloseButtonand an optional host-ownedonClosecallbackHow Has This Been Tested?
swift test— 7 tests passed, including all three dismissal-action pathsxcodebuild -scheme DashUIKit -destination 'generic/platform=iOS Simulator' IPHONEOS_DEPLOYMENT_TARGET=14.0 build— succeededFull-resolution evidence, fixture source, hashes, and provenance:
https://github.com/PastaPastaPasta/DashUIKit/tree/fc8028432985edac0c479aff40fa7b9ab11ebed9
Before is exact base
1682524595da5922e1d10a78ffcf889fe0963d45; after is full PR heade8d92434bfc28fbf933b896cd40a01dd61835b5f.Default compatibility
Protected state
Protected close-button behavior
The same close-button coordinate was tapped on both exact-revision builds. On the base, the enabled close control dismissed the sheet. On the head, the disabled close control ignored the tap and the sheet remained presented. This is covered by direct runtime verification and focused action-routing tests; the post-dismissal frame from the synthetic host is intentionally not used as visual evidence.
Head-only API states: custom close callback · hidden close control
Breaking Changes
None. All new parameters have source-compatible defaults.
Checklist:
This pull request was created by Codex.
Summary by CodeRabbit
New Features
Documentation
Tests