Skip to content

GUI: Show warnings on all tabs - #301

Open
kwsantiago wants to merge 2 commits into
bitcoinknots:29.x-knotsfrom
privkeyio:fix-warnings-no-wallet-tabs
Open

GUI: Show warnings on all tabs#301
kwsantiago wants to merge 2 commits into
bitcoinknots:29.x-knotsfrom
privkeyio:fix-warnings-no-wallet-tabs

Conversation

@kwsantiago

@kwsantiago kwsantiago commented Apr 25, 2026

Copy link
Copy Markdown

Fixes #300.

The status-bar warning from ClientModel::getStatusBarWarnings() (e.g. unknown soft-fork activation, "large-work invalid chain", clock-skew warnings, pre-release build notices) was only ever rendered on the Overview tab. Its alert label lived inside OverviewPage, so every other tab showed nothing. Because the Send/Receive/Transactions/Pairing pages each live in their own widget in the stack, switching to any of them hid the warning.

This moves the warning label out of OverviewPage and up into WalletFrame, as a sibling of m_global_stack rather than a child of any single page. The WalletFrame layout changes from an QHBoxLayout to a QVBoxLayout so the label sits above the stack and stays visible on every tab. OverviewPage::labelAlerts and its updateAlerts slot are removed so there is a single source for the warning instead of a per-page duplicate.

Result: the warning shows on all five tabs when a wallet is loaded (Overview/Send/Receive/Transactions/Pairing) and on both no-wallet tabs (Overview/Pairing). The RPCConsole path used under -disablewallet is untouched.

How to reproduce

getStatusBarWarnings() only returns a non-empty string when the node actually raises a warning (unknown version-bit activation, invalid-chain detection, system-clock skew, etc.), which is awkward to trigger on demand. The simplest way to see the bug is to inject a fixed warning, build, and click through the tabs.

  1. Hardcode a warning in src/qt/clientmodel.cpp:
    QString ClientModel::getStatusBarWarnings() const
    {
        return "TEST WARNING";
        // return QString::fromStdString(m_node.getWarnings().translated);
    }
  2. Build the GUI and start on regtest with no wallet:
    ./src/qt/bitcoin-qt -regtest -noconnect
    
  3. Click through the tabs.

Before this PR: the yellow warning bar appears only on the Overview tab. Switching to Pairing (or, with a wallet loaded, to Send/Receive/Transactions) hides it.

With this PR: the warning bar stays visible on every accessible tab. With no wallet that is Overview and Pairing (Send/Receive/Transactions are greyed out); with a wallet loaded it is all five tabs.

Remember to revert the hardcoded warning before testing anything else.

@kwsantiago
kwsantiago force-pushed the fix-warnings-no-wallet-tabs branch from 9fff8ee to a79fdc3 Compare April 25, 2026 15:02
@chrisguida

Copy link
Copy Markdown

After looking into this briefly, I'm still confused as to the bug here... is the problem that the Pairing tab doesn't display warnings? Because that's the only non-wallet tab besides Overview, and Overview already displays warnings properly?

@kwsantiago

Copy link
Copy Markdown
Author

@chrisguida Overview already shows it (fixed in 81d5172 last July); the actual gap is the Pairing tab, which lives in a parallel stack and so the existing alert label gets hidden when you switch to it. This PR fixes that.

@chrisguida

Copy link
Copy Markdown

@luke-jr says the bug is already fixed, do we still need this PR?

@kwsantiago

kwsantiago commented May 1, 2026

Copy link
Copy Markdown
Author

@chrisguida , @luke-jr fixed the Overview tab bug, this PR fixes the Pairing tab bug, per my comment above.

@luke-jr

luke-jr commented May 3, 2026

Copy link
Copy Markdown
Collaborator

The Send/Receive/Transactions tabs also don't show the warning. I don't think it would be consistent to put it on Pairing without putting it everywhere...?

@kwsantiago
kwsantiago force-pushed the fix-warnings-no-wallet-tabs branch from a79fdc3 to a7685c4 Compare May 4, 2026 23:38
@kwsantiago

Copy link
Copy Markdown
Author

@luke-jr Good point. Updated to drop OverviewPage::labelAlerts so WalletFrame's alert label is the single source above every tab (Overview/Send/Receive/Transactions/Pairing).

@chrisguida

