qml: clarify onboarding storage options for existing datadir

bitcoin-core/gui-qml: PR #1050

2 minor findings · 4 suggestions

Findings

Link

[minor] · Fresh profiles receive an existing-block-data advisory

For a fresh data directory with insufficient space for a full download, the disabled “Store all data” card says “Existing block data can be reused,” although that directory has no blocks to reuse.

Location: qml/components/StorageOptions.qml:95 (head).

Details and suggested fix

The second part of errorText checks only hasStorageResult && availableGB < fullRequiredGB, so it also appears for first-time users. OptionButton displays this text independently of whether the card is enabled. Unlike the redownload warning, the reuse clause has no existingProfile guard. Show that clause only for existing profiles, or use a separate fresh-profile string that reports the space requirement without suggesting block reuse. Add an errorText assertion to the existing fresh-profile insufficient-space test.


Link

[minor] · Rounded low-space exemption accepts a higher prune target

For an existing pruned profile with little free space, rounding its saved MiB target up to GB lets an increase of less than 1 GB bypass the popup’s available-space cap.

Location: qml/models/onboardingoptionsmodel.cpp:221 (head).

Details and suggested fix

For prune=4096, PruneMiBToGB raises the exemption to 5 GB, but PruneGBToMiB(5) produces 4768 MiB. When the available-space maximum is below 5 GB, editing the popup from 4 to 5 therefore accepts an increase rather than only keeping or lowering the saved target. clearUnchangedStorageSelection() leaves that edit touched because 4768 differs from 4096. Apply the exemption only when the parsed value converted back to MiB does not exceed currentPruneTargetMiB(); otherwise enforce the available-space maximum. Cover a non-round-tripping saved target in the low-space test. The overshoot is below 1 GB, and existing profiles can already select full storage with only an advisory, so this cap is not a safety boundary.


Optional improvements

Link

[suggestion] · Changing directories silently discards saved onboarding proxy choices

A proxy or Tor-proxy choice saved in onboarding is silently replaced by the next profile’s settings after a directory change; a reset notice would make the intentional profile-scoped behavior explicit.

Location: qml/models/onboardingoptionsmodel.cpp:194 (head).

Details and suggested fix

A user can save a proxy choice through Network settings, go Back to select another directory, and then press Start without reopening that popup. setDataDir() now clears all touched settings, so the successful preview replaces those proxy values with the new profile’s values, including disabling the proxy when none is configured there. Keeping choices profile-scoped prevents an earlier disabled proxy from overwriting another profile’s configured proxy and is a reasonable contract. Preserve that reset, but show a notice on the Connection page when it discards saved network edits so the user can review the replacement settings before starting.


Link

[suggestion] · Locked manual-pruning switch displays toggle instructions

With command-line -prune=1 on an existing profile, the onboarding popup tells users to toggle a disabled switch, although the target row still explains the command-line lock.

Location: qml/pages/settings/StorageSettingsPage.qml:42 (head).

Details and suggested fix

The new supportingText condition checks onboarding, keepingCurrentStorage and a saved target of 1, but not pruneSetting.canEdit. It therefore replaces the switch’s command-line explanation with instructions to enable automatic pruning even when the switch cannot be used. The block-storage-limit row below still shows infoText, so the lock explanation is not lost entirely. Add pruneSetting.canEdit to the manual-pruning guidance condition so the disabled switch retains its applicable explanation.


Link

[suggestion] · Exact-target behavior and functional expectations land separately

Source inspection shows that ab4368221 restores Reduce storage for the (6675, 7) case while its functional test still expects Custom; the matching expectation arrives only in e5755d47.

Location: test/functional/qml_test_preinit_onboarding.py:441 at e5755d47bdc3 (commit) (commit).

Details and suggested fix

ab4368221b812440fe45ef768a41cb9c6b51b8f0 introduces exact-target restoration: selectStorage(true, 7) serializes to 6675 MiB, clears the prune edit and selects Reduce storage instead of Custom. At that commit, run_existing_profile_custom_storage_flow() still waits for Custom to be checked and asserts Reduce is unchecked. Its direct child, e5755d47bdc36b8948dacdd3b3dec891fcd61899, updates only this test to recognize restoration. Fold that test-only commit into the behavior commit so the new rule and its functional expectations can be reviewed and validated together. This leaves the final tree unchanged. The later native-activation fix in 147440f7f3170198866bb69e13d6fc9f1da62e36 may still be needed for all real-GUI flows; this rearrangement addresses the stale expectation, not every intermediate failure.


Link

[suggestion] · Sizing commit describes a layout change but only adds a test

a5931d7a describes an option-card layout change but adds only coverage; the optionButtonHeader hook needed by that test sits in the earlier highlight-animation commit ec48c8a.

Location: test/qml/tst_formcontrols.qml:298 at a5931d7a6061 (commit) (commit).

Details and suggested fix

a5931d7a606146196a95d9d8c6275162405e2eb1 adds test_optionButtonSizesWithoutBadgeOrWarning(), but its message says it sizes titles and descriptions directly in a layout. That layout already exists at base, so a reviewer cannot find the described implementation change in this commit. The test’s only optionButtonHeader hook was instead added by ec48c8a887d2b458176c92feffe081d21168b582 alongside the highlight-animation change. Move the hook into the later test commit and retitle/reword that commit as sizing coverage. This keeps the final tree and dependencies intact while making the purpose of both patches clear.


Coverage details