Skip to content

fix: show passphrase toast on sheet - #1165

Open
piotr-iohk wants to merge 4 commits into
masterfrom
fix/hw-passphrase-toast
Open

fix: show passphrase toast on sheet#1165
piotr-iohk wants to merge 4 commits into
masterfrom
fix/hw-passphrase-toast

Conversation

@piotr-iohk

@piotr-iohk piotr-iohk commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1161

This PR shows the wrong-passphrase error toast on top of the hardware transfer passphrase sheet.

Description

Entering the wrong passphrase on Transfer to Spending already refused the sign and sent the error toast, but the toast sat behind the modal sheet. It was only visible after Cancel. The toast now renders inside the sheet, with the same frosted style as elsewhere.

Preview

Screen_Recording_20260818_122141_Bitkit.Regtest.mp4

QA Notes

Manual Tests

  • 1. Force-quit after pairing a hidden hardware wallet → Transfer → Spending → Open Trezor Connect → enter a wrong passphrase → Continue: error toast is visible on the passphrase sheet (not only after Cancel).
  • 2. Same sheet → Cancel: toast is gone or already dismissed; no extra wallet tile; nothing signed.
  • 3. regression: same flow with the correct passphrase → Continue: sheet closes and signing proceeds as before.

Automated Checks

  • Existing mismatch coverage in TransferViewModelTest.kt is unchanged (toast is still sent; this PR only changes where it is drawn).
  • Local compileDevDebugKotlin passed.
  • CI: standard compile, unit test, and detekt checks run by the PR bot.

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown

Greptile Summary

The PR renders the existing app-wide toast inside the hardware-wallet passphrase modal so wrong-passphrase errors remain visible above the sheet.

  • Adds a sheet-local toast host connected to AppViewModel.currentToast.
  • Applies the existing frosted haze treatment behind the toast.
  • Adds a changelog entry for the visibility fix.

Confidence Score: 5/5

The PR appears safe to merge with no actionable regressions identified.

The sheet-local host observes the existing toast state and forwards the established dismissal and gesture callbacks while placing the toast above the modal that previously obscured it.

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/ui/screens/transfer/hardware/HwPassphrasePromptSheet.kt Adds an in-sheet host for the shared toast state, preserving existing dismissal, pause, resume, and haze behavior without an established defect.
changelog.d/next/1161.fixed.md Accurately documents that wrong-passphrase errors are now visible over the hardware transfer passphrase sheet.

Reviews (1): Last reviewed commit: "fix: harden passphrase sheet toast host" | Re-trigger Greptile

@piotr-iohk
piotr-iohk requested a review from jvsena42 August 18, 2026 10:38
}
}

@Composable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This fixes the bug for this sheet but it still exists in the others. Could hoist the host into components/BottomSheet.kt

private fun OverlayHandleSheetContent(

onCancel = { closeSheet() },
modifier = Modifier.sheetHeight(SheetSize.LARGE, isModal = true)
)
Box(modifier = Modifier.fillMaxSize()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This makes toast host stretches the sheet to full window height. https://github.com/synonymdev/bitkit-android/pull/1165/changes#r3806178742 would fix this

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.

[Bug]: wrong hardware passphrase toast is hidden behind the transfer passphrase sheet

2 participants