Skip to content

feat: show voted indicator on governance proposals list#2950

Open
foodaka wants to merge 1 commit intomainfrom
feat/gov-qol
Open

feat: show voted indicator on governance proposals list#2950
foodaka wants to merge 1 commit intomainfrom
feat/gov-qol

Conversation

@foodaka
Copy link
Copy Markdown
Collaborator

@foodaka foodaka commented Apr 17, 2026

General Changes

Adds a you voted badge on the row

Screenshot 2026-04-17 at 14 32 56

Developer Notes

Add any notes here that may be helpful for reviewers.


Reviewer Checklist

Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur.

  • End-to-end tests are passing without any errors
  • Code changes do not significantly increase the application bundle size
  • If there are new 3rd-party packages, they do not introduce potential security threats
  • If there are new environment variables being added, they have been added to the .env.example file as well as the pertinant .github/actions/* files
  • There are no CI changes, or they have been approved by the DevOps and Engineering team(s)

Copilot AI review requested due to automatic review settings April 17, 2026 12:33
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
interface Ready Ready Preview, Comment Apr 17, 2026 0:36am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a “You voted” indicator to each governance proposal row by propagating the connected user’s vote information through the proposals data adapters and hooks into the list UI.

Changes:

  • Added a userVote field to the canonical ProposalListItem type and populated it from both subgraph and cache data paths.
  • Updated proposal-fetching hooks/services to pass the connected user address so per-user voted info can be resolved.
  • Rendered a “You voted YAE/NAY” badge in the proposals list row and updated Lingui message references.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/modules/governance/types.ts Introduces UserVoteInfo and adds optional userVote to ProposalListItem.
src/modules/governance/adapters.ts Maps subgraph/cache vote data into ProposalListItem.userVote.
src/modules/governance/ProposalsV3List.tsx Renders the voted indicator in each proposal row.
src/locales/en/messages.po Adds a source reference for the reused “You voted {0}” message.
src/hooks/governance/useProposals.ts Threads optional user into fetchProposals and voting machine data fetch.
src/hooks/governance/useGovernanceProposals.ts Fetches user votes (cache path) and keys/refetches queries by user address.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to +33
<SvgIcon sx={{ fontSize: 14 }}>
<CheckCircleIcon />
</SvgIcon>
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

CheckCircleIcon from @heroicons/react renders an <svg> already; nesting it inside MUI's <SvgIcon> produces an <svg> inside another <svg>, which can cause sizing/styling issues and invalid markup. Prefer rendering the Heroicon directly (set height/width/color) or pass it via SvgIcon's component prop instead of as a child.

Copilot uses AI. Check for mistakes.
Comment on lines +126 to +130
const userVotes = user
? await Promise.all(
proposals.map((p) => getUserVoteFromCache(p.id, user).catch(() => null))
)
: proposals.map(() => null);
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

This introduces an N+1 pattern: for each proposals page (PAGE_SIZE=10) it makes one getUserVoteFromCache request per proposal, which can add significant latency and load on the cache backend. Consider batching these lookups into a single GraphQL request (e.g., a bulk endpoint, or a single query using field aliases for each proposalId) so the page fetch remains O(1) requests.

Copilot uses AI. Check for mistakes.
Comment on lines +182 to +185
const userVotes = user
? await Promise.all(results.map((p) => getUserVoteFromCache(p.id, user).catch(() => null)))
: results.map(() => null);
return results.map((p, i) => adaptCacheProposalToListItem(p, userVotes[i]));
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

Same N+1 issue in search: this does one getUserVoteFromCache request per search result. If the cache path remains enabled, batching user-vote lookups into a single request would keep search responsive and reduce backend load.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1.15 MB (-19 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Sixteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 67.07 KB (🟡 +1.59 KB) 1.22 MB
/404 2.87 KB (🟡 +3 B) 1.15 MB
/500 3.2 KB (🟡 +5 B) 1.15 MB
/bridge 29.03 KB (🟡 +3 B) 1.18 MB
/dashboard 56.97 KB (🟡 +1.67 KB) 1.21 MB
/faucet 15.21 KB (🟢 -3 B) 1.17 MB
/governance 81.51 KB (🟡 +3.03 KB) 1.23 MB
/governance/ipfs-preview 102.04 KB (🟡 +72 B) 1.25 MB
/governance/v3/proposal 125.66 KB (🟡 +3.09 KB) 1.27 MB
/history 36.11 KB (🟢 -40 B) 1.19 MB
/markets 39.28 KB (🟢 -1.03 KB) 1.19 MB
/reserve-overview 26.84 KB (🟡 +2.73 KB) 1.18 MB
/safety-module 32.17 KB (🟡 +2.49 KB) 1.18 MB
/sgho 89.99 KB (🟡 +1.9 KB) 1.24 MB
/staking 33.7 KB (🟢 -80 B) 1.18 MB
/v3-migration 36.7 KB (🟡 +14 B) 1.19 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

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.

3 participants