Copy link
Copy Markdown

I've tested the new version of this PR with a hardcoded warning in ClientModel::getStatusBarWarnings(), confirmed that the warning is now displayed prominently on all 5 tabs when a wallet is loaded, and on the 2 non-wallet tabs (Overview and Pairing) when no wallet is loaded (the other 3 wallet tabs are inaccessible when no wallet is loaded). Also confirmed that prior to this change, only the Overview tab displays warnings (implemented in 81d5172), in both wallet mode and no-wallet mode.

Technically this PR is larger in scope than the original issue, which only mentions no-wallet tabs, but there are only 2 no-wallet tabs: Overview and Pairing, and Overview was already working properly. The first version of this PR fixed the Pairing tab, which was the exact scope originally outlined in #300 (and still referred to in this PR's title), but fixing warnings on all 5 tabs (regardless of whether a wallet is loaded) strikes me as the correct solution, and this new version is much cleaner than the old version anyway.

Other than the PR's title and top comment needing an update for this new version:

ACK a7685c4

@pdath

pdath commented Jun 24, 2026

Copy link
Copy Markdown

I don't clearly understand the problem here and, consequently, how to test it. I don't have Tor enabled. Is that critical to this bug?

What I can offer is that when I run the PR301 code on regtest on Windows, with no wallet, this is what I see:
image

The send/review/transaction tabs are greyed out. This is my peering tab.
image

@chrisguida

chrisguida commented Jun 26, 2026

Copy link
Copy Markdown

@pdath I tested it by hardcoding a warning in the UI like so:

QString ClientModel::getStatusBarWarnings() const
{  
    return QStringLiteral("TEST WARNING: should be visible on ALL tabs");
    return QString::fromStdString(m_node.getWarnings().translated);
}

I think I explained what's going on pretty well in my comment.

@pdath

pdath commented Jun 26, 2026

Copy link
Copy Markdown

@pdath I tested it by hardcoding a warning in the UI like so:

QString ClientModel::getStatusBarWarnings() const
{  
    return QStringLiteral("TEST WARNING: should be visible on ALL tabs");
    return QString::fromStdString(m_node.getWarnings().translated);
}

I think I explained what's going on pretty well in my comment.

This is not working for me on Windows.
Which platform did you test on?

@chrisguida

chrisguida commented Jun 26, 2026

Copy link
Copy Markdown

@pdath Linux x86, this is what it looks like for me:

image

When you say "not working", do you mean not building? Or you're just not seeing the warning banner?

@pdath

pdath commented Jun 26, 2026

Copy link
Copy Markdown

@pdath Linux x86, this is what it looks like for me:

image When you say "not working", do you mean not building? Or you're just not seeing the warning banner?

The warning bar in your screenshot - I don't get that on Windows. Everything is building as expected. No errors.

image

@pdath

pdath commented Jun 27, 2026

Copy link
Copy Markdown

I know what I am doing wrong now.
When using guix, I found that the script "make_release_tarball.sh" runs "git archive-- prefix="${DISTNAME}/" HEAD", which means it uses whatever is in the most recent commit - ignoring any changes you have made locally (such as to display an error).

So I have done a dummy commit locally, and it now works!!!

image image

I tested the code using this approach.
git remote add upstream https://github.com/bitcoinknots/bitcoin.git
git fetch upstream pull/301/head:pr301
git switch pr301

I built the code using these commands:
sudo apt install -y guix
env HOSTS='x86_64-w64-mingw32' ./contrib/guix/guix-build

I tested on Windows 11 using the "How to reproduce" documentation.
I have not reviewed the source node. I don't know anything about QT.

I did an AI code review. I think the summary comment is the only one worth mentioning.
"This is a small, focused, and correct refactoring."

I used a default configuration, and started the test with:
bitcoin-qt.exe -regtest -noconnect

On the basis of the test results only (no human code review), tACK a7685c4.

Comment thread src/qt/walletframe.cpp
@luke-jr

luke-jr commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

How about adding 1ex of padding to m_label_alerts since we're losing its margin?

