Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Only Custom Datadir Display #397

Merged
merged 2 commits into from
Jun 8, 2024

Conversation

D33r-Gee
Copy link
Contributor

@D33r-Gee D33r-Gee commented Apr 11, 2024

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

datadir_desktop

Android Screenshots

datadir_mobile_720

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.

Copy link
Contributor

@johnny9 johnny9 left a comment

Choose a reason for hiding this comment

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

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

src/qml/controls/OptionButton.qml Outdated Show resolved Hide resolved
src/qml/models/options_model.cpp Outdated Show resolved Hide resolved
src/qml/models/options_model.cpp Outdated Show resolved Hide resolved
src/qml/models/options_model.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

tACK 0025e91

  • 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

      Screenshot from 2024-04-12 20-36-30

  • 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 DRAFT: Custom Datadir Wiring #390, and more often I get another errors related with Gtk image in the console, which I reported (3.) already in DRAFT: Custom Datadir Wiring #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)' failed

src/qml/components/StorageLocations.qml Outdated Show resolved Hide resolved
src/qml/components/StorageLocations.qml Show resolved Hide resolved
src/qml/components/StorageLocations.qml Show resolved Hide resolved
src/qml/components/StorageLocations.qml Show resolved Hide resolved
@D33r-Gee
Copy link
Contributor Author

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

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?

@pablomartin4btc
Copy link
Contributor

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

To be clear we don't want to display the default datadir path here, correct?

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)?

image

However do we want to display the default path in StorageSettings.qml?

I think so, whatever it is set default or custom.

cc @GBKS

@D33r-Gee
Copy link
Contributor Author

To be clear we don't want to display the default datadir path here, correct?

As of figma, and the web prototype (link above) no, but it won't hurt to show it, I'm not sure.

@GBKS and @johnny9 what your thoughts regarding the above?

@D33r-Gee D33r-Gee force-pushed the qml-custom-datadir-display branch 2 times, most recently from 36467ea to dfc0023 Compare April 16, 2024 20:06
@johnny9
Copy link
Contributor

johnny9 commented Apr 17, 2024

To be clear we don't want to display the default datadir path here, correct?

As of figma, and the web prototype (link above) no, but it won't hurt to show it, I'm not sure.

@GBKS and @johnny9 what your thoughts regarding the above?

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

@GBKS
Copy link
Contributor

GBKS commented Apr 17, 2024

Just tested on desktop (Mac) and mobile (Android).

image

I agree with Johnny's rationale about ditching the Recommended label.

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.

@mouxdesign
Copy link

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?

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

re tACK dfc0023

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-qt vs. bitcoin-qt -signet, please expand to see the screenshots) - Also, should we keep "Recommended" highlighted here?
    • bitcoin-qt ("Reduce storage" looks wrong)

      Screenshot from 2024-04-23 12-23-04

    • bitcoin-qt signet ("Store all data" looks wrong)

      Screenshot from 2024-04-23 12-24-39

  • Using -datadir behaviour doesn't trigger the onboarding (neither combined with -chain= option - e.g. -signet with no -datadir triggers the onboarding when signet subdir doesn't exist on default datadir structure but setting -datadir option + -signet with no subdire doesn't) and it should when that custom datadir is empty otherwise:

    ./src/qt/bitcoin-qt -datadir="/home/pablo/custom"
    Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
    Running initialization in thread
    Warning: Disk space for "/home/pablo/custom/blocks" may not accommodate the block files. Approximately 540 GB of data will be stored in this directory.
    
    
    

@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

@pablomartin4btc
Copy link
Contributor

Just tested on desktop (Mac) and mobile (Android).

@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.

I agree with Johnny's rationale about ditching the Recommended label.

Ok, please check the next page when user has to select the amount of space to store, there's also a "Recommended" highlighted label.

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'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 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.

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.

@pablomartin4btc
Copy link
Contributor

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?

I think that should be after accepting (clicking on next) the following page "Reduce store"/ "Store all data" (before starting the initial download sync).

@GBKS
Copy link
Contributor

GBKS commented Apr 24, 2024

How about one of these two options for the error message?

image

@pablomartin4btc
Copy link
Contributor

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:

image

(crossed 9GB in red as it's incorrect)

@GBKS
Copy link
Contributor

GBKS commented Apr 25, 2024

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).

@D33r-Gee D33r-Gee force-pushed the qml-custom-datadir-display branch from dfc0023 to 2fbb27a Compare May 1, 2024 14:31
@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented May 1, 2024

Rebased over main dfc0023 to 2fbb27a

@D33r-Gee D33r-Gee force-pushed the qml-custom-datadir-display branch from 2fbb27a to 8e8aadf Compare May 1, 2024 17:45
@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented May 1, 2024

@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?

Copy link
Contributor

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

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

