Skip to content

Fix accidental closing of add/edit wine bottom sheet (fixes #10) - #27

Merged
T0liver merged 1 commit into
mainfrom
c-fix-bottom-sheet-dismiss-3809
Nov 21, 2026
Merged

T0liver merged 1 commit into
mainfrom
c-fix-bottom-sheet-dismiss-3809

Conversation

@T0liver

@T0liver T0liver commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Fixes #10

Cause

WineFormSheet used skipPartiallyExpanded = false without guarding sheet hide. Light drags and scrim taps called onDismissRequest, which unmounted the sheet and incremented wineFormSessionId on the next open—wiping rememberSaveable form state.

Fix

  • Detect unsaved input (SheetFormDirty.kt) and reject SheetValue.Hidden in confirmValueChange unless dismissal is intentional.
  • Set skipPartiallyExpanded = true to avoid the large half-expanded scrim tap target.
  • Show a discard-changes dialog for close button / scrim tap when dirty.
  • Apply the same pattern to WineFilterSheet.
  • Add SheetFormDirtyTest unit tests.

Build

./gradlew assembleDebug testDebugUnitTest — SUCCESS

Open in Web Open in Cursor 

Block hide transitions when forms are dirty via confirmValueChange,
use skipPartiallyExpanded to avoid half-expanded scrim taps, and prompt
to discard on explicit close or scrim tap. Add unit tests for dirty detection.

Co-authored-by: T0liver <T0liver@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Test Results

6 tests  +5   6 ✅ +5   0s ⏱️ ±0s
2 suites +1   0 💤 ±0 
2 files   +1   0 ❌ ±0 

Results for commit 8e7be73. ± Comparison against base commit c865cc7.

@T0liver
T0liver merged commit 70a14c0 into main Nov 21, 2026
4 checks passed
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.

Accidentally closing menus

2 participants