mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:03:39 +00:00
Onboard existing Bitcoin Core datadir without overwriting user settings #704
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#704
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
QML onboarding needs to distinguish between:
An existing Bitcoin Core user may launch the QML app for the first time using an already-initialized Core datadir. In that case, QML onboarding should still be shown if
qml_onboardedhas not yet been set for that profile, but the app must not treat that datadir as a fresh setup or overwrite existing user settings.This is separate from #596, which covers custom datadir wiring for fresh onboarding.
Proposed behavior
Datadir resolution
Resolve the active datadir in this order:
-datadirstrDataDirbehavior)The GUI-saved datadir should be global, not network-specific, like Qt. It should be persisted at the end of onboarding.
When to show the storage directory page
Whether
OnboardingStorageLocationis shown should depend on whether the datadir has already been chosen by CLI or by a previous GUI onboarding run.Show
OnboardingStorageLocationonly when:-datadiris set, andSkip
OnboardingStorageLocationwhen:-datadiris set, or-resetguisettingsshould mimic Qt behavior by re-showing datadir selection and resetting the relevant GUI/onboarding state.Support for
-choosedatadirshould be tracked separately in a new issue.qml_onboardedremains datadir-specificqml_onboardedshould remain tied to the resolved active datadir/profile via that profile'ssettings.json, not to global QSettings.After resolving the active datadir:
qml_onboarded=true, skip onboardingqml_onboardedis missing/false, show onboardingDetecting an existing Core profile
Whether to show the remaining settings choices should not be based on
settings.jsonexistence alone.Treat the resolved datadir as an existing Core profile if any same-network Core state already exists there, including for example:
settings.jsonbitcoin.confprunedblockfilesIf none of those are present, treat the datadir as a fresh profile.
Page behavior when
qml_onboardedis missingIf the resolved datadir is an existing Core profile:
OnboardingCover("Bitcoin Core App")OnboardingStrengthen("Strengthen bitcoin")OnboardingBlockclock("The block clock")OnboardingStorageLocation("Storage location")OnboardingStorageAmount("Storage")OnboardingConnection("Starting initial download")resetSettings()by defaultqml_onboarded=trueIf the resolved datadir is a fresh profile:
qml_onboarded=trueNon-goals / related work
-choosedatadirsupport should be tracked in a new issue.Definition of Done
-datadirOnboardingStorageLocationis shown only when no CLI datadir and no GUI-saved datadir choice exist.qml_onboardedis evaluated for the resolved active datadir/profile, not as a global GUI flag.qml_onboarded:OnboardingCover,OnboardingStrengthen, andOnboardingBlockclockare shownOnboardingStorageLocation,OnboardingStorageAmount, andOnboardingConnectionare skippedqml_onboarded:-resetguisettingsre-shows datadir selection and resets the relevant GUI/onboarding state without defaulting to destructive resets of an existing Core profile.-datadirset vs unsetqml_onboardedpresent vs absent-resetguisettingsbehaviorNotes
PR #549 introduced the useful concept of a
qml_onboardedmarker. That marker should mean QML onboarding has completed for a specific profile. It should not be replaced with a broad rule that skips onboarding whenever any Core settings or config exist, because existing Bitcoin Core users are exactly the users who still need first-run QML onboarding without losing their prior configuration.Related to #549
If that bool is set should determine if we show onboarding or not.
In the case of this issue, with settings,json existing in the chosen path, Only show the mission statements and skip the persistant settings pieces like storage and connection.
Related to #405
Related to #406
I’m working on a settings/onboarding QML branch that partially addresses this issue. This can be considered picked up for now; once the PR is ready, I’ll revisit whether it fully addresses this issue or whether follow-up work should remain tracked here.
For the first implementation, I’m intentionally choosing to show the full onboarding flow for an existing Core datadir when
qml_onboardedhas not been set yet.The reason is partly my own choice and partly safety. Since the QML GUI is still experimental, I want existing Bitcoin Core users who try it for the first time to have an explicit chance to review the onboarding choices instead of silently skipping past storage and connection settings. In particular, showing the storage pages gives the user an escape hatch if they hadn't done so already to choose a different datadir for the experimental QML GUI rather than immediately reusing their existing Core datadir without confirmation.
My settings implementation rework overall still preserves existing settings: it preloads the resolved datadir/profile settings into onboarding, does not treat the profile as fresh, and avoids overwriting untouched settings. So this diverges from the issue’s originally proposed abbreviated onboarding flow, but it does so deliberately to make first-run QML onboarding safer for existing Core users as we demo.
If we still want the logic described here in this issue, we can open a follow-up issue specifying the need for the "what to show conditionals"