Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jan 13, 2026

Currently, the user interface (noui, gui) has a caption for each message. However, the caption has many issues:

  • It is always hard-coded to the empty string.
  • This is confusing and tedious when reading or maintaining the code.
  • It is redundant, because noui will ignore the caption and set the logging prefix (error, warning, info) based on the style.
  • The gui does prefer to set the title based on the caption, but since it the caption is always empty, the fallback will always be used.

Fix all issues by removing it.

MarcoFalke added 2 commits January 13, 2026 16:21
This is redundant and inconsistent, because call-sites are expected to
add the semicolon, which they all do.
This refactor makes the code easier to read and maintain.
@DrahtBot DrahtBot changed the title Remove empty caption from ThreadSafeMessageBox Remove empty caption from ThreadSafeMessageBox Jan 13, 2026
@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 13, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34276.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK hebasto

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #34132 (refactor: inline CCoinsViewErrorCatcher into CCoinsViewDB by l0rinc)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko maflcko changed the title Remove empty caption from ThreadSafeMessageBox Remove empty caption from user interface (noui, gui) Jan 13, 2026
@hebasto
Copy link
Member

hebasto commented Jan 13, 2026

Does this PR introduce any visual changes in the GUI?

@maflcko
Copy link
Member Author

maflcko commented Jan 13, 2026

Does this PR introduce any visual changes in the GUI?

No, see the pull request description.

MarcoFalke added 4 commits January 14, 2026 19:36
There is only one call-site, which provided an empty caption.

Note that noui_ThreadSafeQuestionRedirect is test-only and currently
entrirely unused, so the logging format string change is not a behavior
change.

This refactor does not change any behavior.
The caption was empty for all call-sites, so this refactor does not
change any behavior.

Note that noui_ThreadSafeMessageBoxRedirect is test-only, so no end-user
behavior is changed here.
The only behavior change is in noui_ThreadSafeQuestion, which can not
detect a style and will log a strCaption=": ".

Fix this by removing it.
@maflcko maflcko force-pushed the 2601-less-gui-kernel branch from fa9b792 to fad7bd9 Compare January 14, 2026 18:39
@maflcko
Copy link
Member Author

maflcko commented Jan 14, 2026

To clarify that everything is a refactor, except for the one-line bugfix, I've extracted it as the last commit.

You can also use this to check that the GUI pop-up looks identical before and after: ./bld-cmake/bin/bitcoin-qt -regtest -datadir=/tmp -printtoconsole=0 -mocktime=123456789 (start twice)

@hebasto
Copy link
Member

hebasto commented Jan 16, 2026

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK fad7bd9, I have reviewed the code and it looks OK. Tested on Ubuntu 25.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants