feat(governance): clearer ballot voting UX (segmented vote + one entry per action)#296
Merged
Conversation
…ry per action
The per-proposal voting controls were confusing: a raw OS <select> for the
Yes/No/Abstain choice, plus TWO competing actions (a green "Add to Ballot"
button in proposals.tsx AND a mystery ballot icon in VoteButton).
- Replace the native <select> with a shadcn segmented Yes/No/Abstain control
(color-coded selected state, icons). Guard `(v) => v && setVoteKind(v)` so a
re-click can't blank the vote read into the tx.
- One clear primary: the Vote button now states the choice ("Vote Yes",
"Vote Yes (Proxy)") and uses the themed primary style.
- One ballot entry: the icon-only ballot button becomes a labeled "Add to
ballot" / "In N ballots" secondary, with a tooltip distinguishing the two
flows (vote on-chain now vs collect for co-signers).
- Remove the now-duplicate green "Add to Ballot" buttons (mobile + desktop) in
proposals.tsx; keep the View links.
vote()/voteProxy() bodies, proxy path, keepRelevant, metadata label 674, the
closed-vote Lock state, and all toasts are unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # src/components/pages/wallet/governance/proposals.tsx
# Conflicts: # src/components/pages/wallet/governance/proposals.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The per-proposal voting controls were confusing (screenshot): a raw OS
<select>for Yes/No/Abstain, and two competing actions — a green "Add to Ballot" button and a mystery ballot-icon button.Changes
<select>→ shadcnToggleGroupYes/No/Abstain, color-coded selected state + icons. Mandatory(v) => v && setVoteKind(v)guard (ToggleGroup emits""on re-click — without it an empty vote could be read into the tx).proposals.tsx; kept the View links. Dropped the now-unusedPlusimport.vote()/voteProxy()bodies, the proxy path,keepRelevant, metadata label674, the closed-vote Lock state, and all toasts are unchanged.The control swap is UI-only, but the one behavioral thing to confirm on a connected wallet (UTxOs + DRep registered, preprod) is that casting a vote builds the tx with the correct
voteKindfrom the new segmented control, in both direct and proxy modes. The(Proxy)suffix andNo UTxOs Availabledisabled path are preserved.Verify (render-only, no wallet)
tscclean;jest362 passed.Part of the governance/assets UX pass. Sibling PR: gov-card colored type chips + ask-₳ badge.
🤖 Generated with Claude Code