Skip to content

feat(web): clickable state filter for proposals + refreshed SDK snippet#72

Merged
marinom2 merged 1 commit into
mainfrom
feat/dao-state-filter-and-snippet
Jun 10, 2026
Merged

feat(web): clickable state filter for proposals + refreshed SDK snippet#72
marinom2 merged 1 commit into
mainfrom
feat/dao-state-filter-and-snippet

Conversation

@marinom2

Copy link
Copy Markdown
Owner

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-proposals reads 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() and decodeGovernanceAction() (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 viem PublicClient. The snippet now leads with the scan+decode surface and shows config() / getBallotsBalance(). Every method was verified to exist with correct signatures against sdk/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.

- 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.
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
lightnode Ready Ready Preview, Comment Jun 10, 2026 1:13pm

Request Review

@marinom2 marinom2 merged commit 2181547 into main Jun 10, 2026
5 checks passed
@marinom2 marinom2 deleted the feat/dao-state-filter-and-snippet branch June 10, 2026 13:15
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.

1 participant