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

Qt: Adds Governance tab #4351

Merged
merged 25 commits into from
Oct 30, 2021
Merged

Qt: Adds Governance tab #4351

merged 25 commits into from
Oct 30, 2021

Conversation

5tefan
Copy link

@5tefan 5tefan commented Aug 19, 2021

Towards #4337, implementing DMT-like Governance Functionality.

@5tefan
Copy link
Author

5tefan commented Aug 20, 2021

Views of the new functionality:

Screen Shot 2021-08-20 at 01 07 19

Screen Shot 2021-08-20 at 01 07 00

Questions:

  • What columns to display? Probably include vote counts/ratio. Is showing url necessary with right click to open url exists?
  • Looking a bit simper than Masternode list, not subscribing to updates from core: just periodically refresh, or include a refresh button?
  • Show proposals only?

@UdjinM6
Copy link

UdjinM6 commented Aug 20, 2021

Nice! 👍

Questions:

  • What columns to display? Probably include vote counts/ratio. Is showing url necessary with right click to open url exists?

Would be nice to have "Voting status" implemented in a similar way it's done in DMT imo. Also, cycles (e.g. current/total) and total amount might be useful in this list. URL, yes/no/abstain counts etc. can be shown in a separate panel like it's done in DMT (i.e. you select a proposal and this populates "Details" panel below).

  • Looking a bit simper than Masternode list, not subscribing to updates from core: just periodically refresh, or include a refresh button?