@luke-jr luke-jr added this to the 29.4 milestone Jul 25, 2026
@kwsantiago
kwsantiago requested a review from luke-jr July 25, 2026 20:25
luke-jr pushed a commit that referenced this pull request Jul 27, 2026
Github-Pull: #301
Rebased-From: a7685c4
luke-jr pushed a commit that referenced this pull request Jul 27, 2026
@luke-jr luke-jr changed the title GUI: Show warnings on all no-wallet tabs GUI: Show warnings on all tabs Jul 27, 2026
kwsantiago pushed a commit to privkeyio/bitcoin that referenced this pull request Jul 30, 2026
….makePool` method

6b0a907 Squashed 'src/ipc/libmultiprocess/' changes from 3edbe8f67c1..16bf05dea02 (Ryan Ofsky)

Pull request description:

  The changes can be verified by running `test/lint/git-subtree-check.sh src/ipc/libmultiprocess` as described in [developer notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#subtrees) and [lint instructions](https://github.com/bitcoin/bitcoin/tree/master/test/lint#git-subtree-checksh).

  Changes since last subtree update (bitcoin#34977):

  - Adds `makePool` method on `ThreadMap` to support thread pool routing, allowing requests without a specific client thread to be dispatched to a pool using a shortest-queue strategy ([bitcoinknots#283](bitcoin-core/libmultiprocess#283)).
  - Adds `std::unordered_set` support, a `BuildList` helper, and a `ReadList` helper to reduce duplication in list build and read handlers ([bitcoinknots#277](bitcoin-core/libmultiprocess#277), [bitcoinknots#285](bitcoin-core/libmultiprocess#285)).
  - Adds support for translating C++ `std::optional<T>` struct fields to pairs of `T` + `hasT :Bool` Cap'n Proto struct fields, allowing unset optional primitive fields to be represented ([bitcoinknots#243](bitcoin-core/libmultiprocess#243)).
  - Produces more readable log output for Proxy object lifecycle events and IPC server-side failures ([bitcoinknots#218](bitcoin-core/libmultiprocess#218)).
  - Handles exceptions thrown by `destroy` methods by logging instead of aborting ([bitcoinknots#273](bitcoin-core/libmultiprocess#273)). This can prevent server crashes when non-libmultiprocess clients disconnect without destroying objects, in the case where a server object owns client objects and the server destructor tries to call the disconnected client to free them ([bitcoinknots#219](bitcoin-core/libmultiprocess#219)).
  - Handles unexpected exceptions thrown by callbacks (that should never happen) by logging errors instead of deadlocking ([bitcoinknots#260](bitcoin-core/libmultiprocess#260)).
  - Fixes a rare mptest hang on musl builds caused by a lost wakeup bug in `Waiter` ([bitcoinknots#295](bitcoin-core/libmultiprocess#295)).
  - Fixes a race condition in a log print detected by TSan ([bitcoinknots#286](bitcoin-core/libmultiprocess#286)).
  - Build improvements: makes `target_capnp_sources` work correctly when libmultiprocess is used as a CMake subproject ([bitcoinknots#289](bitcoin-core/libmultiprocess#289)), adds `mp_headers` target for better lint tool support ([bitcoinknots#291](bitcoin-core/libmultiprocess#291)), and fixes compatibility with recent Nix and CMake 4.0 ([bitcoinknots#238](bitcoin-core/libmultiprocess#238)).
  - Test, CI, documentation, and minor code improvements: design document corrections ([bitcoinknots#278](bitcoin-core/libmultiprocess#278)), field constant comments ([bitcoinknots#279](bitcoin-core/libmultiprocess#279)), clang-tidy fix ([bitcoinknots#292](bitcoin-core/libmultiprocess#292)), new smoke test for double-precision float values ([bitcoinknots#294](bitcoin-core/libmultiprocess#294)), new test for recursive async IPC calls ([bitcoinknots#301](bitcoin-core/libmultiprocess#301)), removal of libevent from Core CI builds ([bitcoinknots#299](bitcoin-core/libmultiprocess#299)), and rename of `EventLoop::m_num_clients` to `m_num_refs` ([bitcoinknots#302](bitcoin-core/libmultiprocess#302)).

ACKs for top commit:
  fanquake:
    ACK 02afa66
  hebasto:
    ACK 02afa66.

Tree-SHA512: ef81a951c971f328a0a98436030467eeea30925eb6016eafd9bc7a25726c87628a852bbb1d84b88bce340aeea2bed25c65bc55db1168ebcb850628cd18808883
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.

GUI: Warnings not shown in no-wallet UI

5 participants