Skip to content

Harden Slatepack UI and lifecycle handling - #1521

Merged
sneurlax merged 15 commits into
feat/slatepack-interfacefrom
fix/slatepack-ui-hardening
Nov 17, 2026
Merged

sneurlax merged 15 commits into
feat/slatepack-interfacefrom
fix/slatepack-ui-hardening

Conversation

@sneurlax

Copy link
Copy Markdown
Member

Summary

  • validate created Slatepack amount and warn on fee differences
  • keep local notes and normalize imported armor once
  • prevent duplicate imports and ignore unsafe post-close input results
  • show receive results/errors through the root navigator after the initiating screen closes
  • close only owned dialogs/routes and remove loading overlays reliably
  • improve QR sizing, share-sheet anchoring, help-text contrast, and cancel visibility
  • require confirmation before cancelling a pending Slatepack transaction

This is intentionally stacked on #1507 so its lifecycle and UX fixes remain independently reviewable.

Verification

  • focused Slatepack tests: 45 passed
  • full serialized suite: 1,226 passed, 8 skipped, 0 failed
  • Linux release build: passed
  • combined suite with every extracted split: 136 passed
  • combined Linux release build with every extracted split: passed

desktopTextExtraSmall uses the disabled button text color, which is
nearly white on the desktop card, so the explanation above the input was
almost invisible. Use the subtitle color like the other slatepack hints.
Creating a slatepack did not compare the result with what the user had
just confirmed, reported failures as "Broadcast transaction failed"
although nothing is broadcast, and dropped the result without a trace
when the confirmation view had closed in the meantime.

A slatepack created for another amount is now cancelled and refused
with an error naming both amounts. A different fee is logged and shown
as a warning only, because the confirmed fee is an estimate and the
wallet may select other inputs when it builds the slate. Failures are
titled "Could not create the slate" or "slatepack". The sending dialog
is closed through a navigator looked up before the send, so it no
longer stays up when the view is gone, and that case is logged.
An imported response slatepack was offered for finalizing even when the
wallet had no transaction for it, with only a note in the summary, and
a transaction the wallet had received counted as a match.

The lookup now reports the direction of the local transaction, prefers
the send when a wallet holds both sides of a slate, and refreshes the
stored history once before giving up, since a send made moments ago may
not be in it yet. Without a send of its own the import flow explains
that only the wallet that started the transaction can finalize it and
no longer shows the Finalize button.
The slatepack dialog refused to draw a QR code for anything over 1000
characters. Epic Cash slates and MWC slatepacks can be longer than that
and were drawn at any length before the shared dialog replaced the
per-coin ones, so the longer ones lost their QR code.

The limit is now what a QR code can hold at the error correction level
the widget draws at, 2953 bytes, counted in bytes instead of
characters. Longer data still gets the note to copy, share or save it.
The import flow passed whatever was pasted, scanned or opened straight
to the wallet, so a slatepack with a greeting, a quote marker or other
text around it was rejected.

The flow now trims the text and, when it holds an armored slatepack,
keeps only the part from the begin marker to the end marker. Both the
BEGINSLATEPACK and BEGINSLATE_BIN frames are recognised, with or
without the final period. JSON slates and anything without a frame are
only trimmed. Inspecting, receiving and finalizing all use that text.
On the slatepack screen a second press of Continue could start the
import again while the first was still under way. On a phone the screen
closes the keyboard and waits briefly before it starts, which leaves
room for that, and the slatepack would then be processed twice.

The screen now tracks a running import, ignores further presses and
disables the button until the import has returned.
Receiving a slatepack takes a while. If the screen that started the
import was gone by the time the wallet had signed it, the response was
dropped without a word, even though the wallet had already recorded
the transaction and the sender still needs that response.

The import flow now keeps hold of the root navigator before it starts
and shows the response from there when its own screen has closed. It
logs the slate id in that case, and also when a finalize completes
after the screen closed. The response text itself is not logged.
The slatepack dialog shared its text without a position for the share
sheet. An iPad needs one to place the popover and refuses to open the
sheet without it, so Share did nothing there apart from logging an
error.

The dialog now passes the Share button's rect on screen. Other devices
ignore it.
The sending dialog was closed by popping the root navigator. If another
route had opened above the dialog by the time the send returned, that
route was popped and the dialog stayed up.

The dialog's route is now kept and removed directly, so nothing else is
closed. A failed HTTP address also closes the dialog when the view is
already gone.
The import flow showed its loading overlay through showLoading, which
only removes the overlay while the calling screen is still mounted. If
that screen closed while the wallet was working, the overlay stayed
over the whole app, under the response that is now shown in that case.

The flow keeps its own overlay route on the root navigator and removes
it when the wallet answers. An error is shown from the root navigator
too when the screen is gone.
@sneurlax
sneurlax marked this pull request as draft November 13, 2026 22:50
@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.54321% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.84%. Comparing base (87026cf) to head (d517fc3).

Files with missing lines Patch % Lines
...llets/wallet/intermediate/mimblewimble_wallet.dart 21.05% 15 Missing ⚠️
...ction_views/tx_v2/transaction_v2_details_view.dart 0.00% 9 Missing ⚠️
lib/pages/slatepack/slatepack_import_flow.dart 87.50% 7 Missing ⚠️
lib/pages/slatepack/slatepack_view.dart 70.00% 6 Missing ⚠️
lib/pages/send_view/confirm_transaction_view.dart 97.72% 1 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feat/slatepack-interface    #1521      +/-   ##
============================================================
+ Coverage                     16.34%   16.84%   +0.50%     
============================================================
  Files                          1147     1147              
  Lines                        113495   113585      +90     
============================================================
+ Hits                          18546    19131     +585     
+ Misses                        94949    94454     -495     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sneurlax
sneurlax merged commit 0eac970 into feat/slatepack-interface Nov 17, 2026
5 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.

1 participant