mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
qml: clarify onboarding storage options for existing datadir #1050
No reviewers
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!1050
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/onboarding-keep-current"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mark the profile's configured storage mode with a Your current setting badge. Keeping it preserves the exact prune target. If no prune setting is present, use full storage.
Describe reduced storage as “Uses about %1GB with older data pruned, suitable for regular wallet use.”
For
prune=1, show Manual pruning with “Prune older blocks manually to control storage use.” and no automatic storage estimate.Show a redownload warning when switching from pruned storage to full storage. Keep Custom available when selecting another option and include chainstate in its total size. Keep option cards at their original padding, typography and text alignment while allowing descriptions to wrap, including cards with no badge or warning.
Stop onboarding choices from flashing on click and rename the network step to Connect to the network.
Hide Developer options in the onboarding About dialog, link License to Bitcoin Core's license file, and show Version as a read-only value.
Parse localized storage, mempool, cache and thread input before saving. Reject invalid values without changing the setting, including malformed grouping that Qt would otherwise rewrite. Use the same database cache limit as Core's Qt GUI.
Screenshots from the app at 800 × 665:
Custom storage locations are now retained when selecting Default and restored when selecting Custom. A separate Choose location… action opens the folder picker; canceling preserves the selection. Popup pruning edits select Custom until the exact saved setting is restored. The redownload warning is conditional, and the unused Header animation option is removed.
Returning to the exact saved MiB target restores the current-setting card, including native mouse/keyboard activation. Rounded GB values do not count as the same target, and manual pruning stays distinct from full storage. Invalid database-cache input shows minimum-only guidance while retaining Core/integer validation.
Validation at
ed40a35c6940: native application build, all 63 affected onboarding QML cases, and the complete 12-flow real-GUI pre-init suite pass, including the formerly failing native Custom click. Startup, all shutdown cases and blocked startup also pass. The eight native CTest groups passed before the last QML-only binding change (920 C++ passes, 10 existing skips; full QML 772; integration 20); affected QML was rebuilt and retested on the final head. Production C++ is unchanged by the final binding/test follow-ups.Strict LLVM 22 ASan/LSan/UBSan/integer C++ validation passes all 180 OptionsModel and 12 storage cases with no extra exceptions. Actual instrumented QML passes all 63 onboarding cases and 62 unchanged integer-input cases, with leak detection enabled and only the independently reproduced Qt hash exception. Old-production and native-keyboard controls fail before the fixes. Matching LLVM 22/Bitcoin-plugin checks, pinned Ruff and supplemental lint pass on the changed scope.
The standalone checkout lacks the requested top-level CI drivers. Configured rootless Docker is available; pinned Core-only fallback runs are incomplete and do not validate parent GUI-QML. The IPC-enabled standalone GUI uses a local node factory; actual Core multiprocess IPC lifecycle remains uncovered and
interface_gui.pyis absent. Earlier CI run.Fixes #1053
Fixes #1014
Fixes #942
Fixes #941
Fixes #1002
Review fixes and validation
Review fixes at
f68f5bf24c: restore remembered Custom directories after selecting Default, reset edited settings when switching profiles so proxy choices cannot carry over, explain manual-pruning switch behavior, and show an advisory when free space is insufficient for a full download. Validation: 63 onboarding QML, 17 asynchronous onboarding, 181 settings-model, and 12 storage tests pass. The original prune-only reset fails the new cross-directory settings regression. The broader QML suite has 815 passes and four payment-request amount-validation failures also reproduced on an unchanged baseline; no payment code was changed.Will review soon.
Unrelated to this PR - wonder how there's a floating "Done" button in Settings sidebar. Is this with wallet disabled?
Ran in to an issue related to "Storage location" step while testing this - https://github.com/bitcoin-core/gui-qml/issues/1053 . Would be nice if you can address #1053 as part of this since this is related. Totally okay if you want to do it as a follow-up.
Ill give it a try. I think this likely fits within the scope
🟠 Minor · Restoring the exact prune target leaves the current-setting card unchecked
On an existing prune=1907 profile, popup edits from 2 to 3 to 2 GB restore the exact target but leave Custom selected instead of the card marked “Your current setting.”
Location:
qml/components/StorageOptions.qml:71(head).🔵 Suggestion · Database-cache errors present the integer type limit as guidance
Rejected editable database-cache input displays 2147483647 MiB as its upper bound, where a lower-bound-only message would provide clearer correction guidance.
Location:
qml/models/options_model.cpp:317(head).Review coverage was incomplete.
Reviewed:
73ca0bc518ee· Full review report · Previous reportspermalink
Earlier concerns neither republished nor resolved: 1 minor finding. See the Run archive linked from the Review report for their assessments.
🔴 Major · Reselecting Custom discards the configuration-selected datadir source
During onboarding, reselecting a directory supplied by
datadir=in the defaultbitcoin.conf, without command-line-datadiror-conf, skips that configuration and persists the change, potentially removing configured proxy restrictions on this and later launches.Location: qml/components/StorageLocations.qml:82 (head).
🟠 Minor · Low-space exception permits a prune target above the saved target
On a low-space profile with
prune=4096, editing the popup target from 5 GB to 4 and back to 5 permits 4768 MiB, exceeding the saved target rather than only keeping or lowering it.Location: qml/models/onboardingoptionsmodel.cpp:221 (head).
🔵 Suggestion · Changing directory silently drops earlier network privacy choices
Changing the storage directory intentionally reloads the new profile's network settings, but onboarding gives no notice when this discards a proxy or Tor choice made earlier in the session.
Location: qml/models/onboardingoptionsmodel.cpp:194 (head).
🔵 Suggestion · Manual-pruning help replaces the disabled switch's lock explanation
With command-line
-prune=1on an existing profile, the disabled Store recent blocks only switch tells the user to turn it on instead of explaining its command-line lock.Location: qml/pages/settings/StorageSettingsPage.qml:42 (head).
🔵 Suggestion · The sizing-test commit claims a production change and depends on an unrelated test hook
a5931d7describes a layout-sizing change but only adds a test, whoseoptionButtonHeaderlookup depends on a hook placed in the earlier highlight-animation commit.Location: qml/controls/OptionButton.qml:81 at ec48c8a887d2 (commit) (commit).
🔵 Suggestion · Storage-card corrections are interleaved with unrelated changes
The storage-card workflow introduced in
ab4dbbdis corrected across several later commits, requiring reviewers to reconstruct selection bindings and warning behavior through intermediate implementations.Location: qml/components/StorageOptions.qml:91 at 7de892dc8022 (commit) (commit).
Review coverage was incomplete.
Reviewed:
63a406f17251· Review reportFixed #1053 in
cdf76d82a: Custom retains the last location, including -datadir; Choose location… changes it explicitly and canceling preserves the selection. The screenshots use -disablewallet; Done is the existing Settings navigation button.The follow-up findings are fixed in
f77b90d5anded40a35c. Exact saved targets restore the current-setting card (1907 MiB through 2 → 3 → 2 GB), with rounded and manual-pruning values kept distinct. Direct model notifications restore the card after native button clicks and Space activation, including an unchanged exact target. Custom state is retained. Database-cache errors now show only the minimum while preserving validation.Validation at
ed40a35c6940: native application build, all 63 affected onboarding QML cases, and the complete 12-flow real-GUI pre-init suite pass, including the formerly failing native Custom click. Startup, all shutdown cases and blocked startup also pass. The eight native CTest groups passed before the last QML-only binding change (920 C++ passes, 10 existing skips; full QML 772; integration 20); affected QML was rebuilt and retested on the final head. Production C++ is unchanged by the final binding/test follow-ups.Strict LLVM 22 ASan/LSan/UBSan/integer C++ validation passes all 180 OptionsModel and 12 storage cases with no extra exceptions. Actual instrumented QML passes all 63 onboarding cases and 62 unchanged integer-input cases, with leak detection enabled and only the independently reproduced Qt hash exception. Old-production and native-keyboard controls fail before the fixes. Matching LLVM 22/Bitcoin-plugin checks, pinned Ruff and supplemental lint pass on the changed scope.
Correction to the earlier CI note: The standalone checkout lacks the requested top-level CI drivers. Configured rootless Docker is available; pinned Core-only fallback runs are incomplete and do not validate parent GUI-QML. The IPC-enabled standalone GUI uses a local node factory; actual Core multiprocess IPC lifecycle remains uncovered and
interface_gui.pyis absent. Current CI.Additional CI follow-up in
34acc2a9d5: the inherited custom-fee test required exact equality with the final signed transaction size. Pinned Core reproduced a 141-sat fee with a 140-vB transaction after a shorter ECDSA signature, so this was a test defect. The test now uses Core's bounded fee assertion and retains the wallet-minimum override and relay-minimum rejection checks. Shared-path validation passes eleven fee-boundary controls and both instrumented GUI fee scenarios. Only the Python test changed in this follow-up; earlier sanitizer/driver/IPC qualifications remain unchanged. New hosted checks are queued or running on this revision; no result is claimed yet. A freshly rebuilt native application for this PR also passes both GUI fee scenarios.The storage reset this PR adds on a directory change fixes a case I reproduced on current
qt6. The same carry-over still applies to the proxy, which this branch does not reset.What the storage reset fixes
At
eed1f426fcb6: start the wizard with the default directory, click Reduce storage, go Back, choose an existing full node's directory as Custom, and press Start. The existing node'ssettings.jsongained"prune": "1907"and the node came up pruned. Withtxindex=1in itsbitcoin.conf, the app stopped withPrune mode is incompatible with -txindex.on every relaunch. In the reverse direction, a pruned node lost its prune key and stopped at the rebuild question. Choosing the existing directory first, without touching storage, kept its setting in every case.By source, clearing the prune mark in
setDataDir(onboardingoptionsmodel.cpp#L187-L195) and theonboardingStorageChoiceResetsForAnotherDirectorytest cover this. I have not run this branch.What remains: the proxy
To reproduce at
eed1f426fcb6, with an existing node directory B whosesettings.jsonhas"proxy": "127.0.0.1:9050":B's
settings.jsonloses"proxy"and gains"proxy-prev": "127.0.0.1:9050". The started node'sgetnetworkinforeports an empty proxy for ipv4, ipv6 and onion. The result was the same offscreen and native.Controls with the same navigation kept B's proxy:
After the switch to B, no wizard page shows the proxy. Reopening the popup shows Enable off, while B's file still has the proxy. With B chosen first and nothing touched, the same popup shows B's proxy as on.
One related case may be intended: if B has no proxy and the user turned the proxy on for the default directory, B gains that proxy on Start.
setDataDirdoes not clear the set of settings the user has touched (onboardingoptionsmodel.cpp#L188-L198), and the preview for the new directory skips every touched key (core_settings.cpp#L832-L858). This branch clears onlyprune. By source the same applies to listen, NAT-PMP, server and the Tor proxy; I did not run those.Clearing the whole touched set on a real directory change would cover all of them. If an explicit choice should survive the switch, the wizard could show it against the new directory's own value before Start.
This needs two saved changes and two Back presses, so it is narrow. The outcome is an existing node starting without the proxy it was configured with.
Reproduced on merged
qt6ateed1f426fcb6, macOS / Qt 6.9, isolated regtest, offscreen and native. No traffic was observed, since the node ran with-connect=0; the evidence issettings.json,getnetworkinfoanddebug.log. The directory was passed to the model with the call the folder dialog makes, and the other steps were clicks through the test bridge. I wrote B's proxy key by hand in the app's format and confirmed withbitcoindthat it took effect.I ran this branch at
f68f5bf24c50. Both parts of my comment above are fixed: the storage choice and the proxy.settings.jsongains onlyqml_onboarded, and the node comes up unpruned. Withtxindex=1in itsbitcoin.confthere is no error. In the reverse direction a pruned node keeps"prune": "1907"and there is no rebuild question."proxy": "127.0.0.1:9050", gets noproxy-prev, andgetnetworkinforeports the proxy.Two changes in behaviour follow from clearing the choices, in case either is not intended:
qt6it survives.The same folder reached through a symlink, or through a path in a different letter case, counts as a different directory and clears the choices. A trailing slash does not.
This branch also fixes, by its diff, a case I had not reported. On
qt6at2bd5a61e8304, a number outside the range typed into Mempool size limit, Block storage limit, Database cache size or Script verification threads stays in the field with no error and is not saved, and after a restart the old value is shown and in effect.IntValidatorcalls such a number Intermediate, soeditingFinishednever fires and the range messages cannot be reached by typing. The new validator'sfixup()reports the rejected entry, which runs the commit function. I have not run that part. The below-minimum row oftest_dbcache_errors_show_minimum_guidancesets the text and callseditingFinished()directly, so one typed case (digits, then Return or focus loss) would pin it.Tested on macOS / Qt 6.9, isolated regtest. The cases from my earlier comment and the two above ran offscreen and in a native window; the rest ran offscreen only. Directories were passed to the model with the call the folder dialog makes, and the other steps were clicks through the test bridge. No traffic was observed, since the nodes ran with
-connect=0; the evidence issettings.json,getblockchaininfoandgetnetworkinfo. Listen, NAT-PMP, server and the Tor proxy are still by source only; I did not toggle them. In the number-field runs onqt6the digits were key events, focus was moved programmatically, and Return was not sent.