feat(web): clickable state filter for proposals + refreshed SDK snippet#72
Merged
Conversation
- The outcome-analytics state chips (e.g. "25 executed / 4 defeated / 1 canceled") are now clickable filters. Clicking one filters the proposal list to that state and scrolls to it; clicking again clears. Filtering spans ALL proposals via a new ?state= param on the dao-proposals route (reads state for every proposal, batched, then returns matches), not just the loaded page. The list shows a "Filtered to X" clear chip. - Refresh the "SDK behind it" snippet: it was accurate but stale - it omitted recentProposals() and decodeGovernanceAction(), the two methods that power the decoded-calldata + analytics views, and its write-comment mislabelled the constructor's first arg as an RPC url (it's a viem PublicClient). Now leads with the scan+decode surface and shows config()/getBallotsBalance(). - Consolidate the batched-read helper into lib/dao-governor-scan (mapBatched), shared by the proposals + analytics routes. Verified live: ?state=defeated -> 4, ?state=canceled -> 1, no filter -> 30.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Two of the four asks from the last round.
1. Clickable state filters
The outcome-analytics chips ("25 executed / 4 defeated / 1 canceled") are now clickable filters. Clicking one filters the proposal list to that state and scrolls to it; clicking again clears. A "Filtered to X ✕" chip appears above the list.
Filtering spans all proposals, not just the loaded page: a new
?state=param on/api/dao-proposalsreads state for every proposal (batched) and returns only matches with correct pagination. Verified live:?state=defeated→ 4,?state=canceled→ 1, no filter → 30.2. Refreshed SDK snippet ("is it all updated?")
It was accurate but stale - it omitted
recentProposals()anddecodeGovernanceAction()(the two methods that actually power the decoded-calldata + analytics views), and its write-comment mislabelled the constructor's first arg as an RPC url when it's a viemPublicClient. The snippet now leads with the scan+decode surface and showsconfig()/getBallotsBalance(). Every method was verified to exist with correct signatures againstsdk/src/dao.ts(workflow audit + adversarial re-check).Internals
Consolidated the batched-read helper into
lib/dao-governor-scan(mapBatched), shared by the proposals + analytics routes.tsc/next build/ ESLint clean, 485/485 tests pass.