The list is small here (10s comparing to 1000s in mn list), periodic updates should be ok I think (assuming they won't cause issues with "Details" panel I mentioned above).

  • Show proposals only?

Yeah, I think it would be better to start with proposals first. We can get back to triggers later when we polish proposals list(/vote?) functionality.

@github-actions
Copy link

This pull request has conflicts, please rebase.

src/qt/governancelist.cpp Outdated Show resolved Hide resolved
src/qt/optionsdialog.cpp Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Oct 1, 2021

This pull request has conflicts, please rebase.

WIP: basically ready to be filled out, most of the infra in place
now.
Governance table now contains real values for current columns. Display
columns may potentially change.

- want url in table if right click option opens url?
- What set of cols wanted? Show yes/no votes?
- Decide refresh functionality.
- Do we even want filter func? (checkbox show: proposal, trigger, active coming)
Towards DMT like Governance page, now shows voting status, but needs to
look at super blocks to determine if proposal period has passed and show
final funded or unfunded for past proposals.
Refactors the QT Governance tab to use a Model-View architecture. The
list of Proposals is stored in a QAbstractItemModel, and a QTableView is
used to display.

This makes a much cleaner separation of concerns in the implementation.
Also, can now use the QSortFilterProxyModel to get responsive filtering.
Less internal state inside the GovernanceList, critical sections
removed.

- Needs update loop implemented.
- Needs Proposal detail widget implemented.
Periodically update list of governance related proposals.
- Adds LOCK(cs_main) for call to pGovObj->IsValidLocally.
- retab, removes trailing whitespace in governancelist.{cpp,h}
@PastaPastaPasta
Copy link
Member

Please see formatting changes https://github.com/dashpay/dash/pull/4351/checks?check_run_id=3878279015

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

pls see https://github.com/UdjinM6/dash/commits/pr4351 for some suggestions

@5tefan
Copy link
Author

5tefan commented Oct 26, 2021

@UdjinM6, sorry I think your pr4351 branch may have been deleted?

@UdjinM6
Copy link

UdjinM6 commented Oct 26, 2021

oops, sorry, should be available again

@5tefan
Copy link
Author

5tefan commented Oct 27, 2021

No worries, thanks! I like those changes. Just caught one extra place that should refer to the full column name.

@UdjinM6
Copy link

UdjinM6 commented Oct 28, 2021

two more fixes, pls see 20e51e2 and 7e40bed

@UdjinM6 UdjinM6 added this to the 18 milestone Oct 29, 2021
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

LGTM

ACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

ACK for squash merge

@PastaPastaPasta
Copy link
Member

Things for future changes:
Add: Yes count, No count, Abstain Count, Absolute Yes coin, url
Remove: Hash
Replace Start, End dates with computed "Payments Remaining"

We should consider adding a pop-up warning before opening the proposal URL

@PastaPastaPasta PastaPastaPasta merged commit f0d49e4 into dashpay:develop Oct 30, 2021
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Oct 30, 2021
UdjinM6 pushed a commit that referenced this pull request Nov 1, 2021
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
* Qt: Adds settings option to showGovernanceTab

* Qt: Adds not-yet-functional Governance tab to UI

* library: adds hook into governance rom node interface

* Qt: WIP: puts CGovernanceObject hashes on Governance tab

WIP: basically ready to be filled out, most of the infra in place
now.

* Qt: Populates Governance table values

Governance table now contains real values for current columns. Display
columns may potentially change.

- want url in table if right click option opens url?
- What set of cols wanted? Show yes/no votes?
- Decide refresh functionality.
- Do we even want filter func? (checkbox show: proposal, trigger, active coming)

* qt: Shows Voting Status on Governance page

Towards DMT like Governance page, now shows voting status, but needs to
look at super blocks to determine if proposal period has passed and show
final funded or unfunded for past proposals.

* Qt: refactor governance tab to use Model-View arch

Refactors the QT Governance tab to use a Model-View architecture. The
list of Proposals is stored in a QAbstractItemModel, and a QTableView is
used to display.

This makes a much cleaner separation of concerns in the implementation.
Also, can now use the QSortFilterProxyModel to get responsive filtering.
Less internal state inside the GovernanceList, critical sections
removed.

- Needs update loop implemented.
- Needs Proposal detail widget implemented.

* qt: adds periodic update to gov proposal list

Periodically update list of governance related proposals.

* qt: populates governancelist voting status column

* qt: governancelist Porposal shows extra info on doubleClick

* qt: governancelist: reorder .cpp impl to match .h

* qt: governancelist: fixup based on CI

- Adds LOCK(cs_main) for call to pGovObj->IsValidLocally.
- retab, removes trailing whitespace in governancelist.{cpp,h}

* qt: clang-format for governancelist

* Fixes

- drop unused include
- use proper univalue "get_" functions
- shorter/translatable statuses
- shorter dates
- add missing css styles

* qt: addresses governancelist code review items

* qt: use enum to name columns of governancelist

* fix: clear context menu before adding new items

* fix: skip potential nullptr proposals

* improve: show proposal url in context menu

* refactor: tweak enum name, make sure it's int starting from 0, use full name

* fix: column count

* improve: make it sortable, sort by start_date by default

* qt: use full col name in voting status col change signal emit

* better sorting

* use mapToSource to fix data fetching

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
gades pushed a commit to cosanta/cosanta-core that referenced this pull request May 8, 2022
* Qt: Adds settings option to showGovernanceTab

* Qt: Adds not-yet-functional Governance tab to UI

* library: adds hook into governance rom node interface

* Qt: WIP: puts CGovernanceObject hashes on Governance tab

WIP: basically ready to be filled out, most of the infra in place
now.

* Qt: Populates Governance table values

Governance table now contains real values for current columns. Display
columns may potentially change.

- want url in table if right click option opens url?
- What set of cols wanted? Show yes/no votes?
- Decide refresh functionality.
- Do we even want filter func? (checkbox show: proposal, trigger, active coming)

* qt: Shows Voting Status on Governance page

Towards DMT like Governance page, now shows voting status, but needs to
look at super blocks to determine if proposal period has passed and show
final funded or unfunded for past proposals.

* Qt: refactor governance tab to use Model-View arch

Refactors the QT Governance tab to use a Model-View architecture. The
list of Proposals is stored in a QAbstractItemModel, and a QTableView is
used to display.

This makes a much cleaner separation of concerns in the implementation.
Also, can now use the QSortFilterProxyModel to get responsive filtering.
Less internal state inside the GovernanceList, critical sections
removed.

- Needs update loop implemented.
- Needs Proposal detail widget implemented.

* qt: adds periodic update to gov proposal list

Periodically update list of governance related proposals.

* qt: populates governancelist voting status column

* qt: governancelist Porposal shows extra info on doubleClick

* qt: governancelist: reorder .cpp impl to match .h

* qt: governancelist: fixup based on CI

- Adds LOCK(cs_main) for call to pGovObj->IsValidLocally.
- retab, removes trailing whitespace in governancelist.{cpp,h}

* qt: clang-format for governancelist

* Fixes

- drop unused include
- use proper univalue "get_" functions
- shorter/translatable statuses
- shorter dates
- add missing css styles

* qt: addresses governancelist code review items

* qt: use enum to name columns of governancelist

* fix: clear context menu before adding new items

* fix: skip potential nullptr proposals

* improve: show proposal url in context menu

* refactor: tweak enum name, make sure it's int starting from 0, use full name

* fix: column count

* improve: make it sortable, sort by start_date by default

* qt: use full col name in voting status col change signal emit

* better sorting

* use mapToSource to fix data fetching

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
gades pushed a commit to cosanta/cosanta-core that referenced this pull request May 8, 2022
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.

None yet

3 participants