Skip to content

feat: Filter proposal states server side - #3144

Merged
croberge1 merged 2 commits into
mainfrom
filter-proposal-states
Oct 21, 2026
Merged

croberge1 merged 2 commits into
mainfrom
filter-proposal-states

Conversation

@croberge1

@croberge1 croberge1 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Passes the state filter to the backend, instead of fetching all proposals and filtering FE side.

Also adds keepPreviousData from react query v5 for smooth search, prevents the screen from flashing on every debounce, see videos below.

Before :

Screen.Recording.2026-10-20.at.6.59.33.PM.mov

After :

Screen.Recording.2026-10-20.at.7.02.33.PM.mov

@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
interface Ready Ready Preview Oct 20, 2026 11:03pm UTC

Request Review

@aave-code-review aave-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review

Commit 553f0984. This review replaces any earlier review on this pull request.

Verdict: minor issues

1 finding(s) are commented on the lines below.

Full detail, other severities, and the accept/reject controls are on the scan page.
Findings you reject there stop being reported for this repository.

@@ -184,10 +186,6 @@ export const ProposalsV3List = () => {
data.pages.forEach((page) => listItems.push(...page.proposals));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Search results ignore the selected proposal state filter
medium · bug
The diff removes the client-side filter listItems.filter((proposal) => proposal.badgeState === filterState). That filter ran on listItems after the list was built, so it probably also filtered search results. Now only useGovernanceProposals gets the state filter. useGovernanceProposalsSearch(query) still takes no state argument. A user who picks a state such as "Executed" and then types a search term will see proposals in every state. The dropdown still shows the selected state, so the results do not match the visible filter. The search branch is not in the diff context, so this finding assumes that search results also go into listItems.
Why this severity: The bug occurs only when a user combines search with a state filter. The user then sees wrong results, but no data is lost.
Suggested fix: Pass the cache state to useGovernanceProposalsSearch and include it in that query key, if the backend search endpoint supports a state filter. Otherwise, keep a client-side filter on the search results only.
Review harness · reply here to accept or reject this finding

@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.34 MB (-1 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!

Three Pages Changed Size

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

Page Size (compressed) First Load
/governance 43.24 KB (🟡 +59 B) 1.38 MB
/governance/ipfs-preview 97.64 KB (🟢 -87 B) 1.43 MB
/governance/v3/proposal 84.56 KB (🟡 +71 B) 1.42 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.

@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.34 MB (-1 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!

Three Pages Changed Size

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

Page Size (compressed) First Load
/governance 43.24 KB (🟡 +59 B) 1.38 MB
/governance/ipfs-preview 97.64 KB (🟢 -87 B) 1.43 MB
/governance/v3/proposal 84.56 KB (🟡 +71 B) 1.42 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.

@croberge1
croberge1 merged commit 6548d42 into main Oct 21, 2026
21 of 35 checks passed
@croberge1
croberge1 deleted the filter-proposal-states branch October 21, 2026 18:52

This branch was successfully deployed

1 active deployment
Preview — 553f0984 Deployed Oct 20, 2026 by vercel[bot]
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