Introduce the BlockClock control #148

Closed
shaavan wants to merge 7 commits from 220806-the_block_clock into main AGit
shaavan commented 2022-08-09 12:29:21 +00:00 (Migrated from github.com)
  • This PR introduces the Block clock control and adds it to the stub.qml to display.
  • This PR implements the syncing state of the Block Clock.
  • The implementation follows the design guide and uses this prototype as the reference.

Screenshot:

Screenshot from 2022-08-09 17-43-03

Things to note for the current implementation:

Since this is the prototype for the Block clock, I focused on the implementation part and took some liberties with the nuances, which I would like to document here.

  1. The color values for the: Remaining time text and Background color of the block clock ring didn't match the exact color values in the Theme.qml file. So I have used the closet matching Theme.color values to avoid hardcoded values and maintain consistency between light and dark mode.
  2. Since there was no "yellow" color in the Theme.qml, I have used a hardcoded value for the progress indicator.
  3. I have used the "bitcoin app" icon instead of the Black and White bitcoin icon, as this required additions to the resources and would be best done in a separate PR.
  4. I have used static dots as the peer indicator. PR #127 introduces an implementation of the peer indicator and has a largely positive review. This PR could be updated with #127's implementation when that gets merged.
- This PR introduces the Block clock control and adds it to the stub.qml to display. - This PR implements the syncing state of the Block Clock. - The implementation follows the [design guide](https://bitcoincore.app/block-clock/) and uses [this](https://stupefied-jones-dd209f.netlify.app/) prototype as the reference. **Screenshot:** ![Screenshot from 2022-08-09 17-43-03](https://user-images.githubusercontent.com/85434418/183645698-460cce48-9fb2-43de-89e5-1309458a7833.png) Things to note for the current implementation: Since this is the prototype for the Block clock, I focused on the implementation part and took some liberties with the nuances, which I would like to document here. 1. The color values for the: **Remaining time** text and **Background color of the block clock ring** didn't match the exact color values in the Theme.qml file. So I have used the closet matching Theme.color values to avoid hardcoded values and maintain consistency between light and dark mode. 2. Since there was no "yellow" color in the Theme.qml, I have used a hardcoded value for the progress indicator. 3. I have used the "bitcoin app" icon instead of the Black and White bitcoin icon, as this required additions to the resources and would be best done in a separate PR. 4. I have used static dots as the peer indicator. PR #127 introduces an implementation of the peer indicator and has a largely positive review. This PR could be updated with #127's implementation when that gets merged.
jarolrod (Migrated from github.com) reviewed 2022-08-09 13:02:16 +00:00
jarolrod (Migrated from github.com) commented 2022-08-09 13:02:16 +00:00

this is a component. not a control

this is a component. not a control
jarolrod (Migrated from github.com) reviewed 2022-08-10 03:43:57 +00:00
jarolrod (Migrated from github.com) commented 2022-08-10 03:43:53 +00:00

instead of canvas, this should be the simpler ShapePath: https://doc.qt.io/qt-6/qml-qtquick-shapes-shapepath.html

instead of canvas, this should be the simpler ShapePath: https://doc.qt.io/qt-6/qml-qtquick-shapes-shapepath.html
shaavan (Migrated from github.com) reviewed 2022-08-13 13:25:19 +00:00
shaavan (Migrated from github.com) commented 2022-08-13 13:25:19 +00:00

The next update of my PR intends to make the BlockClock.qml file a purely abstract structure and introduce a component file that uses it to paint different states of the block clock as needed. So I think moving BlockClock.qml to components now would be a wasted effort.

Should you still think I shall move the BlockClock.qml to controls, or if there is a better approach for achieving the final BlockClock state, I would love to hear that.

The next update of my PR intends to make the `BlockClock.qml` file a purely abstract structure and introduce a component file that uses it to paint different states of the block clock as needed. So I think moving `BlockClock.qml` to components now would be a wasted effort. Should you still think I shall move the `BlockClock.qml` to controls, or if there is a better approach for achieving the final BlockClock state, I would love to hear that.
shaavan (Migrated from github.com) reviewed 2022-08-13 13:31:42 +00:00
shaavan (Migrated from github.com) commented 2022-08-13 13:31:42 +00:00

I looked through using the ShapePath to paint the BlockClock. However, using this would require us to introduce a new dependency, qml-module-qtquick-shapes for building the GUI.

So I think this suggestion needs further discussion before implementing it.

A friendly ping, @hebasto

What do you think about this suggestion?

I looked through using the ShapePath to paint the BlockClock. However, using this would require us to introduce a new dependency, `qml-module-qtquick-shapes` for building the GUI. So I think this suggestion needs further discussion before implementing it. A friendly ping, @hebasto What do you think about this suggestion?
promag (Migrated from github.com) reviewed 2022-09-08 21:30:35 +00:00
promag (Migrated from github.com) commented 2022-09-08 21:30:35 +00:00

Unfortunately, from my experiments, ShapePath and related items have issues. The most annoying issue happens with small curves where tessellation yields bad curve smoothness. Another issue is that with complex drawings you end up with lots of items and bindings everywhere (especially with Repeaters), which is also not that performant.

Going forward a stack/composition of Canvas is the best option, like photoshop layers. For instance, the Canvas on the bottom could be static or updated less often than the one on the top.

Unfortunately, from my experiments, `ShapePath` and related items have issues. The most annoying issue happens with small curves where tessellation yields bad curve smoothness. Another issue is that with complex drawings you end up with lots of items and bindings everywhere (especially with Repeaters), which is also not that performant. Going forward a stack/composition of Canvas is the best option, like photoshop layers. For instance, the Canvas on the bottom could be static or updated less often than the one on the top.
shaavan (Migrated from github.com) reviewed 2022-09-12 11:05:07 +00:00
shaavan (Migrated from github.com) commented 2022-09-12 11:05:07 +00:00

Thanks, @promag, for sharing your thoughts and suggestion for using Canvas.

For instance, the Canvas on the bottom could be static or updated less often than the one on the top.

I think this would be good optimization. However, I might be putting a temporary hold on this optimization suggestion for now, as I am currently getting the Block Clock to display the block tracker, which involves some significant changes to the Canvas as well. So I shall be taking up this suggestion along with the other suggestion that shall come forth with the updated branch.

Thanks, @promag, for sharing your thoughts and suggestion for using Canvas. > For instance, the Canvas on the bottom could be static or updated less often than the one on the top. I think this would be good optimization. However, I might be putting a temporary hold on this optimization suggestion for now, as I am currently getting the Block Clock to display the [block tracker](https://user-images.githubusercontent.com/85434418/189637900-836b2171-c136-4115-9640-ee9482e7bef9.png), which involves some significant changes to the Canvas as well. So I shall be taking up this suggestion along with the other suggestion that shall come forth with the updated branch.
shaavan commented 2022-09-27 16:22:52 +00:00 (Migrated from github.com)

Updated from 96311e31aff4361055dcfe3fa38920aed3d3b525 to 055e0c08c9dc2a34e8bdba34430d6d1ce25a2376 (pr148.01 -> pr148.02)

Changes:

  • Introduces BlockClockComponent to change the displayed block clock states as needed.
  • Introduces another state of the Block clock: The block tracker.

Screenshot:
image

Note:
Currently, the time tracking is happening according to GMT and doesn't update with the locale. I am going to address this with the next update.
The main focus of this update is to get a general review of the approach I have taken for implementation.

Updated from 96311e31aff4361055dcfe3fa38920aed3d3b525 to 055e0c08c9dc2a34e8bdba34430d6d1ce25a2376 ([pr148.01](https://github.com/shaavan/gui-qml/commits/pr148.01) -> [pr148.02](https://github.com/shaavan/gui-qml/commits/pr148.02)) **Changes:** - Introduces BlockClockComponent to change the displayed block clock states as needed. - Introduces another state of the Block clock: The block tracker. **Screenshot:** ![image](https://user-images.githubusercontent.com/85434418/192579361-a999d87a-3d36-4aad-893c-2be75fda7f68.png) **Note:** Currently, the time tracking is happening according to GMT and doesn't update with the locale. I am going to address this with the next update. The main focus of this update is to get a general review of the approach I have taken for implementation.
jarolrod (Migrated from github.com) reviewed 2022-09-27 16:42:27 +00:00
jarolrod (Migrated from github.com) left a comment

Branch doesn't build

Branch doesn't build
jarolrod (Migrated from github.com) commented 2022-09-27 16:37:55 +00:00

This is the implementation of the block clock, and the file residing at src/qml/components/BlockClockComponent.qml is just a controller for this. A better architecture is to have a controller that loads the different states the block clock can be in.

You'd be able to split up this file, as it is very long, between a simple circular progress bar that shows the verification progress while in IBD, then another dial like progress bar for the blocks. Then load these into the controller.

This is the implementation of the block clock, and the file residing at `src/qml/components/BlockClockComponent.qml` is just a controller for this. A better architecture is to have a controller that loads the different states the block clock can be in. You'd be able to split up this file, as it is very long, between a simple circular progress bar that shows the verification progress while in IBD, then another dial like progress bar for the blocks. Then load these into the controller.
jarolrod (Migrated from github.com) commented 2022-09-27 16:38:59 +00:00

isn't this recreating our header component?

isn't this recreating our header component?
jarolrod (Migrated from github.com) commented 2022-09-27 16:40:02 +00:00

Yeah this is definitely too low level for us to be passing around here

Yeah this is definitely too low level for us to be passing around here
jarolrod (Migrated from github.com) commented 2022-09-27 16:29:34 +00:00

this is too low level of an object to be handling here when we have interfaces::chain

this is too low level of an object to be handling here when we have `interfaces::chain`
jarolrod (Migrated from github.com) commented 2022-09-27 16:31:43 +00:00

why should the nodemodel, a proxy class for our internal node, keep something like a blocklist?

why should the nodemodel, a proxy class for our internal node, keep something like a blocklist?
shaavan commented 2022-09-28 13:50:31 +00:00 (Migrated from github.com)

Updated from 621eae1074365116d5bfd5e58eff2696eaf6a846 to 1f134fdb3bcc29213b55658a69d1d8bf72079554 (pr148.02 -> pr148.03, diff)
Addressed @jarolrod comment

Update:

  • Made changes to fix the problem of the branch not building. Thanks, @jarolrod, for bringing that to notice and helping figure out the root of the problem.
Updated from 621eae1074365116d5bfd5e58eff2696eaf6a846 to 1f134fdb3bcc29213b55658a69d1d8bf72079554 ([pr148.02](https://github.com/shaavan/gui-qml/commits/pr148.02) -> [pr148.03](https://github.com/shaavan/gui-qml/commits/pr148.03), [diff](https://github.com/shaavan/gui-qml/compare/pr148.02..pr148.03)) Addressed @jarolrod comment Update: - Made changes to fix the problem of the branch not building. Thanks, @jarolrod, for bringing that to notice and helping figure out the root of the problem.
shaavan (Migrated from github.com) reviewed 2022-09-28 13:53:35 +00:00
shaavan (Migrated from github.com) commented 2022-09-28 13:53:35 +00:00

Let me take a look into replacing this low-level object handling with interfaces::chain

Let me take a look into replacing this low-level object handling with interfaces::chain
shaavan (Migrated from github.com) reviewed 2022-09-28 13:55:09 +00:00
shaavan (Migrated from github.com) commented 2022-09-28 13:55:09 +00:00

Considering your previous suggestion about using the interfaces::chain, I think I can create a separate .cpp file handling chain-related parameters such as blockTimeList

Considering your previous suggestion about using the `interfaces::chain`, I think I can create a separate .cpp file handling chain-related parameters such as blockTimeList
shaavan (Migrated from github.com) reviewed 2022-09-28 13:59:52 +00:00
shaavan (Migrated from github.com) commented 2022-09-28 13:59:52 +00:00

Let me try rephrasing your suggestion to ensure I understood it correctly.
You suggest I create a separate component file for each block clock state, create a controller file in qml/control, and switch to loading different block clock component files based on the requirement.

Have I understood it correctly?

Let me try rephrasing your suggestion to ensure I understood it correctly. You suggest I create a separate `component` file for each block clock state, create a controller file in `qml/control`, and switch to loading different block clock component files based on the requirement. Have I understood it correctly?
shaavan (Migrated from github.com) reviewed 2022-09-28 14:01:30 +00:00
shaavan (Migrated from github.com) commented 2022-09-28 14:01:30 +00:00

Yes, it is. Thanks for pointing that out. I shall fix this with the next update of the PR.

Yes, it is. Thanks for pointing that out. I shall fix this with the next update of the PR.
shaavan (Migrated from github.com) reviewed 2022-09-28 14:03:28 +00:00
shaavan (Migrated from github.com) commented 2022-09-28 14:03:28 +00:00

Let me experiment with interfaces::chain and devise an approach that avoids low-level object handling.

Let me experiment with `interfaces::chain` and devise an approach that avoids low-level object handling.
shaavan commented 2022-11-28 17:25:18 +00:00 (Migrated from github.com)

Updated from 23f8a833b57bbdad3177ff23751ec0cdfb8d5b09 to 621eae1074365116d5bfd5e58eff2696eaf6a846 (pr148.03 -> pr148.04)

Changes:

  • Introduced a new chainmodel class to use the interfaces::chain and directly use the chain info without going too low level in the code.
  • The new Block Clock displays the timezone-dependent block time data.
  • Added property to Header.qml so it can be used directly in the BlockClock.qml file.

Here is the demo of the latest iteration of the block clock:

https://user-images.githubusercontent.com/85434418/204341167-fe8cb5a4-7189-4cbd-b2f8-1db93be3cf3d.mov

Updated from 23f8a833b57bbdad3177ff23751ec0cdfb8d5b09 to 621eae1074365116d5bfd5e58eff2696eaf6a846 ([pr148.03](https://github.com/shaavan/gui-qml/commits/pr148.03) -> [pr148.04](https://github.com/shaavan/gui-qml/commits/pr148.04)) Changes: - Introduced a new chainmodel class to use the interfaces::chain and directly use the chain info without going too low level in the code. - The new Block Clock displays the timezone-dependent block time data. - Added property to Header.qml so it can be used directly in the BlockClock.qml file. Here is the demo of the latest iteration of the block clock: https://user-images.githubusercontent.com/85434418/204341167-fe8cb5a4-7189-4cbd-b2f8-1db93be3cf3d.mov
shaavan commented 2022-12-12 14:37:54 +00:00 (Migrated from github.com)

Updated from 621eae1074365116d5bfd5e58eff2696eaf6a846 to 2a5e9983bebab10ce7be79eebdaf6104a992ca32 (pr148.04 -> pr148.05)

Changes:

  1. Rebased over main.
  2. Added the Connecting and Paused state for the block clock.
  3. Integrated the first three commits of #127. This allows the PeerIndicator dots to be animated and correctly show the peer connection state.

Demo:

https://user-images.githubusercontent.com/85434418/207072355-c7371de4-fdd5-4dbe-bfee-db74e9a61818.mov

Updated from 621eae1074365116d5bfd5e58eff2696eaf6a846 to 2a5e9983bebab10ce7be79eebdaf6104a992ca32 ([pr148.04](https://github.com/shaavan/gui-qml/commits/pr148.04) -> [pr148.05](https://github.com/shaavan/gui-qml/commits/pr148.05)) Changes: 1. Rebased over main. 2. Added the **Connecting** and **Paused** state for the block clock. 3. Integrated the first three commits of #127. This allows the PeerIndicator dots to be animated and correctly show the peer connection state. **Demo:** https://user-images.githubusercontent.com/85434418/207072355-c7371de4-fdd5-4dbe-bfee-db74e9a61818.mov
GBKS commented 2022-12-13 09:26:22 +00:00 (Migrated from github.com)

Thanks for the updates. It looks like the artifacts are not building due a lint issue (the Android build is only 22 bytes). Could you please address this? I'd love to get hands-on with this update.

Thanks for the updates. It looks like the artifacts are not building due a lint issue (the Android build is only 22 bytes). Could you please address this? I'd love to get hands-on with this update.
hebasto (Migrated from github.com) reviewed 2022-12-13 11:20:56 +00:00
hebasto (Migrated from github.com) left a comment

To fix the lint task, suggesting the patch as follows:

diff --git a/src/qml/chainmodel.h b/src/qml/chainmodel.h
index 9ab25f35c..2943c9c16 100644
--- a/src/qml/chainmodel.h
+++ b/src/qml/chainmodel.h
@@ -2,8 +2,8 @@
 // Distributed under the MIT software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
-#ifndef BITCOIN_QML_CHAIN_MODEL_H
-#define BITCOIN_QML_CHAIN_MODEL_H
+#ifndef BITCOIN_QML_CHAINMODEL_H
+#define BITCOIN_QML_CHAINMODEL_H
 
 #include <interfaces/chain.h>
 
@@ -47,4 +47,4 @@ private:
     interfaces::Chain& m_chain;
 };
 
-#endif // BITCOIN_QML_CHAIN_MODEL_H
\ No newline at end of file
+#endif // BITCOIN_QML_CHAINMODEL_H
To fix the lint task, suggesting the patch as follows: ```diff diff --git a/src/qml/chainmodel.h b/src/qml/chainmodel.h index 9ab25f35c..2943c9c16 100644 --- a/src/qml/chainmodel.h +++ b/src/qml/chainmodel.h @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_QML_CHAIN_MODEL_H -#define BITCOIN_QML_CHAIN_MODEL_H +#ifndef BITCOIN_QML_CHAINMODEL_H +#define BITCOIN_QML_CHAINMODEL_H #include <interfaces/chain.h> @@ -47,4 +47,4 @@ private: interfaces::Chain& m_chain; }; -#endif // BITCOIN_QML_CHAIN_MODEL_H \ No newline at end of file +#endif // BITCOIN_QML_CHAINMODEL_H ```
hebasto (Migrated from github.com) commented 2022-12-13 11:20:50 +00:00

Why is this file required?

Why is this file required?
jarolrod (Migrated from github.com) reviewed 2022-12-14 09:49:07 +00:00
jarolrod (Migrated from github.com) commented 2022-12-14 09:48:59 +00:00

This should be using the bitcoin circle icon introduced in https://github.com/bitcoin-core/gui-qml/pull/176. That's what is specified in the design files

This should be using the bitcoin circle icon introduced in https://github.com/bitcoin-core/gui-qml/pull/176. That's what is specified in the [design files](https://www.figma.com/file/GaCoOSNHB2yMB9ThiDtred/Bitcoin-Core-App?node-id=3259%3A73676&t=pjV9bY1q9KckaP4Q-0)
jarolrod (Migrated from github.com) reviewed 2022-12-14 09:52:13 +00:00
jarolrod (Migrated from github.com) commented 2022-12-14 09:52:13 +00:00

When running this branch, I see the following in my terminal:

QObject::moveToThread: Cannot move objects with a parent
When running this branch, I see the following in my terminal: ``` QObject::moveToThread: Cannot move objects with a parent ```
shaavan commented 2022-12-15 19:01:06 +00:00 (Migrated from github.com)

Updated from 2a5e9983bebab10ce7be79eebdaf6104a992ca32 to 0f5461eef14e3ac0739d9b3e3448dd78c94ebff7 (pr148.05 -> pr148.06)

Addressed @hebasto @jarolrod @GBKS comments.

Changes:

  1. Switch the Bitcoin app icon for the Bitcoin-circle icon.
  2. Fixed QObject::moveToThread: Cannot move objects with a parent warning.
  3. Correction Font size and margins according to design docs.
  4. Removed .vscode/settings.json file.
  5. Applied the patch suggested by @hebasto to fix the lint warning.

Screenshots:

pr148.05 pr148.06
Screenshot 2022-12-15 at 11 51 04 PM Screenshot 2022-12-15 at 11 48 44 PM
Screenshot 2022-12-15 at 11 52 02 PM Screenshot 2022-12-15 at 11 49 19 PM
Screenshot 2022-12-15 at 11 51 32 PM Screenshot 2022-12-15 at 11 49 51 PM
Screenshot 2022-12-15 at 11 51 30 PM Screenshot 2022-12-15 at 11 49 43 PM
Updated from 2a5e9983bebab10ce7be79eebdaf6104a992ca32 to 0f5461eef14e3ac0739d9b3e3448dd78c94ebff7 ([pr148.05](https://github.com/shaavan/gui-qml/commits/pr148.05) -> [pr148.06](https://github.com/shaavan/gui-qml/commits/pr148.06)) Addressed @hebasto @jarolrod @GBKS comments. Changes: 1. Switch the Bitcoin app icon for the Bitcoin-circle icon. 2. Fixed `QObject::moveToThread: Cannot move objects with a parent` warning. 3. Correction Font size and margins according to [design docs](https://www.figma.com/file/ek8w3n3upbluw5UL2lGhRx/Bitcoin-Core-App-Design?node-id=616%3A0&t=poh7bpeInsyETLvD-0). 4. Removed .vscode/settings.json file. 5. Applied the patch suggested by @hebasto to fix the lint warning. **Screenshots:** |pr148.05|pr148.06| |---------|---------| |<img width="340" alt="Screenshot 2022-12-15 at 11 51 04 PM" src="https://user-images.githubusercontent.com/85434418/207944317-16fa188c-2874-473f-8388-c368771eaf87.png">|<img width="340" alt="Screenshot 2022-12-15 at 11 48 44 PM" src="https://user-images.githubusercontent.com/85434418/207944388-604e628d-2c75-4651-9d7d-c6a57e099947.png">| |<img width="340" alt="Screenshot 2022-12-15 at 11 52 02 PM" src="https://user-images.githubusercontent.com/85434418/207944464-ad1469a8-e3d1-4eca-ac27-dc601e9e0b23.png">|<img width="340" alt="Screenshot 2022-12-15 at 11 49 19 PM" src="https://user-images.githubusercontent.com/85434418/207944492-aedc46b3-d08c-4792-9a18-d159675c380c.png">| |<img width="340" alt="Screenshot 2022-12-15 at 11 51 32 PM" src="https://user-images.githubusercontent.com/85434418/207944572-848af8c6-cc8b-4fec-ba30-daf39941bbd3.png">|<img width="340" alt="Screenshot 2022-12-15 at 11 49 51 PM" src="https://user-images.githubusercontent.com/85434418/207944608-7cb2eaff-cdd6-441b-a2f6-8e3b1c1a7488.png">| |<img width="340" alt="Screenshot 2022-12-15 at 11 51 30 PM" src="https://user-images.githubusercontent.com/85434418/207944670-f2dda596-aa9e-4a2f-a79a-86b6a4407c2d.png">|<img width="340" alt="Screenshot 2022-12-15 at 11 49 43 PM" src="https://user-images.githubusercontent.com/85434418/207944700-c3cb3bd5-2a0e-4d08-9980-56e6b9dd983c.png">|
shaavan (Migrated from github.com) reviewed 2022-12-15 19:02:20 +00:00
shaavan (Migrated from github.com) commented 2022-12-15 19:02:20 +00:00

The file has been removed in 0f5461e

The file has been removed in 0f5461e
shaavan (Migrated from github.com) reviewed 2022-12-15 19:02:38 +00:00
shaavan (Migrated from github.com) commented 2022-12-15 19:02:38 +00:00

Fixed in 0f5461e

Fixed in 0f5461e
shaavan (Migrated from github.com) reviewed 2022-12-15 19:02:54 +00:00
shaavan (Migrated from github.com) commented 2022-12-15 19:02:54 +00:00

Addressed in 0f5461e.

Addressed in 0f5461e.
shaavan commented 2022-12-15 19:20:24 +00:00 (Migrated from github.com)

Updated from 0f5461eef14e3ac0739d9b3e3448dd78c94ebff7 to 0fbe6c809eadabde0ca4c6f443dea60feae3fb34 (pr148.06 -> pr148.07)

  • Rebased the branch over the main.
Updated from 0f5461eef14e3ac0739d9b3e3448dd78c94ebff7 to 0fbe6c809eadabde0ca4c6f443dea60feae3fb34 ([pr148.06](https://github.com/shaavan/gui-qml/commits/pr148.06) -> [pr148.07](https://github.com/shaavan/gui-qml/commits/pr148.07)) - Rebased the branch over the main.
shaavan commented 2022-12-15 19:28:13 +00:00 (Migrated from github.com)

Updated from 0fbe6c8 to 29f019e

  • Fixed the trailing whitespace lint failure.
Updated from [0fbe6c8 ](https://github.com/bitcoin-core/gui-qml/commit/0fbe6c809eadabde0ca4c6f443dea60feae3fb34)to [29f019e](https://github.com/bitcoin-core/gui-qml/commit/29f019e4a5278a4e7b5aaf56a49bee309bcc4d2a) - Fixed the trailing whitespace lint failure.
shaavan commented 2022-12-18 13:22:11 +00:00 (Migrated from github.com)

Updated from 29f019e4a5278a4e7b5aaf56a49bee309bcc4d2a to 8173bf6838997dce6dc6e908a54801fdcb5e0ad8 (pr148.08 -> pr148.09)

  • Moved the simplified block_clock changes from #212 to this PR to preserve the comment history for the block_clock and prevent splitting of discussion in two separate PRs.

Differences as explained in #212 Description:

  1. The PeersIndicator has been replaced with plain rectangles to keep the UI intact.
  2. The conns property representing if the number of connections is greater than 0, has been set to always positive. With this > change, the "connecting" page, though implemented, becomes inaccessible through the UI.
Updated from 29f019e4a5278a4e7b5aaf56a49bee309bcc4d2a to 8173bf6838997dce6dc6e908a54801fdcb5e0ad8 ([pr148.08](https://github.com/shaavan/gui-qml/commits/pr148.08) -> [pr148.09](https://github.com/shaavan/gui-qml/commits/pr148.09)) - Moved the simplified block_clock changes from #212 to this PR to preserve the comment history for the block_clock and prevent splitting of discussion in two separate PRs. Differences as explained in #212 Description: > 1. The PeersIndicator has been replaced with plain rectangles to keep the UI intact. > 2. The conns property representing if the number of connections is greater than 0, has been set to always positive. With this > change, the "connecting" page, though implemented, becomes inaccessible through the UI.
johnny9 (Migrated from github.com) requested changes 2022-12-18 14:42:08 +00:00
johnny9 (Migrated from github.com) left a comment

Views look nice and render correctly. Tested pause/unpause as well as a full sync on signet at got the following results.

Screenshot_2022-12-16_22-18-31 Screenshot_2022-12-16_22-19-02 Screenshot_2022-12-16_22-25-01 Screenshot_2022-12-16_22-26-42 Screenshot_2022-12-16_22-28-51

A few QML errors when running that need to be resolved before merging. I've left comments for those errors at the corresponding line numbers.

tail -f debug.log | grep GUI to watch for issues when running bitcoin-qt.

Views look nice and render correctly. Tested pause/unpause as well as a full sync on signet at got the following results. |![Screenshot_2022-12-16_22-18-31](https://user-images.githubusercontent.com/985648/208221768-bbf55e20-d529-4472-94cd-a7115f71270e.png)|![Screenshot_2022-12-16_22-19-02](https://user-images.githubusercontent.com/985648/208221777-46e59c67-fe80-4d5d-9877-8a247f069b78.png)|![Screenshot_2022-12-16_22-25-01](https://user-images.githubusercontent.com/985648/208221788-9deabdf1-389a-4a61-b264-fbabf8a28d2c.png)|![Screenshot_2022-12-16_22-26-42](https://user-images.githubusercontent.com/985648/208221794-9d770b93-b6e1-4f81-b835-a4223844d6f0.png)|![Screenshot_2022-12-16_22-28-51](https://user-images.githubusercontent.com/985648/208221797-4ebe4269-c89a-4301-9f15-ab5dc71f1f93.png)| |---|---|---|---|---| A few QML errors when running that need to be resolved before merging. I've left comments for those errors at the corresponding line numbers. `tail -f debug.log | grep GUI` to watch for issues when running bitcoin-qt.
johnny9 (Migrated from github.com) commented 2022-12-18 14:39:56 +00:00

"No newline at end of file"

"No newline at end of file"
johnny9 (Migrated from github.com) commented 2022-12-18 14:39:39 +00:00

"No newline at end of file"

"No newline at end of file"
johnny9 (Migrated from github.com) commented 2022-12-18 14:37:28 +00:00

QML error appears when shutting down.

2022-12-17T03:52:37Z Shutdown: In progress...
2022-12-17T03:52:37Z torcontrol thread exit
2022-12-17T03:52:37Z addcon thread exit
2022-12-17T03:52:37Z msghand thread exit
2022-12-17T03:52:37Z net thread exit
2022-12-17T03:52:39Z opencon thread exit
2022-12-17T03:52:39Z DumpAnchors: Flush 0 outbound block-relay-only peer addresses to anchors.dat started
2022-12-17T03:52:39Z DumpAnchors: Flush 0 outbound block-relay-only peer addresses to anchors.dat completed (0.01s)
2022-12-17T03:52:39Z scheduler thread exit
2022-12-17T03:52:39Z Writing 0 unbroadcast transactions to disk.
2022-12-17T03:52:39Z Dumped mempool: 3.7e-06s to copy, 0.00448635s to dump
2022-12-17T03:52:39Z Shutdown: done
2022-12-17T03:52:39Z GUI: qrc:/qml/components/BlockClockComponent.qml:34: TypeError: Cannot read property 'timeRatioList' of null
QML error appears when shutting down. ``` 2022-12-17T03:52:37Z Shutdown: In progress... 2022-12-17T03:52:37Z torcontrol thread exit 2022-12-17T03:52:37Z addcon thread exit 2022-12-17T03:52:37Z msghand thread exit 2022-12-17T03:52:37Z net thread exit 2022-12-17T03:52:39Z opencon thread exit 2022-12-17T03:52:39Z DumpAnchors: Flush 0 outbound block-relay-only peer addresses to anchors.dat started 2022-12-17T03:52:39Z DumpAnchors: Flush 0 outbound block-relay-only peer addresses to anchors.dat completed (0.01s) 2022-12-17T03:52:39Z scheduler thread exit 2022-12-17T03:52:39Z Writing 0 unbroadcast transactions to disk. 2022-12-17T03:52:39Z Dumped mempool: 3.7e-06s to copy, 0.00448635s to dump 2022-12-17T03:52:39Z Shutdown: done 2022-12-17T03:52:39Z GUI: qrc:/qml/components/BlockClockComponent.qml:34: TypeError: Cannot read property 'timeRatioList' of null ```
johnny9 (Migrated from github.com) commented 2022-12-18 14:38:01 +00:00

The following error appears when going into the paused state.

2022-12-17T03:50:17Z GUI: qrc:/qml/controls/BlockClock.qml:96: TypeError: Value is undefined and could not be converted to an object
The following error appears when going into the paused state. ``` 2022-12-17T03:50:17Z GUI: qrc:/qml/controls/BlockClock.qml:96: TypeError: Value is undefined and could not be converted to an object ```
johnny9 (Migrated from github.com) commented 2022-12-18 14:38:32 +00:00

Small style comment, operators should have space before/after for easier readability.

Small style comment, operators should have space before/after for easier readability.
johnny9 (Migrated from github.com) commented 2022-12-18 14:39:11 +00:00
GUI: qrc:/qml/pages/node/NodeRunner.qml:24:9: QML BlockClockComponent: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.

Should be able to remove the ColumnLayout containing the BlockClockComponent and just define the BlockClockComponent as the content to this Page. When you do this, also remove the anchors.fill: parent and spacing: 0 in this file.

``` GUI: qrc:/qml/pages/node/NodeRunner.qml:24:9: QML BlockClockComponent: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead. ``` Should be able to remove the ColumnLayout containing the BlockClockComponent and just define the BlockClockComponent as the content to this Page. When you do this, also remove the `anchors.fill: parent` and `spacing: 0` in this file.
shaavan commented 2022-12-18 15:44:35 +00:00 (Migrated from github.com)

Updated from 8173bf6838997dce6dc6e908a54801fdcb5e0ad8 to bcbc80b6666e43aa07ee46e09289b4a34f3fa30b (pr148.09 -> pr148.10)

Addressed @johnny9 comments.

Changes:

  1. Fixed Type Errors as pointed out in this comment.
  2. Added space before and after operator in BlockClock.qml
  3. Added a new line at the end of the file in chainmodel.cpp and chainmodel.h.
  4. Removed the redundant ColumnLayout in Noderunner.qml.
Updated from 8173bf6838997dce6dc6e908a54801fdcb5e0ad8 to bcbc80b6666e43aa07ee46e09289b4a34f3fa30b ([pr148.09](https://github.com/shaavan/gui-qml/commits/pr148.09) -> [pr148.10](https://github.com/shaavan/gui-qml/commits/pr148.10)) Addressed @johnny9 comments. Changes: 1. Fixed Type Errors as pointed out in [this](https://github.com/bitcoin-core/gui-qml/pull/148#pullrequestreview-1222038049) comment. 2. Added space before and after operator in BlockClock.qml 3. Added a new line at the end of the file in chainmodel.cpp and chainmodel.h. 4. Removed the redundant ColumnLayout in Noderunner.qml.
hebasto commented 2022-12-19 11:50:30 +00:00 (Migrated from github.com)

The CI lint task error:

fatal: Invalid revision range fd4e57f63654e2d8e7d0de0aafc335715a53a5cc..c4e1ce262ffb5e6956a7b912f2dcf7560823682e

looks a bit weird as I failed to find a branch the c4e1ce262ffb5e6956a7b912f2dcf7560823682e commit belongs to.

I hope rebasing will help.

@shaavan And please make sure your local branch does not contain any merge commits.

The CI lint task error: ``` fatal: Invalid revision range fd4e57f63654e2d8e7d0de0aafc335715a53a5cc..c4e1ce262ffb5e6956a7b912f2dcf7560823682e ``` looks a bit weird as I failed to find a branch the c4e1ce262ffb5e6956a7b912f2dcf7560823682e commit belongs to. I hope rebasing will help. @shaavan And please make sure your local branch does not contain any merge commits.
shaavan commented 2022-12-19 13:01:50 +00:00 (Migrated from github.com)

Updated from bcbc80b6666e43aa07ee46e09289b4a34f3fa30b to 68fa33b202e528ff0eae839f7163be8a7f939392 (pr148.10 -> pr148.11)

  • Rebased PR over current main.
Updated from bcbc80b6666e43aa07ee46e09289b4a34f3fa30b to 68fa33b202e528ff0eae839f7163be8a7f939392 ([pr148.10](https://github.com/shaavan/gui-qml/commits/pr148.10) -> [pr148.11](https://github.com/shaavan/gui-qml/commits/pr148.11)) - Rebased PR over current main.
johnny9 (Migrated from github.com) requested changes 2022-12-19 23:21:14 +00:00
johnny9 (Migrated from github.com) left a comment

QML error when going into the paused state still exists. Other issues are resolved.

QML error when going into the paused state still exists. Other issues are resolved.
johnny9 (Migrated from github.com) commented 2022-12-19 23:20:44 +00:00

Still getting 2022-12-19T23:10:24Z GUI: qrc:/qml/controls/BlockClock.qml:95: TypeError: Value is undefined and could not be converted to an object when going to the paused state. i think doing if (parent.blockList) { should resolve it.

Still getting `2022-12-19T23:10:24Z GUI: qrc:/qml/controls/BlockClock.qml:95: TypeError: Value is undefined and could not be converted to an object` when going to the paused state. i think doing `if (parent.blockList) {` should resolve it.
shaavan commented 2022-12-20 12:49:35 +00:00 (Migrated from github.com)

Updated from 68fa33b202e528ff0eae839f7163be8a7f939392 to 20b4ed55f1b9417fa0a1457736be1b6c1c54f1dd (pr148.11 -> pr148.12, diff)

Addressed @johnny9 comment.

  • Fixed TypeError: Value is undefined and could not be converted to an object error.

  • Also addressed one formatting issue, present in displaying Block Counter.

Explaination:

For example, for the block count of 122010, difference:

pr148.11 pr148.12
Screenshot 2022-12-20 at 5 54 00 PM Screenshot 2022-12-20 at 6 16 46 PM
Updated from 68fa33b202e528ff0eae839f7163be8a7f939392 to 20b4ed55f1b9417fa0a1457736be1b6c1c54f1dd ([pr148.11](https://github.com/shaavan/gui-qml/commits/pr148.11) -> [pr148.12](https://github.com/shaavan/gui-qml/commits/pr148.12), [diff](https://github.com/shaavan/gui-qml/compare/pr148.11..pr148.12)) Addressed @johnny9 comment. - Fixed `TypeError: Value is undefined and could not be converted to an object` error. - Also addressed one formatting issue, present in displaying Block Counter. **Explaination:** For example, for the block count of **122010**, difference: |pr148.11|pr148.12| |--------|---------| |<img width="340" alt="Screenshot 2022-12-20 at 5 54 00 PM" src="https://user-images.githubusercontent.com/85434418/208671008-09b955f0-fbf2-434d-8cbe-11f12acbb3cc.png">|<img width="340" alt="Screenshot 2022-12-20 at 6 16 46 PM" src="https://user-images.githubusercontent.com/85434418/208671046-71fe0d9c-0b9d-4856-9ec0-b9059059fb76.png">|
shaavan commented 2022-12-20 13:04:14 +00:00 (Migrated from github.com)

Updated from 20b4ed55f1b9417fa0a1457736be1b6c1c54f1dd to abb0bef2460b4ba98cf02758dedd052efe4ec722 (pr148.12 -> pr148.13, diff)

  • Modified timeRatioList so that blockClock start displaying from the "0" point.

Screenshot:

pr148.12 pr148.13
Screenshot 2022-12-20 at 6 28 41 PM Screenshot 2022-12-20 at 6 27 57 PM
Updated from 20b4ed55f1b9417fa0a1457736be1b6c1c54f1dd to abb0bef2460b4ba98cf02758dedd052efe4ec722 ([pr148.12](https://github.com/shaavan/gui-qml/commits/pr148.12) -> [pr148.13](https://github.com/shaavan/gui-qml/commits/pr148.13), [diff](https://github.com/shaavan/gui-qml/compare/pr148.12..pr148.13)) - Modified `timeRatioList` so that blockClock start displaying from the "0" point. **Screenshot:** |pr148.12|pr148.13| |--------|---------| |<img width="340" alt="Screenshot 2022-12-20 at 6 28 41 PM" src="https://user-images.githubusercontent.com/85434418/208673687-faf8bb69-e717-4cf0-bb8a-b545a5fbb721.png">|<img width="340" alt="Screenshot 2022-12-20 at 6 27 57 PM" src="https://user-images.githubusercontent.com/85434418/208673800-de9da7c2-2836-478d-88db-38ba85e640e9.png">|
shaavan (Migrated from github.com) reviewed 2022-12-20 13:06:48 +00:00
shaavan (Migrated from github.com) commented 2022-12-20 13:06:48 +00:00

Addressed in bcbc80b6666e43aa07ee46e09289b4a34f3fa30b.

Addressed in bcbc80b6666e43aa07ee46e09289b4a34f3fa30b.
shaavan (Migrated from github.com) reviewed 2022-12-20 13:06:59 +00:00
shaavan (Migrated from github.com) commented 2022-12-20 13:06:59 +00:00

Addressed in bcbc80b6666e43aa07ee46e09289b4a34f3fa30b

Addressed in bcbc80b6666e43aa07ee46e09289b4a34f3fa30b
shaavan (Migrated from github.com) reviewed 2022-12-20 13:07:09 +00:00
shaavan (Migrated from github.com) commented 2022-12-20 13:07:09 +00:00

Addressed in bcbc80b6666e43aa07ee46e09289b4a34f3fa30b

Addressed in bcbc80b6666e43aa07ee46e09289b4a34f3fa30b
shaavan (Migrated from github.com) reviewed 2022-12-20 13:07:25 +00:00
shaavan (Migrated from github.com) commented 2022-12-20 13:07:25 +00:00

Addressed in bcbc80b6666e43aa07ee46e09289b4a34f3fa30b

Addressed in bcbc80b6666e43aa07ee46e09289b4a34f3fa30b
shaavan (Migrated from github.com) reviewed 2022-12-20 13:08:10 +00:00
shaavan (Migrated from github.com) commented 2022-12-20 13:08:10 +00:00

Addressed in 20b4ed55f1b9417fa0a1457736be1b6c1c54f1dd

Addressed in 20b4ed55f1b9417fa0a1457736be1b6c1c54f1dd
shaavan (Migrated from github.com) reviewed 2022-12-20 13:08:54 +00:00
shaavan (Migrated from github.com) commented 2022-12-20 13:08:54 +00:00

Addressed in 20b4ed55f1b9417fa0a1457736be1b6c1c54f1dd

Thanks for all of your reviews!

Addressed in 20b4ed55f1b9417fa0a1457736be1b6c1c54f1dd Thanks for all of your reviews!
johnny9 (Migrated from github.com) reviewed 2022-12-20 17:11:32 +00:00
johnny9 (Migrated from github.com) left a comment

Good work on this Shashwat. All of the QML errors appear to be resolved now. Views render as expected

Good work on this Shashwat. All of the QML errors appear to be resolved now. Views render as expected
hebasto (Migrated from github.com) reviewed 2022-12-20 17:47:06 +00:00
hebasto (Migrated from github.com) commented 2022-12-20 17:47:06 +00:00

fec6a0e9c7

In Chain interface, probably better to use a type-safe CBlockIndex::Time() github.com/bitcoin-core/gui-qml@fd4e57f636/src/chain.h (L279-L282)

Anyway, it will take a broader discussion when it will about to merge into the main repo.

fec6a0e9c7c4d98a88628ab57ce33144923da85d In `Chain` interface, probably better to use a type-safe `CBlockIndex::Time()` https://github.com/bitcoin-core/gui-qml/blob/fd4e57f63654e2d8e7d0de0aafc335715a53a5cc/src/chain.h#L279-L282 Anyway, it will take a broader discussion when it will about to merge into the main repo.
hebasto (Migrated from github.com) reviewed 2022-12-20 18:00:42 +00:00
hebasto (Migrated from github.com) commented 2022-12-20 17:56:19 +00:00

a287f9e44660b80349defa8f34f14c8b9f0d8b78

Sorry, if I missed any previous discussion about that, but why is calling of ChainModel::setCurrentTimeRatio implemented like that?

a287f9e44660b80349defa8f34f14c8b9f0d8b78 Sorry, if I missed any previous discussion about that, but why is calling of `ChainModel::setCurrentTimeRatio` implemented like that?
hebasto (Migrated from github.com) commented 2022-12-20 17:57:19 +00:00

a287f9e44660b80349defa8f34f14c8b9f0d8b78

nit: Naming convention?

a287f9e44660b80349defa8f34f14c8b9f0d8b78 nit: Naming convention?
hebasto (Migrated from github.com) commented 2022-12-20 17:57:49 +00:00

a287f9e44660b80349defa8f34f14c8b9f0d8b78

nit: Naming convention?

a287f9e44660b80349defa8f34f14c8b9f0d8b78 nit: Naming convention?
hebasto (Migrated from github.com) commented 2022-12-20 17:58:11 +00:00

a287f9e44660b80349defa8f34f14c8b9f0d8b78

nit: Naming convention?

a287f9e44660b80349defa8f34f14c8b9f0d8b78 nit: Naming convention?
hebasto (Migrated from github.com) commented 2022-12-20 18:00:30 +00:00

a287f9e44660b80349defa8f34f14c8b9f0d8b78
Naming convention:

    QTimer* m_timer;
a287f9e44660b80349defa8f34f14c8b9f0d8b78 Naming convention: ```suggestion QTimer* m_timer; ```
hebasto (Migrated from github.com) commented 2022-12-20 17:59:04 +00:00

a287f9e44660b80349defa8f34f14c8b9f0d8b78

Maybe add a descriptive comment?

a287f9e44660b80349defa8f34f14c8b9f0d8b78 Maybe add a descriptive comment?
shaavan (Migrated from github.com) reviewed 2022-12-21 13:01:05 +00:00
shaavan (Migrated from github.com) commented 2022-12-21 13:01:05 +00:00

The currentTimeRatio represents the ratio of 12 hours that has been passed.
So, for example, at 4 am or pm, the currenTimeRatio would be 0.3.

We need to update this information in the blockClock each second so that the blockClock always shows the correct blockTime.

So that's why I created a separate 1-sec timer thread to call this function each second and update the currentTimeRatio.

The **currentTimeRatio** represents the ratio of 12 hours that has been passed. So, for example, at 4 am or pm, the currenTimeRatio would be 0.3. We need to update this information in the blockClock each second so that the blockClock always shows the correct blockTime. So that's why I created a separate 1-sec timer thread to call this function each second and update the **currentTimeRatio**.
shaavan (Migrated from github.com) reviewed 2022-12-21 13:07:29 +00:00
shaavan (Migrated from github.com) commented 2022-12-21 13:07:29 +00:00

Sure, let me look through it.

it will take a broader discussion when it will about to merge into the main repo.

Let me include that, along with other future suggestions for this file.

Sure, let me look through it. > it will take a broader discussion when it will about to merge into the main repo. Let me include that, along with other future suggestions for this file.
shaavan commented 2022-12-21 13:46:02 +00:00 (Migrated from github.com)

Updated from abb0bef2460b4ba98cf02758dedd052efe4ec722 to 67d12a6753 (pr148.13 -> pr148.14, diff)

Addressed @hebasto comments.

Changes:

  • Changed 1-sec QTimer from a global private member variable to a local variable.
  • Changed names of variables mentioned in this comment from camel-style naming to snake-style naming. For full diff, check diff.
  • Added descriptive comment for m_time_ratio_list, and the values it stores.
Updated from abb0bef2460b4ba98cf02758dedd052efe4ec722 to 67d12a67536b636bbda3f5bb8d1e62cc5fa66d65 ([pr148.13](https://github.com/shaavan/gui-qml/commits/pr148.13) -> [pr148.14](https://github.com/shaavan/gui-qml/commits/pr148.14), [diff](https://github.com/shaavan/gui-qml/compare/pr148.13..pr148.14)) Addressed @hebasto comments. Changes: - Changed 1-sec QTimer from a <s>global</s> private member variable to a local variable. - Changed names of variables mentioned in [this](https://github.com/bitcoin-core/gui-qml/pull/148#discussion_r1053596002) comment from camel-style naming to snake-style naming. For full diff, check [diff](https://github.com/shaavan/gui-qml/compare/pr148.13..pr148.14). - Added descriptive comment for `m_time_ratio_list`, and the values it stores.
shaavan (Migrated from github.com) reviewed 2022-12-21 13:47:39 +00:00
shaavan (Migrated from github.com) commented 2022-12-21 13:47:39 +00:00

Addressed in 67d12a6753

Addressed in 67d12a67536b636bbda3f5bb8d1e62cc5fa66d65
shaavan (Migrated from github.com) reviewed 2022-12-21 13:47:54 +00:00
shaavan (Migrated from github.com) commented 2022-12-21 13:47:54 +00:00

Addressed in 67d12a6753

Addressed in 67d12a67536b636bbda3f5bb8d1e62cc5fa66d65
shaavan (Migrated from github.com) reviewed 2022-12-21 13:48:01 +00:00
shaavan (Migrated from github.com) commented 2022-12-21 13:48:01 +00:00

Addressed in 67d12a6753

Addressed in 67d12a67536b636bbda3f5bb8d1e62cc5fa66d65
shaavan (Migrated from github.com) reviewed 2022-12-21 13:48:13 +00:00
shaavan (Migrated from github.com) commented 2022-12-21 13:48:13 +00:00

Addressed in 67d12a6753

Addressed in 67d12a67536b636bbda3f5bb8d1e62cc5fa66d65
shaavan (Migrated from github.com) reviewed 2022-12-21 13:49:49 +00:00
shaavan (Migrated from github.com) commented 2022-12-21 13:49:49 +00:00

Addressed in 67d12a6753

Since this timer didn't need to be a private member variable, I changed it to a local variable.

Addressed in 67d12a67536b636bbda3f5bb8d1e62cc5fa66d65 Since this timer didn't need to be a private member variable, I changed it to a local variable.
hebasto commented 2023-01-25 10:59:53 +00:00 (Migrated from github.com)

Closing in favor of #220.

Closing in favor of #220.
Sign in to join this conversation.
No description provided.