8e8aadf
I cannot repro the double-click issue anymore #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 to settings -> storage -> data directory displays the custom data dir

@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented May 1, 2024

8e8aadf I cannot repro the double-click issue anymore #399 friendly ping @pablomartin4btc

That's great to hear...

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 to settings -> storage -> data directory displays the custom data dir

Could you post a screenshot please?

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

8e8aadf I cannot repro the double-click issue anymore #399 friendly ping @pablomartin4btc

Ok, thanks for letting me know... I'll do another test on the latest version of this PR.

@MarnixCroes
Copy link
Contributor

Could you post a screenshot please?

during onboarding:

Screenshot from 2024-05-01 23-45-12

Screenshot from 2024-05-01 23-45-19

after onboarding, at settings
Screenshot from 2024-05-01 23-45-28

johnny9
johnny9 approved these changes May 21, 2024
Copy link
Contributor

@johnny9 johnny9 left a comment

Choose a reason for hiding this comment

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

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/");"

@D33r-Gee D33r-Gee force-pushed the qml-custom-datadir-display branch from 2e2fe79 to 7341bdf Compare May 21, 2024 18:03
@D33r-Gee
Copy link
Contributor Author

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 const to the getter function. I removed them and now it builds properly for both Android and Linux

Copy link
Contributor

@johnny9 johnny9 left a comment

Choose a reason for hiding this comment

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

ACK 7341bdf

Copy link
Contributor

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

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

tested lgtm 7341bdf

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

@MarnixCroes
Copy link
Contributor

FTR, can repro the double-click in background issue on latest commit. not sure why previously I couldn't repro #397 (review)

@GBKS
Copy link
Contributor

GBKS commented May 22, 2024

The MacOS workflow runs seem to fail for this PR (also for 401). Would it be possible to fix those to simplify testing?

@D33r-Gee
Copy link
Contributor Author

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

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.

@D33r-Gee
Copy link
Contributor Author

The MacOS workflow runs seem to fail for this PR (also for 401). Would it be possible to fix those to simplify testing?

Hmmm... well that's problematic... will discuss with the other devs and see what can be done... Thanks for pointing it out!

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

tACK 7341bdf

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:

  • Custom Datadir double click (check workaround at Bugfix custom datadir doubleClick - Follow-up #392 #399).
  • custom data dir -> select default data dir -> select custom data dir -> it prompts the folder location selection again (reported by @MarnixCroes)
    • not sure about differentiation between 1 click (for just tick the custom dir) or double to open a file dialog, perhaps adding a button/ icon to open the dialog but would break this design, I'd leave this to the design experts.

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)' failed

src/qml/models/options_model.cpp Show resolved Hide resolved
src/qml/models/options_model.cpp Show resolved Hide resolved
@pablomartin4btc
Copy link
Contributor

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.

@GBKS: Agreed. Just found another case (ref.: "Another UX nit").

@D33r-Gee D33r-Gee force-pushed the qml-custom-datadir-display branch from 2a56d6b to c2e73b2 Compare May 27, 2024 18:01
@D33r-Gee
Copy link
Contributor Author

c2e73b2 rebased over main

Copy link
Contributor

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

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

c2e73b2

it can happen that the GUI completely freezes
can'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 repro

repro steps
  • run with resetguisettings
  • at Storage location dialog click custom
  • click back (so don't select a location) (can also repro when selecting the location)
  • click on default
  • then double-click on custom
qmlguifreeze.webm

@D33r-Gee D33r-Gee force-pushed the qml-custom-datadir-display branch from c2e73b2 to 7a8fb19 Compare May 30, 2024 15:24
@D33r-Gee
Copy link
Contributor Author

it can happen that the GUI completely freezes can'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 repro

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 custom area then the second click will push the dialog window behind the app window which I believe is proper file dialog behavior.

@MarnixCroes
Copy link
Contributor

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

Copy link
Contributor

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

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

tACK 7a8fb19 on Ubuntu desktop

the double-click issue can be fixed later imo

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

reACK 7a8fb19

Verified that the following issue has been fixed:

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.

@D33r-Gee
Copy link
Contributor Author

Looks like the mac os artifact issue has been addressed... Could you please confirm on your end when you get the chance, @GBKS?

@GBKS
Copy link
Contributor

GBKS commented Jun 7, 2024

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?

@D33r-Gee
Copy link
Contributor Author

D33r-Gee commented Jun 7, 2024

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 datadir so they can either navigate to it in the cli or browse the folder using the OS gui

@hebasto hebasto merged commit 364e41d into bitcoin-core:main Jun 8, 2024
8 of 9 checks passed
@GBKS
Copy link
Contributor

GBKS commented Jun 8, 2024

It was an idea in case a user wants to quickly copy the datadir so they can either navigate to it in the cli or browse the folder using the OS gui

I 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants