Delegates to Kubb#1913
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🚅 Deployed to the anticapture-pr-1913 environment in anticapture-infra
14 services not affected by this PR
|
🎨 UI Review
This PR migrates all ✅ Nothing to flag — fully validated
Review by @isadorable-png · automated UI review _Generated by Claude Code Generated by Claude Code |
🎨 UI Review
This is a data-layer refactoring (Apollo GraphQL → REST/React Query) for the holders-and-delegates section. 23 files changed, almost entirely hook rewrites. Two behavioral changes worth flagging: Delegate Proposals ActivityVote filter state now URL-persisted ← note for author
Balance + Delegation History GraphsGraph data may differ from before ← question for author
Regression check
Validated correct — no change needed
Review by @isadorable-png · automated UI review Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e690291b20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🎨 UI Review
This PR migrates the Holders & Delegates section from GraphQL to Kubb REST. Most changes are hook internals with no visual consequence. Findings below cover the places where rendered output or UX behavior actually changes. Delegate drawer — Proposals Activity tabVote filter now persisted in URL ← confirm param key + reset behavior
- const [userVoteFilter, setUserVoteFilter] = useState<string>("all");
+ const [userVoteFilter, setUserVoteFilter] = useQueryState(
+ "userVoteFilter",
+ parseAsStringEnum(["all", "yes", "no", "abstain", "no_vote"]).withDefault("all"),
+ );The active filter is now written to
Balance History graph — zero-value events excluded + 1000-point cap
+ fromValue: "1",
+ limit: 1000,
Delegation History graph — same changes appliedSame
Voting Power History table + Delegation History table —
|
…tals The API only returns summary fields (totalProposals, votedProposals, winRate, etc.) on the first page; subsequent pages return zeros. Reading lastPage.totalProposals caused getNextPageParam to return undefined after page 1, breaking infinite scroll on the delegate proposals activity drawer. Switch the next-page check and the summary metrics to read from the first page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2df53fa420
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1388c7f00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Backend orders by timestamp only, so offset pagination ties or concurrent inserts can repeat rows on the next page. Dedupe by transactionHash + delegateAddress + amount + timestamp. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The /api/gateful proxy attaches Authorization only when BLOCKFUL_API_TOKEN is set. Without it, voting-powers (and any other auth-gated endpoint on the gateful upstream) returns 401, which surfaces as the "Oops" error state on the Delegates table and breaks the infinite-scroll e2e. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Temporary debug step that confirms the BLOCKFUL_API_TOKEN secret reaches the runner and that the upstream accepts it. Will be removed once the e2e auth wiring is confirmed green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ead3ce7a8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const loaded = allPages.reduce((s, p) => s + p.proposals.length, 0); | ||
| const total = allPages[0]?.totalProposals ?? 0; | ||
| return loaded >= total ? undefined : loaded; |
There was a problem hiding this comment.
Compute proposal pagination offset from unique merged rows
This hook now deduplicates proposals by proposal.id, but getProposalsNextPage still advances skip using the raw number of fetched rows. When the backend returns overlapping pages (possible because proposals activity ordering is not uniquely keyed, e.g. timestamp ties), duplicate rows consume offset space and the next request can skip unseen proposals, causing truncated infinite scroll and hasNextPage turning false too early. Fresh evidence in this commit: deduping is done at lines 72-79, while offset is still based on raw page lengths at lines 29-31.
Useful? React with 👍 / 👎.
| orderDirection, | ||
| limit, | ||
| }, | ||
| { query: { getNextPageParam } }, |
There was a problem hiding this comment.
Derive delegator next offset from deduplicated item count
The infinite query uses the generic getNextPageParam (raw fetched row count), but the hook later removes duplicate delegatorAddress entries before rendering. If pagination overlaps occur (the delegators query orders by non-unique aggregates/timestamps), duplicates will still advance offset and can skip unique delegators on subsequent pages, so users may never see all rows. Fresh evidence in this commit: deduping was reintroduced at lines 45-53, but next-page offset still comes from the raw helper wired at line 42.
Useful? React with 👍 / 👎.
Turbo strips env vars not declared in passThroughEnv before running a task. The secret was reaching the workflow step (verified via diagnostic curl: with-token=200, no-token=401) but Turbo dropped it before launching playwright, so the dev-server proxy ran without an upstream token and got 401 on every voting-powers call. Add BLOCKFUL_API_TOKEN to passThroughEnv for the three test:e2e task definitions, and drop the temporary diagnostic step now that the root cause is identified. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c243eeb5bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { | ||
| data: transfers, | ||
| loading, | ||
| fetchNextPage, | ||
| error, | ||
| hasNextPage, | ||
| } = useBalanceHistory({ |
There was a problem hiding this comment.
Use
fetchingMore for balance-history load-more state
After migrating useBalanceHistory to TanStack infinite queries, loading now only tracks the initial fetch while pagination state is exposed separately as fetchingMore. This destructuring still ignores fetchingMore, so the table continues to use initial-load state for isLoadingMore; with the table's intersection observer guard in shared/components/design-system/table/Table.tsx, that can repeatedly trigger onLoadMore while a next page is already in flight, causing overlapping page fetch calls and unstable infinite-scroll behavior.
Useful? React with 👍 / 👎.
| const { data, isLoading, error, fetchNextPage, hasNextPage } = | ||
| useHistoricalVotingPowerByAccountIdInfinite( | ||
| daoId.toLowerCase() as HistoricalVotingPowerByAccountIdPathParamsDaoEnumKey, | ||
| accountId, | ||
| params, | ||
| { query: { getNextPageParam } }, | ||
| ); |
There was a problem hiding this comment.
Surface next-page fetching state in delegation history hook
This hook switched from a locally guarded fetchMore flow to raw useHistoricalVotingPowerByAccountIdInfinite pagination, but it only returns loading: isLoading and does not expose isFetchingNextPage. Consumers that wire infinite scroll via the shared table now lack an in-flight pagination flag, so onLoadMore can fire again before the previous page resolves, leading to repeated next-page invocations under sustained intersection.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e2680a5cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Note
Medium Risk
Broad dashboard data-layer swap plus API pagination/count behavior when transfer filters are applied; regressions could affect tables, infinite scroll, and filtered balance history.
Overview
This PR adds server-side
fromandtofilters onGET /accounts/{address}/balances/historical(OpenAPI, GraphQL gateway, repository join ontransfer, and count when those filters are set). The dashboard balance history sends buy/sell and custom counterparty filters in the query viauseHistoricalBalancesInfinite, sototalCountand pagination match the filtered set instead of client-side filtering.The holders-and-delegates area is migrated from Apollo GraphQL to kubb-generated
@anticapture/clienthooks (infinite queries for delegates, balance history, delegation history, proposals activity, account interactions, etc.). Tables exposehasNextPagedirectly instead of nested pagination objects, and shared pagination types are trimmed.Delegate proposals activity infinite scroll is fixed:
getNextPageParamusestotalProposalsfrom the first page (summary fields are not repeated on later pages). The activity drawer persists user vote filter in the URL vianuqs.Graph/chart hooks for balance and voting-power history switch to REST with adjusted query params (e.g.
fromValue,limit, sort direction).Reviewed by Cursor Bugbot for commit 39ae1e1. Configure here.