UI Only Custom Datadir #392

Manually merged
D33r-Gee merged 5 commits from qml-custom-datadir-ui into main 2024-04-08 08:04:49 +00:00 AGit
D33r-Gee commented 2024-03-27 19:14:13 +00:00 (Migrated from github.com)

This pull request is a focused iteration of #390, intended to isolate and test the UI frontend elements. Backend functionality has been intentionally excluded to streamline the testing, review, and merge process.

Ubuntu Screenshots

Screenshot 2024-03-14 124000
Screenshot 2024-01-29 074759
Screenshot 2024-01-29 074734

Prerequisites

For testing this pull request, ensure you have the following Qt modules installed:

  • On Ubuntu 22.04:
sudo apt-get install qtdeclarative5-dev
sudo apt-get install qtquickcontrols2-5-dev
sudo apt-get install qml-module-qtquick-controls2
sudo apt install qml-module-qtquick-dialogs
  • For Android:
    • Make sure you delete the prior depends folder (i.e. depends/aarch64-linux-android) and rebuild them.

Implementation Details

This introduces FileDialog class for a user-friendly selection experience.

  • QML Backend
    • Updated options_model files to account for custom data directory configuration and placeholders for custom datadir wiring.
    • Added @johnny9 depends patches to allow static building
  • QML Frontend
    • Updated StorageLocations.qml to allow for custom data directory selection.

Follow up PR will add display of the custom datadir in StorageSettings.qml

This pull request is a focused iteration of #390, intended to isolate and test the UI frontend elements. Backend functionality has been intentionally excluded to streamline the testing, review, and merge process. <details> <summary>Ubuntu Screenshots</summary> ![Screenshot 2024-03-14 124000](https://git.fish.foo/attachments/6e93076f-7730-46f9-9bc2-5905c7e95fae) ![Screenshot 2024-01-29 074759](https://git.fish.foo/attachments/da27f6cb-d638-4318-8039-f9901c126e42) ![Screenshot 2024-01-29 074734](https://git.fish.foo/attachments/bb21d016-9ab7-45ec-b6f0-34f6abf9d9f9) </details> **Prerequisites** For testing this pull request, ensure you have the following Qt modules installed: * On Ubuntu 22.04: ```bash sudo apt-get install qtdeclarative5-dev sudo apt-get install qtquickcontrols2-5-dev sudo apt-get install qml-module-qtquick-controls2 sudo apt install qml-module-qtquick-dialogs ``` * For Android: * Make sure you delete the prior depends folder (i.e. `depends/aarch64-linux-android`) and rebuild them. **Implementation Details** This introduces `FileDialog` class for a user-friendly selection experience. * **QML Backend** * Updated `options_model` files to account for custom data directory configuration and placeholders for custom `datadir` wiring. * Added @johnny9 depends patches to allow static building * **QML Frontend** * Updated `StorageLocations.qml` to allow for custom data directory selection. Follow up PR will add display of the custom `datadir` in StorageSettings.qml
johnny9 (Migrated from github.com) requested changes 2024-03-28 03:37:26 +00:00
johnny9 (Migrated from github.com) left a comment

Update the README at https://github.com/bitcoin-core/gui-qml/tree/main/src/qml with the additional packages that need to be installed.

Update the README at https://github.com/bitcoin-core/gui-qml/tree/main/src/qml with the additional packages that need to be installed.
johnny9 (Migrated from github.com) commented 2024-03-28 03:32:12 +00:00

add newline to end of file

add newline to end of file
D33r-Gee (Migrated from github.com) reviewed 2024-03-28 16:20:44 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-28 16:20:44 +00:00

done

done
D33r-Gee commented 2024-03-28 16:44:42 +00:00 (Migrated from github.com)

Update the README at https://github.com/bitcoin-core/gui-qml/tree/main/src/qml with the additional packages that need to be installed.

Good call @johnny9! Just pushed a new commit with the updated doc.

Now it's pretty much equivalent (give and take) with @jarolrod's #273

> Update the README at https://github.com/bitcoin-core/gui-qml/tree/main/src/qml with the additional packages that need to be installed. Good call @johnny9! Just pushed a new commit with the updated doc. Now it's pretty much equivalent (give and take) with @jarolrod's #273
pablomartin4btc (Migrated from github.com) reviewed 2024-03-29 00:24:03 +00:00
pablomartin4btc (Migrated from github.com) left a comment

tACK 3f564606e36fcd2ade2bdc37d5217563a4c442ee

It works as expected, left some code-related nits.

There's a specific case that I mentioned (3rd. bullet point) in the related PR #390, which I now discovered it's due to starting QT desktop and afterwards it's closed run the QML (on the same network env - e.g. -signet). I'll create an issue to discuss the best way to solve it.

image

nit: 3rd. commit (f3d251fc93fda956cb8cc14b5717c2485db84781) title length could be shorter, as in the mentioned above related PR , so it can be seen at first glance at the commits list without having to click on the ..., or during reviewing the "files changed" tab section also trying to select one from the commits list.

