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

Poltieia proposals page #331

Merged
merged 13 commits into from Apr 21, 2021
Merged

Conversation

ugwueze-dev
Copy link
Contributor

@ugwueze-dev ugwueze-dev commented Mar 1, 2021

This adds a page that displays poiliteia proposals. Fixes #236 .

It adds a proposals list page. Proposals are grouped by categories, and these categories are displayed as tabs.
It also adds a proposal description page that is navigated to when a proposal item on the list is displayed.

It also adds and makes use of 4 widgets:

  1. Tooltip widget that's used to draw a widget over other widgets when it's trigger is hovered over
  2. Hoverable widget that's used by the tooltip widget to achieve it's on hover feature
  3. Votebar widget that's used to display a bar of "yes" votes against "no" votes
  4. Grid widget that breaks text into their separate widgets so that they can be formatted accordingly

politeia
politeia2

@oshorefueled
Copy link
Contributor

Kindly add a more detailed description. There are commits that are quite large like hoverable, tooltip, grid. These should be included in your description, what they do and why they were added.

@oshorefueled
Copy link
Contributor

oshorefueled commented Mar 24, 2021

Below is what the current tab implementation looks like
Screenshot 2021-03-24 at 19 53 35

This is how it should instead look like
Screenshot 2021-03-24 at 19 51 10

  • The top tab should be scrollable horizontally.
  • The button to the right on the tab should be a refresh icon and not a circle as in the mockup below
  • The badge shouldn't be oval but instead a perfect circle
  • The correct navigation icon for the proposals page should also be used

Also dimensions from the mockups should be accurately used

@oshorefueled
Copy link
Contributor

No proposal is displayed after the proposals are completely fetched. They are only displayed after restarting the app

Screenshot 2021-04-13 at 18 37 06

ui/decredmaterial/votebar.go Show resolved Hide resolved
ui/decredmaterial/votebar.go Outdated Show resolved Hide resolved
ui/decredmaterial/votebar.go Show resolved Hide resolved
ui/proposal_details_page.go Outdated Show resolved Hide resolved
Comment on lines +32 to +50
type proposalNotificationListeners struct {
page *proposalsPage
}

func (p proposalNotificationListeners) OnNewProposal(proposal *dcrlibwallet.Proposal) {
p.page.addDiscoveredProposal(*proposal)
}

func (p proposalNotificationListeners) OnProposalVoteStarted(proposal *dcrlibwallet.Proposal) {
p.page.updateProposal(*proposal)
}

func (p proposalNotificationListeners) OnProposalVoteFinished(proposal *dcrlibwallet.Proposal) {
p.page.updateProposal(*proposal)
}

func (p proposalNotificationListeners) OnProposalsSynced() {
p.page.isSynced = true
}
Copy link
Contributor

Choose a reason for hiding this comment

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

would this work if it were in the wallet package like other listeners?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is what i intend to do in the next PR reason i requested we have this merged.
I have already started but it started getting complicated. Once this is merged it will be easier to migrate.

Comment on lines +99 to +106
proposalCategoryTitles = []string{"In discussion", "Voting", "Approved", "Rejected", "Abandoned"}
proposalCategories = []int32{
dcrlibwallet.ProposalCategoryPre,
dcrlibwallet.ProposalCategoryActive,
dcrlibwallet.ProposalCategoryApproved,
dcrlibwallet.ProposalCategoryRejected,
dcrlibwallet.ProposalCategoryAbandoned,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

A proposal category type can be created here. And instead of two slices, a single slice of the type containing the title and id of the proposal category would be used.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this review to the other PR as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this review to the other PR as well?

ugwueze-dev and others added 13 commits April 20, 2021 03:31
* add hoverable and tooltip widgets
* fix bug with page clickables
* fix bug with hoverable widget when hovered

fix irregular scroll container height issue
* make proposal tab scrollable
* update proposal tab to mockup design
* remove date and use proposal state on for discussion tab
* modify tooltip widget to use inset layout
* update label colors to mockup colors
* update proposal section dimension to mockup design
* add extraText field to subpagelayout
* align proposal detail page header to mockup design
add redirect to github and politeia functionality
add download proposal and comments options
clean up code
* fix info popup positioning bug
* update info pupup dimentions to mockup ui
* remove scrollcontainer and use list on proposal page
* fix lint error
* fix page refresh issue
* reset proposal details description layout to the top when back btn is clicked
* move gotoURL() to util.go
* fix lint error and rebase pr
@oshorefueled oshorefueled merged commit d147ed2 into planetdecred:master Apr 21, 2021
song50119 pushed a commit to song50119/godcr that referenced this pull request Apr 24, 2022
* add hoverable and tooltip widgets

* Add proposal details page

* Add proposal active and inactive icons to side navigation
* make proposal tab scrollable

* Add info icon and tooltip to in discussion view
* modify tooltip widget to use inset layout

* use subpagelayout for proposals detail page
* add extraText field to subpagelayout

* add in discussion details state layout

Co-authored-by: morrison <edonomorrison@gmail.com>
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.

add proposals list page
3 participants