Skip to content

Add DAO vote transaction submission#1441

Draft
dnlbui wants to merge 8 commits into
issue-1422-voting-flow-uifrom
issue-1423-voting-flow-transaction-integration
Draft

Add DAO vote transaction submission#1441
dnlbui wants to merge 8 commits into
issue-1422-voting-flow-uifrom
issue-1423-voting-flow-transaction-integration

Conversation

@dnlbui

@dnlbui dnlbui commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

What Changed

This PR connects the DAO voting UI to real dao_vote transaction submission.

  • daoRepo.castVote now builds and submits signed dao_vote transactions with proposal ID, option weights, spend, timestamp, and network ID.
  • ProposalInfoModal enables vote submission only after local eligibility checks for voting window, wallet, spend plus fee, vote threshold, minimum spend, and option weights.
  • The voting power preview remains informational: it approximates server weight math for display, but final weight is calculated by the network and unavailable estimates no longer block submission.
  • DAO proposal titles are now sent in create transactions and constrained to the server's 100-character limit.

Fixed Flow

  1. User opens a proposal in voting status.
  2. User enters LIB spend and option allocation weights.
  3. The modal validates local eligibility and previews estimated voting power.
  4. Submit signs and injects a dao_vote transaction, then refreshes DAO proposal data.

Why

The voting UI previously stopped at preview-only behavior. This adds the transaction path while keeping the client-side estimate separate from the server's authoritative Decimal-based vote-weight calculation.

Validation

  • node --check app.js
  • node --check dao.repo.js
  • git diff --check issue-1422-voting-flow-ui...HEAD

Closes #1423

dnlbui added 7 commits July 6, 2026 16:21
* Updated the Proposal Info Modal to dynamically display the proposal title based on transaction data, improving clarity for users.
* Introduced a new rendering function for recent votes, providing users with insights into voting activity.
* Added a new section for displaying total vote statistics, including a pie chart representation and detailed legends for better understanding of voting distribution.
* Implemented styling adjustments to enhance the visual presentation of voting information, ensuring a more user-friendly experience.

These changes significantly improve the functionality and usability of the Proposal Info Modal, offering users clearer insights into voting activities and outcomes.
* Added a new function to format and display weighted votes, improving clarity in vote representation.
* Removed the outdated recent votes rendering function to streamline the modal.
* Updated the display of total voting power to reflect weighted votes, enhancing user understanding of voting metrics.
* Made various CSS adjustments to improve layout and alignment of voting information, ensuring a more user-friendly experience.

These changes significantly enhance the functionality and usability of the Proposal Info Modal, providing users with clearer insights into voting metrics and improving overall presentation.
* Updated the HTML structure in the Proposal Info Modal to improve the display of voting metrics, separating total votes and share into distinct elements for better clarity.
* Removed unused voter list properties from the proposal mapping functions to streamline data handling.
* Adjusted CSS styles for the voting metrics section, enhancing layout and alignment for a more user-friendly experience.

These changes enhance the clarity and usability of the voting metrics in the Proposal Info Modal, providing users with clearer insights into voting statistics.
…mprovements

* Updated the getDaoProposalVotingWindow function to accept a timestamp parameter, allowing for more accurate voting window calculations.
* Introduced a new function, formatDaoEstimatedVotingPower, to provide a clearer representation of estimated voting power.
* Refactored the Proposal Info Modal to utilize the new estimated voting power function, improving the display of voting metrics.
* Adjusted the getVoteSubmission and getVotePreviewValidation functions to incorporate the timestamp for enhanced validation accuracy.

These changes improve the accuracy and clarity of voting window calculations and estimated voting power in the Proposal Info Modal, enhancing user experience and understanding of voting metrics.
* Introduced the Decimal.js library to improve precision in calculations related to DAO voting weights and estimates.
* Updated various functions to utilize Decimal for handling large numbers and ensuring accurate arithmetic operations.
* Added new utility functions for formatting and scaling voting power, enhancing clarity in the Proposal Info Modal.

These changes significantly enhance the accuracy and reliability of voting metrics, providing users with a more precise understanding of their voting power and estimates.
* Added a maximum length constraint for DAO proposal titles, enforcing a limit of 100 characters.
* Updated the title input field in the Add Proposal Modal to reflect the new maximum length.
* Enhanced validation logic to display an error message if the title exceeds the specified length.

These changes improve the user experience by ensuring that proposal titles adhere to the defined character limit, preventing submission errors.
…Info Modal

* Deleted the external Decimal.js library to simplify the codebase and reduce dependencies.
* Refactored voting metrics calculations in the Proposal Info Modal to eliminate reliance on Decimal, ensuring continued accuracy with native JavaScript types.
* Updated the display logic for voting totals and estimates, enhancing clarity and user experience.

These changes streamline the voting metrics implementation, improving maintainability while preserving functionality.
@dnlbui dnlbui linked an issue Jul 7, 2026 that may be closed by this pull request
6 tasks
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.

Phase 5.B: Voting Flow Transaction Integration

1 participant