image

image

tACK 3f564606e36fcd2ade2bdc37d5217563a4c442ee It works as expected, left some code-related nits. <details> <summary>There's a specific case that I <a href="https://github.com/bitcoin-core/gui-qml/pull/390#pullrequestreview-1940546706">mentioned</a> (3rd. bullet point) in the related PR #390, which I now discovered it's due to starting <code>QT</code> desktop and afterwards it's closed run the <code>QML</code> (on the same network env - e.g. <code>-signet</code>). I'll create an issue to discuss the best way to solve it.</summary> ![image](https://git.fish.foo/attachments/deaa5fc7-39f7-458e-add5-6c478162ad8d) </details> <details> <summary>nit: 3rd. commit (f3d251fc93fda956cb8cc14b5717c2485db84781) title length could be shorter, as in the <a href="https://github.com/bitcoin-core/gui-qml/pull/390#pullrequestreview-1953852936">mentioned</a> above related PR , so it can be seen at first glance at the commits list without having to click on the <code>...</code>, or during reviewing the "files changed" tab section also trying to select one from the commits list.</summary> ![image](https://git.fish.foo/attachments/3708e966-1d04-47d2-8084-0ee89715ec1e) ![image](https://git.fish.foo/attachments/e05f98bd-d9be-4e71-bf85-a09e85c0964f) </details>
pablomartin4btc (Migrated from github.com) commented 2024-03-28 22:44:00 +00:00

nit: extra space?

 #ifndef QT_STATIC
nit: extra space? ```suggestion #ifndef QT_STATIC ```
pablomartin4btc (Migrated from github.com) commented 2024-03-28 21:40:13 +00:00

nit: indentation

                optionsModel.setCustomDataDirArgs(customDataDir);

@johnny9, as we discussed on the latest weekly call, linter CI would be useful in cases like this too.

nit: indentation ```suggestion optionsModel.setCustomDataDirArgs(customDataDir); ``` @johnny9, as we discussed on the latest weekly call, linter CI would be useful in cases like this too.
D33r-Gee (Migrated from github.com) reviewed 2024-03-29 14:56:18 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-29 14:56:18 +00:00

good catch! Done

good catch! Done
D33r-Gee (Migrated from github.com) reviewed 2024-03-29 15:13:21 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-29 15:13:21 +00:00

good call! Done

good call! Done
MarnixCroes (Migrated from github.com) requested changes 2024-04-02 11:21:01 +00:00
MarnixCroes (Migrated from github.com) left a comment

double-clicking on Custom opens the storage selection in the background.
single-click works ok

openbackground.webm

649c2a5af8 you added qml-module-qtquick-dialogs, the other 3 qtdeclarative5-dev qtquickcontrols2-5-dev qml-module-qtquick-controls2 should be added to the instructions as well?

double-clicking on `Custom` opens the storage selection in the background. single-click works ok [openbackground.webm](https://github.com/bitcoin-core/gui-qml/assets/93143998/5d313a3b-760d-4df2-8c02-eeadefab9274) 649c2a5af80092e4f43497309aafe5785a2b2bdd you added `qml-module-qtquick-dialogs`, the other 3 `qtdeclarative5-dev` `qtquickcontrols2-5-dev` `qml-module-qtquick-controls2` should be added to the instructions as well?
D33r-Gee commented 2024-04-02 16:26:07 +00:00 (Migrated from github.com)

double-clicking on Custom opens the storage selection in the background. single-click works ok

Thanks @MarnixCroes, good catch... wasn't able to reproduce on WSL Ubuntu 22.04... Found a potential workaround by adding a timer, will implemented in a future PR since it's little out of scope for this one.

649c2a5 you added qml-module-qtquick-dialogs, the other 3 qtdeclarative5-dev qtquickcontrols2-5-dev qml-module-qtquick-controls2 should be added to the instructions as well?

those are actually found here in the qml/README.md:
github.com/bitcoin-core/gui-qml@649c2a5af8/src/qml/README.md (L66)
and here:
github.com/bitcoin-core/gui-qml@649c2a5af8/src/qml/README.md (L73)

> double-clicking on `Custom` opens the storage selection in the background. single-click works ok Thanks @MarnixCroes, good catch... wasn't able to reproduce on WSL Ubuntu 22.04... Found a potential workaround by adding a timer, will implemented in a future PR since it's little out of scope for this one. > [649c2a5](https://github.com/bitcoin-core/gui-qml/commit/649c2a5af80092e4f43497309aafe5785a2b2bdd) you added `qml-module-qtquick-dialogs`, the other 3 `qtdeclarative5-dev` `qtquickcontrols2-5-dev` `qml-module-qtquick-controls2` should be added to the instructions as well? those are actually found here in the qml/README.md: https://github.com/bitcoin-core/gui-qml/blob/649c2a5af80092e4f43497309aafe5785a2b2bdd/src/qml/README.md?plain=1#L66 and here: https://github.com/bitcoin-core/gui-qml/blob/649c2a5af80092e4f43497309aafe5785a2b2bdd/src/qml/README.md?plain=1#L73
johnny9 (Migrated from github.com) approved these changes 2024-04-04 03:40:30 +00:00
johnny9 (Migrated from github.com) left a comment

ACK 649c2a5af8

Tested static mobile and desktop builds as well as dynamic linux builds and the FileDialog triggers properly with no QML errors.

ACK 649c2a5af80092e4f43497309aafe5785a2b2bdd Tested static mobile and desktop builds as well as dynamic linux builds and the FileDialog triggers properly with no QML errors.
pablomartin4btc (Migrated from github.com) approved these changes 2024-04-05 22:27:27 +00:00
pablomartin4btc (Migrated from github.com) left a comment

tACK 649c2a5af8

I've managed to reproduce the issue reported by @MarnixCroes, on Ubuntu 22.04 it takes a 3 or 4 attempts, but eventually, it occurs. Tried to fix it using visible: true/ false but couldn't solve it, it would require more investigation and could be done on a follow-up.

nits (not blockers):

  • Since this is UI only changes, I'd leave commit ffd5201754 out, it doesn't change anything in terms of user experience and if we find an issue there, we'd need to revert it (or fix it on top). So in StorageLocations.qml I'd comment the lines making those calls to the optionsModel adding another comment on top of each like "// TODO when model supports it" or similar.
  • I'd make the new custom datadir path selected from the file dialog visible in 2 places:
    • under the custom datadir field as it's shown in figma:

      image

    • somewhere in the "Storage settings" page but after onboarding process I think (this definitely as a follow-up) but this needs to be discussed with designers (#bitcoin-core-app channel on "Bitcoin Design" discord) because I don't see any reference in figma (unless I missed it)/ cc: @GBKS. It's important here to mention that would be good also to show here the -datadir passed as an argument to QT, which won't be persisted in Bitcoin-Qt-*.conf as the custom data dir, or even the default datadir if that's the case (eg on Ubuntu home/${user}/.bitcoin) so the user is aware at all times where the data is being taken/ saved at all times.

      Screenshot from 2024-04-05 16-51-25

tACK 649c2a5af80092e4f43497309aafe5785a2b2bdd I've managed to reproduce the [issue reported](https://github.com/bitcoin-core/gui-qml/pull/392#pullrequestreview-1973457090) by @MarnixCroes, on Ubuntu 22.04 it takes a 3 or 4 attempts, but eventually, it occurs. Tried to fix it using `visible: true`/ `false` but couldn't solve it, it would require more investigation and could be done on a follow-up. nits (not blockers): - Since this is UI only changes, I'd leave commit ffd5201754e3ebd32d384406de95261116e30f61 out, it doesn't change anything in terms of user experience and if we find an issue there, we'd need to revert it (or fix it on top). So in `StorageLocations.qml` I'd comment the lines making those calls to the `optionsModel` adding another comment on top of each like "`// TODO when model supports it`" or similar. - I'd make the new custom datadir path selected from the file dialog visible in 2 places: - under the custom datadir field as it's shown in [figma](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?type=design&node-id=7635-19847&mode=design&t=biKXVMD1wrMD6oth-0): ![image](https://git.fish.foo/attachments/a3e0a004-8404-4199-b4a2-bb8b9f01d8bd) - somewhere in the "Storage settings" page but after onboarding process I think (this definitely as a follow-up) but this needs to be discussed with designers (#bitcoin-core-app channel on "Bitcoin Design" discord) because I don't see any reference in figma (unless I missed it)/ cc: @GBKS. It's important here to mention that would be good also to show here the `-datadir` passed as an argument to QT, which won't be persisted in `Bitcoin-Qt-*.conf` as the custom data dir, or even the default datadir if that's the case (eg on Ubuntu `home/${user}/.bitcoin`) so the user is aware at all times where the data is being taken/ saved at all times. ![Screenshot from 2024-04-05 16-51-25](https://git.fish.foo/attachments/f0ef0f53-26ee-4b94-a907-07779c9fe9e8)
GBKS commented 2024-04-09 13:57:02 +00:00 (Migrated from github.com)

Already merged, but I just tested on Android and MacOS and the UI works fine. Nice work on this, sounds like file picking was quite the heavy lift to get done.

I agree with the UI proposals up there and will prep respective designs.

Already merged, but I just tested on Android and MacOS and the UI works fine. Nice work on this, sounds like file picking was quite the heavy lift to get done. I agree with the UI proposals up there and will prep respective designs.
GBKS commented 2024-04-11 07:40:34 +00:00 (Migrated from github.com)

I created a follow-up issue for the directory display in storage settings here. Would be great to get your input on the question I have in that issue.

I created a follow-up issue for the directory display in storage settings [here](https://github.com/BitcoinDesign/Bitcoin-Core-App/issues/102). Would be great to get your input on the question I have in that issue.
Sign in to join this conversation.
No description provided.