mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:00:39 +00:00
UI Only Custom Datadir Display #397
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!397
Loading…
Reference in a new issue
No description provided.
Delete branch "qml-custom-datadir-display"
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?
This pull request builds upon #392 and introduces enhancements to display the data directory information within the UI. This functionality encompasses both default and custom data directory paths, fulfilling the UI requirements for user-defined data directory selection initiated in #273.
Also the custom datadir is not persistent at the moment it will be once the back end wiring is added.
Ubuntu 22.04 Screenshots
Android Screenshots
As a potential follow-up enhancement, consider incorporating mechanisms for saving the data directory path. This could be achieved through:
Double-click functionality: Allow users to save the displayed path by simply double-clicking on it. This provides a convenient and intuitive method for desktop environments.
Dedicated button: For mobile use cases or scenarios where double-clicking might not be feasible, introduce a dedicated "Save Path" button. This ensures a clear and accessible action for users on various devices.
Based on both the figma and the web prototype, the path should only be displayed on the custom selection after the user has made a choice.
https://lively-kashata-cfde7e.netlify.app/screen/first-use/storage-location?state=default
What's the reason for having this different for android? Android also scales the fonts based on the dpi already so I'm not sure I understand the dpi factor here
#ifdef shouldnt be indented
#ifdef are never indented
add a newline to the end of the file
tACK 0025e91fe4ac53e0d8485f3dedb65e8ffff8b50c
Noticed the same as @johnny9, proposed a change below (1) which also fixes the prefix of the
customDir"file://" before the file dialog gets open or if the user cancels it.screenshot
Currently when the user cancels to set a custom datadir the custom option is still checked when perhaps we should go back to the default datadir being checked. So I proposed another change to that (2) with a caveat where if the user sets the custom, then wants to change it again but cancels it, it remains there in the custom checked.
We need to tackle the double click issue at some point. I spent some time with it but couldn't solved it yet.
First time I run it I got the crash reported by @MarnixCroes on #390, and more often I get another errors related with Gtk image in the console, which I reported (3.) already in #390 as well, both errors are produced as soon as I open the file dialog.
crash error
** Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) Aborted (core dumped)Gtk image warning
(bitcoin-qt:1496162): Gtk-CRITICAL **: 20:32:43.950: gtk_image_set_from_gicon: assertion 'GTK_IS_IMAGE (image)' failedPart of suggestion (2), assign an identifier to set
checked = trueon it when user cancels to set custom data dir.Mentioned in the review comment as (1).
Part of suggestion (2), if the users checks the default option, we don't show the custom data dir anymore.
Part of suggestion (2), when users cancels the file dialog, depending if the users changed the folder (stays in custom) or not (goes back to default).
Leaving out the fonts discussion, regarding
Qt.platform.os === "android", shouldn't we useAppMode.isMobileonqmlfiles instead (unless there's something platform specific of course likeWIN32or__linux__) ? Since the platform was already determined during startup andmode = AppMode::MOBILEwas assigned.To be clear we don't want to display the default datadir path here, correct?
However do we want to display the default path in StorageSettings.qml?
As of figma, and the web prototype (link above) no, but it won't hurt to show it, I'm not sure.
Also, sorry if I'm adding confusion here but on a previous PR #390 there was a "Recommended" highlighted label on the default choice when I reviewed it, was that dropped (if ever discussed)?
I think so, whatever it is set default or custom.
cc @GBKS
@GBKS and @johnny9 what your thoughts regarding the above?
great suggestions... done
done
also great suggestion
good call folks... done
done
done
done
done
I don't have a strong opinion about this so i would defer to the current figma.
I do think the "Recommended" highlight is redundant as "Default" has the same meaning so I would remove that to match the figma
Just tested on desktop (Mac) and mobile (Android).
I agree with Johnny's rationale about ditching the
Recommendedlabel.Something I noticed is that the directory display of the custom option disappears if I select the default one again (center). It feels unexpected, could we keep that visible?
I could go either way on showing the default directory. Might be more consistent if we just show it, so users know what they are changing from.
For the rightmost screenshot, could we switch to a vertical layout for the directory field? So the directory goes underneath the label? It's a bit awkward to have it squeezed on the right side.
Storage error message: What would be the error message that a user would see if they choose to proceed but their device does not have sufficient storage?
re tACK dfc002306b6e6445703c75a87b0725786db33133
Verified my previous feedback got addressed. Usability seems more consistent.
Some observations (perhaps we need to address them with a new "onboarding related" PR):
Storage space estimation looks wrong during onboarding (e.g. starting the app simply with
bitcoin-qtvs.bitcoin-qt -signet, please expand to see the screenshots) - Also, should we keep "Recommended" highlighted here?bitcoin-qt("Reduce storage" looks wrong)bitcoin-qt signet("Store all data" looks wrong)Using
-datadirbehaviour doesn't trigger the onboarding (neither combined with-chain=option - e.g.-signetwith no-datadirtriggers the onboarding when signet subdir doesn't exist on default datadir structure but setting-datadiroption +-signetwith no subdire doesn't) and it should when that custom datadir is empty otherwise:@D33r-Gee, could you please try to investigate root of the crash mentioned at the end of my previous review? It seems it happens at the very first time you run
bitcoin-qt(need to remove datadir and bitcoin config dir) using the file dialog of course, otherwise it doesn't happen. Most of the time the user would get this error message in the terminal:(bitcoin-qt:756208): Gtk-CRITICAL **: 10:57:38.210: gtk_image_set_from_gicon: assertion 'GTK_IS_IMAGE (image)' failed@GBKS for future reference, please add the commit version you've tested if possible so we can verify if it's the latest or a previous one.
Ok, please check the next page when user has to select the amount of space to store, there's also a "Recommended" highlighted label.
I've proposed to hide it when a user goes back to default datadir to avoid confusion, as in when a user sees the page for the first time won't see the custom datadir until the user clicks on it and set it. Is it necessary if that's not the datadir that's going to be used?
I'd show it but I've also thought if we can add an external link, not sure if with an information icon or something, to the bitcoin datadir documentation.
I think that should be after accepting (clicking on next) the following page "Reduce store"/ "Store all data" (before starting the initial download sync).
How about one of these two options for the error message?
As discussed on the designers call today, just keep in mind that the validation should be on the next page:
(crossed 9GB in red as it's incorrect)
Can we detect how much space is available on each location and show it? And can we estimate the required space needed (the mock-up uses 500GB as a placeholder, which is meant to be replaced with something accurate).
Rebased over main dfc0023 to 2fbb27a
@GBKS and @pablomartin4btc Thanks for the feedback regarding the storage amount and the error messaging.
those will be addressed in a different PR since this is only for datadir display
Meanwhile please me know your thoughts on the latest update 8e8aadf?
8e8aadf2396e54428c0ca5ae562030734d0650cf
I cannot repro the double-click issue anymore https://github.com/bitcoin-core/gui-qml/pull/399
friendly ping @pablomartin4btc
one issue/inconsistency:
the selected custom data dir is not updated/displayed correctly during the onboarding, but it as at settings:
onboarding -> select custom data dir -> next -> click
Detailed settings-> default data dir is displayed -> next -> next -> arrive at home screen -> go tosettings->storage-> data directory displays the custom data dirThat's great to hear...
Could you post a screenshot please?
Ok, thanks for letting me know... I'll do another test on the latest version of this PR.
during onboarding:
after onboarding, at settings

@MarnixCroes Thanks for the screenshots... I see what you mean... Looking into it
tACK 8e8aadf2396e54428c0ca5ae562030734d0650cf
I'm not sure about showing the default path when the user has selected the custom one but not a blocker.
I can still do it (being on custom data dir selected, just double clicking on it).
I could repro this ^; it looks like the model hasn't been refreshed? Are we sure it's the same instance of the options model (not a copy)? cc @johnny9.
Thanks @pablomartin4btc for testing it
I could go either way, however it feels consistent to show the default datadir regardless since if the user is going through onboarding there's a high chance it might be their first time installing Bitcoin Core, and knowing where the default data is store might be helpful. Any thoughts @GBKS?
RE: @MarnixCroes comment about displaying the default datadir instead of custom, it seems StorageSettings is not refreshing until the node launches so it's not registering the change from default to custom datadir, I believe that this get addressed with #284. Going to test to confirm on separate branch...
with the latest commit 2a301e1 addressed @MarnixCroes comment about the datadir not displaying properly during onboarding. Turns out made the mistake of not using the setter function for the customDataDir bool.
Please let me know if it displays correctly for ya'll @pablomartin4btc @johnny9 @GBKS @MarnixCroes ?
tACK 2a301e117f6e83611b08a3d6242ed6aaa1f4caa5
The issue/ inconsistency reported by @MarnixCroes has been fixed.
I noticed another bug which is: if the user clicks on custom, the file dialogs opens, the user creates a folder or moves around dirs but cancels the dialog, the custom option will be kept ticked/ selected but with no path and if the user continues the default will be stored.
On the default path shown when custom is selected:
I'm still not sure because when the user lands into this page, no custom data dir has been selected so nothing is shown. When the 2 paths are shown someone could think that some data is still stored on the default path? Again, not a blocker.
It seems confusing the current naming convention here, also: do we need to store a bool?; perhaps @johnny9 has a better naming since he has been working with the options model already, mine is just an idea.
yes a bool is needed here so that StorageSettings.qml relfects the proper data directory (either default or custom).
Thanks @pablomartin4btc for testing and reviewing
addressed this with the latest push from 2a301e1 to 61e775b
Now when a user cancels after having picked a custom datadir it reverts back to default
ok but do we need that instance variable (
m_custom_datadir) to store it or it can be dynamically calculated as suggested?Just tested the latest build, which I believe is 61e775b , on MacOS and Android.
Nice to see this come together. Just have some small comments:
Regarding the point about consistency for showing the directory box, I'd show it if it has a value. The default one can always be visible. And if the user has set one for the custom option, it can also be shown independent of whether that option is still selected or not. And if the user goes to the directory picker and cancels out of it, the previously picked option can remain active. That seems intuitive to me.
Quite the long thread, hope I didn't miss anything. Maybe good to address things like the error message in a separate PR to keep things manageable.
Certainly, adhering to the established conventions for options would suggest utilizing m_custom_datadir. However, if a more refined approach emerges, we could potentially explore its implementation in a subsequent pull request.
Thanks @GBKS for testing and reviewing...
This:
Is addressed with the latest push b941932
what would be the correct color?
this use case may be problematic since if the user cancels it currently reverts back to default, are you suggesting that if there was a previously selected folder then the custom option should remain selected even after the user cancels a secondary attempt at setting the custom datadir?
with the latest push from b941932 to 0c46cae addressed @GBKS comment regarding the proper color for datadir display, by adding a new
state("DIRECTORY") in ValueInput.qmlNext is addressing this:
new commit 855cea5 addressing this use case
Now when the user has picked/accepted a custom datadir and then decides to change it but cancels the selection it stays with the custom datadir previously selected unless they click on the default option
rebased new head is ce6866a9adf408625f6506497f9e78b6b663cadf
Don't overload ValueInput for non input items. Just use CoreText or Label
This isnt an Input so just use CoreText
Remove this state as its not appropriate
spacing is off here
The confusion here is around the name of the variable. customDataDir implies it is a string. A better name for a bool would be isCustomDataDirSet or usingCustomDataDir and customDataDir should just be the name for the string.
I prefer the dynamic calculation of the state myself. It is clearer to me
done
done
Thanks for the suggestions, decided to go with a dynamic string variable instead of managing the customDataDir bool... Let me know your thoughts?
done
Updated from ce6866a to 2e2fe79
Main changes were implementing @johnny9 and @pablomartin4btc feedback...
RE:
customDataDirbool, decided to go with a dynamic setting ofdataDirsince the bool options was giving me grief...Please let me know your thoughts?
Seems to be an issue with building the Android target
"qml/models/options_model.cpp:186:55: error: no matching member function for call to 'replace'
m_custom_datadir_string = m_custom_datadir_string.replace("content://com.android.externalstorage.documents/tree/primary%3A", "/storage/self/primary/");"
Thanks for discovering this... Found the cause of the problem, I mistakenly left the added
constto the getter function. I removed them and now it builds properly for both Android and LinuxACK 7341bdf839040bba2895290f3a59adc7a48132c2
tested lgtm 7341bdf839040bba2895290f3a59adc7a48132c2
one nit/UX thing: select/have a custom data dir -> select default data dir -> select custom data dir -> it prompts the folder location selection again.
for me it would be more intuitive to not prompt the storage location for one click -> only when double-clicking. when clicking on the custom datadir again
FTR, can repro the double-click in background issue on latest commit. not sure why previously I couldn't repro https://github.com/bitcoin-core/gui-qml/pull/397#pullrequestreview-2034467887
The MacOS workflow runs seem to fail for this PR (also for 401). Would it be possible to fix those to simplify testing?
Thanks for testing and the feedback. That's a good point, will add it to the polishing features alongside the error messaging. One thing to keep in mind is that on mobile "double-tapping" is uncommon so we'll have to play with it to see what feels most natural.
Hmmm... well that's problematic... will discuss with the other devs and see what can be done... Thanks for pointing it out!
tACK 7341bdf839040bba2895290f3a59adc7a48132c2
Another UX nit: when a user selects a custom datadir and accepts it, clicks again on custom datadir to open the file dialog, creates a different custom dir but cancels the dialog, it goes wrongly to tick/ check the default datadir. Perhaps we can correct that on a follow-up.
Standing issues to follow-up:
I still get this error the first time I run QT and open the File Dialog... could be something related with my initial env, after the first time it's not reproducible, leaving the comment here to follow-up later:
edit: (sorry, forgot to add the error...)
(bitcoin-qt:1496162): Gtk-CRITICAL **: 20:32:43.950: gtk_image_set_from_gicon: assertion 'GTK_IS_IMAGE (image)' failedwhat the
Argssuffix insetCustomDataDirArgsstands for? Also because we have the option-datadirpassed from the command line.nit: why not having something like proposed here? It'd be easier to follow I think.
@GBKS: Agreed. Just found another case (ref.: "Another UX nit").
c2e73b2 rebased over main
Thanks for your suggestion... after testing it became clear that not depending on a new
boolwould be the way to go. And so implemented yours and Johnny9 suggestions as part of a newdataDirvariable.The
Argssuffix will come in play when the actual backend is connected since it will modify thegArgsso that the newdatadiris set properly.c2e73b259802c5644859542c785eb46f93911841
it can happen that the GUI completely freezescan't do anything, need to close the app.can repro most of the time, but not 100%maybe a bit of an edge case, as it's not the usual user flow for how to reprorepro steps
customcustomqmlguifreeze.webm
Couldn't repro on WSL Ubuntu 22.04. Kept on double/triple clicking and nothing froze...
However was able to approximately repro the "double click" (#399) from my experience the first click opens the dialog and if it opens away from the
customarea then the second click will push the dialog window behind the app window which I believe is proper file dialog behavior.ok please ignore my previous comment about freezing.
This time I was running in full window, and the file dialog was opened in background without me noticing.
sry
tACK
7a8fb19db1on Ubuntu desktopthe double-click issue can be fixed later imo
reACK
7a8fb19Verified that the following issue has been fixed:
Looks like the mac os artifact issue has been addressed... Could you please confirm on your end when you get the chance, @GBKS?
ACK
7a8fb19. Looks and feels great, just tested again on MacOS.Regarding the follow-ups in the description about double-clicking to save the path - why would users want to save the path in this specific situation?
It was an idea in case a user wants to quickly copy the
datadirso they can either navigate to it in the cli or browse the folder using the OS guiI like this thinking about secondary actions and I think we'll have a lot of opportunity to implement them throughout the app for more regular and power users (via tap-and-hold and right-click menus on mobile and desktop respectively). They are not always easy to discover, but repeat users should appreciate them.