Skip to content

fix: add setting to disable all toasts - #1371

Open
ovitrif wants to merge 3 commits into
masterfrom
fix/disable-all-toasts
Open

ovitrif wants to merge 3 commits into
masterfrom
fix/disable-all-toasts

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1369
Twin: synonymdev/bitkit-ios#829

This PR adds a Dev Settings toggle that hides all toasts, for testing and demo recordings.

Description

  • Adds a "Disable All Toasts" toggle to Dev Settings so testers can record demos and run manual tests without toasts covering the screen.
  • Hides every toast, including error toasts, only while dev mode and the toggle are both on, so turning dev mode off brings toasts back without touching the toggle.
  • Raises the Support dev-mode toast only after the dev mode setting is saved, so it stays hidden when dev mode is turned on with the toggle on.

Out of Scope

  • Settings: no toggle outside Dev Settings; release builds reach it by enabling dev mode from Support.

Design

N/A — no design available.

Preview

QA Notes

Journeys

  • temporary disable-all-toasts.xml — toasts stay hidden while dev mode and the toggle are on, and return once dev mode is off

    disable-all-toasts.xml
    <journey name="disable all toasts">
      <description>Precondition: onboarded dev build with dev mode on (the default for debug builds) and "Disable All Toasts" off. Proves the Dev Settings toggle hides every toast while dev mode is on, and that turning dev mode off brings toasts back.</description>
      <actions>
        <action>Open Settings, then the Advanced tab, then Dev Settings (tag "DevSettings")</action>
        <action>Turn on "Disable All Toasts" (tag "DisableAllToastsToggle")</action>
        <action>Go back to the Advanced tab and open the Rapid-Gossip-Sync server settings (tag "RGSServer"), replace the server URL (tag "RGSUrl") with https://rapidsync.lightningdevkit.org/snapshot, and tap "Connect" (tag "ConnectToHost")</action>
        <action>Wait until the connected URL (tag "ConnectedUrl") shows https://rapidsync.lightningdevkit.org/snapshot, so the change ran</action>
        <action>Verify the RGS toast (tag "RgsUpdatedToast") is not visible</action>
        <action>Tap "Reset To Default", then "Connect" (tag "ConnectToHost"), and wait until the connected URL shows the default server again</action>
        <action>Open Settings, then Support, and tap the app version 5 times to turn dev mode off</action>
        <action>Verify the dev mode toast (tag "DevModeDisabledToast") is visible</action>
        <action>Tap the app version 5 times again to turn dev mode on</action>
        <action>Verify the dev mode toast (tag "DevModeEnabledToast") is not visible</action>
        <action>Open Settings, then the Advanced tab, then Dev Settings (tag "DevSettings"), and turn off "Disable All Toasts" (tag "DisableAllToastsToggle")</action>
      </actions>
    </journey>

Manual Tests

N/A

Automated Checks

  • updated AppViewModelSendFlowTest.kt — the current toast is hidden only while dev mode and the toggle are both on
  • updated SettingsViewModelTest.kt — setting dev mode completes only after the settings write finishes

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk]

The PR should not merge until the dev-mode transition toast cannot appear while toast suppression is enabled.

Findings

  1. P1 Dev mode toast briefly appears ▶

Summary

Adds a persisted Dev Settings toggle and masks the app’s displayed toast whenever both the toggle and dev mode are enabled. It also adds a unit test for the two-setting condition. The Support-screen dev-mode transition can briefly display a toast before its asynchronous settings update reaches the mask.

Diagram

sequenceDiagram
    participant Support as Support screen
    participant Settings as SettingsStore
    participant Queue as Toast queue
    participant Display as Toast display
    Support->>Settings: Request dev-mode update
    Support->>Queue: Enqueue transition toast
    Queue->>Display: Emit toast using previous setting
    Settings-->>Display: Emit updated dev-mode setting
    Display->>Display: Hide toast
Loading

Reviews (1) · Last reviewed commit: "fix: add setting to disable all toasts"

Comment thread app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 4a940cd (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@jvsena42 jvsena42 left a comment

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.

No findings beyond the open greptile thread on the dev-mode toast flash.

Checked and clean:

  • The toggle only appears in Dev Settings, and the mask is isDevModeEnabled && disableAllToasts, so it is off in release until dev mode is enabled, and turning dev mode off restores toasts.
  • It defaults to off and persists via SettingsStore.update.
  • ToastOverlay in MainActivity is the single chokepoint and reads the masked currentToast, so every ToastEventBus/app.toast path is covered.
  • The queue keeps running while hidden, and the only autoHide = false toasts are always replaced, so nothing stale reappears.
  • AppViewModelSendFlowTest asserts on, dev-off and toggle-off against the real flow.

Parity with synonymdev/bitkit-ios#829: same semantics and tag. iOS filters when a toast is requested, Android masks at display time.

@jvsena42 jvsena42 left a comment

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.

Re-checked eb8df0e. No findings. The dev-mode write now completes before the toast is enqueued, so the greptile flash thread is addressed. Support is the setter's only caller, and nothing blocks the main thread.

This branch has not been deployed

No deployments
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.

fix: add setting to disable all toasts

2 participants