Skip to content

feat: add delegators view#719

Open
moudi-network wants to merge 21 commits into
livepeer:mainfrom
moudi-network:feat/711/delegators-view
Open

feat: add delegators view#719
moudi-network wants to merge 21 commits into
livepeer:mainfrom
moudi-network:feat/711/delegators-view

Conversation

@moudi-network

@moudi-network moudi-network commented Jun 30, 2026

Copy link
Copy Markdown

Description

Adds a Delegators tab to the orchestrator account page, listing every account that has delegated stake to the orchestrator. Each row shows the delegator's Stake (subgraph bondedAmount) and Pending Rewards (live on-chain pendingStake − bondedAmount), so a row's total matches what each delegator sees on their own profile.

Built entirely on existing infrastructure: the subgraph Transcoder.delegators field (no subgraph/indexer change) and the existing /api/pending-stake endpoint (no new server code). Pending Rewards is fetched per visible row via the existing usePendingFeesAndStakeData hook — the same per-cell pattern already used for ENS data. Only the current page (~10 rows) are fetched.

Type of Change

  • feat: New feature

Related Issue(s)

Related: #711
Closes: #106

Changes Made

Delegators List

  • Add a Delegators tab to the account page, gated to orchestrators (isOrchestrator || isMyDelegate), positioned after Delegating
  • New queries/orchestratorDelegators.graphql querying the existing Transcoder.delegators field (regenerated Apollo types via pnpm codegen)
  • New components/DelegatorList (react-table: columns, custom numericSort, client pagination, empty state) and components/DelegatorsView wrapper
  • New SSR route pages/accounts/[account]/delegators.tsx (mirrors orchestrating.tsx)
  • Stake column from subgraph bondedAmount; Pending Rewards column computed live per row as max(0, pendingStake/1e18 − bondedAmount) via /api/pending-stake

Testing

  • Tested locally
  • Added/updated tests
  • All tests passing

How to test (optional unless test is not trivial)

Delegators List

  • Open an orchestrator account → Delegators tab; confirm the tab is present on orchestrators and absent on plain delegator accounts.
  • Pick a delegator row and open that delegator's own profile: the row's Stake + Pending Rewards should equal the profile's "Stake". Verified on 0x1416… orchestrator → delegator 0xa69e…3db3: 131.43K + 28.72K = 160.15K (matches profile).
  • pnpm codegen, pnpm typecheck, pnpm exec eslint … --max-warnings 0, prettier all clean.

Impact / Risk

Risk level: Low

Impacted areas: UI (new tab/route + right-rail copy), read-only API reuse (/api/pending-stake). No DB, infra, config, or new server code.

User impact: Orchestrator account pages gain a new Delegators tab. No change for plain delegator accounts. Purely additive. Nothing existing is altered.

Rollback plan: Plain PR revert. The change is additive (new route + tab branch + new components), so reverting removes the tab with no migration or config cleanup.

Screenshots / Recordings (if applicable)

Screenshot 2026-06-28 at 00 55 49

Additional Notes

  • Pending Rewards is fetched per visible row (reusing /api/pending-stake) to keep the PR minimal. No new API route/hook/type. Trade-off: the column is not globally sortable (the value only exists for on-screen rows). A batched-endpoint alternative (sortable column, 1 request) can be implemented if wanted later.
  • No "Fees" column: subgraph Delegator.fees is lifetime-cumulative across all orchestrators and event-lagged, so it isn't attributable to this orchestrator.
  • Scope: loads up to first: 1000 delegators sorted by stake, paginated client-side (10/page); fine for current orchestrator sizes.

Summary by CodeRabbit

  • New Features
    • Added a Delegators tab and page to view a transcoder’s delegators, including multi-page loading and row actions.
    • Improved table experience by persisting page/sort preferences and scroll position across explorer lists.
    • Added a top-of-page banner that warns when indexing data may be temporarily out of date.
  • Bug Fixes
    • Improved pagination reliability with inline warning and retry when additional pages fail.
    • Adjusted account layout behavior so wide tables no longer constrain the central column.
  • Style
    • Enhanced shared table to support configurable minimum width.

Adds a Delegators tab to the account layout listing an orchestrator's
delegators, backed by a new orchestratorDelegators subgraph query.
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@moudi-network is attempting to deploy a commit to the Livepeer Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@moudi-network, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 097bcbee-6337-4966-8473-6497d402d019

📥 Commits

Reviewing files that changed from the base of the PR and between ab0314c and dc8e5bc.

📒 Files selected for processing (7)
  • apollo/subgraph.ts
  • components/DelegatorList/index.tsx
  • components/DelegatorsView/index.tsx
  • components/Table/index.tsx
  • layouts/account.tsx
  • pages/accounts/[account]/delegators.tsx
  • queries/orchestratorDelegators.graphql
📝 Walkthrough

Walkthrough

Adds an orchestrator delegator route and table, generated GraphQL support, persisted explorer list state, subgraph health reporting, and updates to round and score data handling.

Changes

Orchestrator delegators

Layer / File(s) Summary
Delegators query surface
queries/orchestratorDelegators.graphql, apollo/subgraph.ts
Adds the delegators query, generated types, document, and Apollo hooks.
Delegators page and account wiring
pages/accounts/[account]/delegators.tsx, layouts/account.tsx
Adds static page loading, the account tab, and account-layout rendering.
Delegator pagination and table
components/DelegatorsView/index.tsx, components/DelegatorList/index.tsx
Fetches paginated delegators, handles loading and page errors, and renders sortable identity, stake, rewards, round, and action columns.

Explorer list persistence

Layer / File(s) Summary
Persisted state infrastructure
hooks/useExplorerStore.tsx, hooks/usePersistedExplorerListState.ts, components/Table/index.tsx, hooks/index.tsx
Adds list state storage, table state reporting, scroll restoration, and shared hook exports.
Explorer list integrations
components/OrchestratorList/index.tsx, components/GatewayList/index.tsx, components/PerformanceList/index.tsx, components/TransactionsList/index.tsx, pages/*
Restores and saves list pagination, sorting, assumptions, and scroll state across explorer list views.

Data handling and health reporting

Layer / File(s) Summary
On-chain round data
pages/api/current-round.tsx, pages/api/pending-stake/[address].tsx, components/RoundStatus/index.tsx, lib/api/types/get-current-round.ts
Reads round fields from RoundsManager and uses on-chain lock and round-length values in the UI.
Partial score responses
pages/api/score/[address].tsx, lib/api/types/get-performance.ts, components/OrchestratingView/index.tsx
Propagates nullable upstream metrics and renders unavailable score and pricing values distinctly.
Subgraph health status
pages/api/subgraph-health.tsx, hooks/useSubgraphHealth.ts, layouts/main.tsx
Detects block drift, polls health status, and displays a degraded-indexing banner.

Estimated code review effort: 5 (Critical) | ~100 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AccountLayout
  participant DelegatorsView
  participant ApolloHooks
  participant Subgraph
  participant DelegatorList

  AccountLayout->>DelegatorsView: render delegators view
  DelegatorsView->>ApolloHooks: query transcoder id and first page
  ApolloHooks->>Subgraph: orchestratorDelegators(...)
  Subgraph-->>ApolloHooks: transcoder.delegators
  ApolloHooks-->>DelegatorsView: data and fetchMore
  DelegatorsView->>DelegatorList: append delegator rows
  DelegatorList-->>AccountLayout: render table or empty state
Loading

Possibly related PRs

Suggested reviewers: ecwireless

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The diff includes many unrelated changes, such as persisted list state, subgraph-health banners, and API/round-status refactors. Split the persistence, health/banner, and API/round-status work into separate PRs so this PR only covers the delegators view.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately captures the main change: adding a delegators view.
Description check ✅ Passed The description includes the required sections and mostly complete details for scope, testing, risk, and related issues.
Linked Issues check ✅ Passed The PR implements the requested delegator list on orchestrator detail pages and uses existing backend data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@moudi-network

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/DelegatorsView/index.tsx`:
- Around line 15-23: The delegators list is being silently truncated by the
hard-coded `first: 1000` in `useOrchestratorDelegatorsQuery`, while the table
only paginates the fetched data client-side. Update `DelegatorsView` to drive
pagination from table state and fetch additional rows from the server using
`first`/`skip` (or cursors) instead of a fixed limit. Use the existing
`useOrchestratorDelegatorsQuery` setup and the table’s pagination controls to
wire the requested page size and offset through the query variables.
- Around line 15-27: The `DelegatorsView` render path is treating both in-flight
and failed `useOrchestratorDelegatorsQuery` results as an empty list, so
`DelegatorList` shows a false “No delegators found” state. Update
`DelegatorsView` to read `loading` and `error` from
`useOrchestratorDelegatorsQuery`, render a loading or error state before
`DelegatorList`, and only pass through to the empty-state logic after a
successful query with zero delegators.

In `@pages/accounts/`[account]/delegators.tsx:
- Around line 59-88: The delegators page currently allows any valid account
through `getStaticProps`, but this route should only serve orchestrator
accounts. In `getStaticProps`, after `getAccount(client, accountId)` and before
fetching orchestrators, check `account.data.transcoder`; if it is missing,
return `notFound: true` or redirect to `/delegating` instead of building
`PageProps`. Keep the existing `getAccount`, `getSortedOrchestrators`, and
`PageProps` flow only for accounts that have a transcoder.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 70cf5959-3344-4ea1-be5d-effb16836fa5

📥 Commits

Reviewing files that changed from the base of the PR and between 48e5844 and 34f87fc.

📒 Files selected for processing (7)
  • apollo/subgraph.ts
  • components/DelegatorList/index.tsx
  • components/DelegatorsView/index.tsx
  • components/Table/index.tsx
  • layouts/account.tsx
  • pages/accounts/[account]/delegators.tsx
  • queries/orchestratorDelegators.graphql

Comment thread components/DelegatorsView/index.tsx Outdated
Comment thread components/DelegatorsView/index.tsx Outdated
Comment thread pages/accounts/[account]/delegators.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/DelegatorsView/index.tsx`:
- Around line 38-69: The `fetchNext` pagination path in `DelegatorsView` only
logs `fetchMore` failures, which can leave the list silently incomplete after a
later page load fails. Update `fetchNext` so it sets a visible failure state
(for example `pageFetchFailed`) when `fetchMore` throws, and keep the state
reset in `finally` so retries remain possible. Then use that state in
`DelegatorsView` to render a small banner/notice near the table, and optionally
provide a retry action, so users know paging stopped early.
- Around line 93-94: The DelegatorsView render path is performing a side effect
by calling console.error(error) directly inside the component body when error &&
!delegators is true. Move this logging into a useEffect in DelegatorsView keyed
on error (and any other needed state) so the log only runs after render and
avoids duplicate or discarded render side effects.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f80ae7c1-d6b1-4b3f-9281-a72a2621c274

📥 Commits

Reviewing files that changed from the base of the PR and between 34f87fc and 5ed5b2d.

📒 Files selected for processing (2)
  • components/DelegatorsView/index.tsx
  • pages/accounts/[account]/delegators.tsx

Comment thread components/DelegatorsView/index.tsx
Comment thread components/DelegatorsView/index.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
components/DelegatorsView/index.tsx (2)

21-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a brief description for this non-trivial component.

DelegatorsView implements query wiring, cursor-less pagination, retry/failure handling, and multiple render states, but has no descriptive comment explaining its behavior/contract for future maintainers.

As per path instructions, "at minimum, include a general description for new functions/components that are not self-explanatory."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/DelegatorsView/index.tsx` around lines 21 - 33, DelegatorsView is
a non-trivial component and needs a brief descriptive comment explaining its
purpose and contract for maintainers. Add a short component-level description
near the DelegatorsView definition that summarizes its query wiring via
useOrchestratorDelegatorsQuery, pagination/fetchMore behavior, and the
loading/error/empty/content render states so the intent is clear without reading
the full implementation.

Source: Path instructions


42-85: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Stop auto-paging once the last page is shorter than PAGE_SIZE.
delegators.length % PAGE_SIZE === 0 treats an exact multiple as “more data,” so the final empty page can keep re-triggering fetchNext with the same skip and spam the subgraph. Track a hasMore flag from the last response instead of inferring it from the current length.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/DelegatorsView/index.tsx` around lines 42 - 85, The auto-paging
logic in fetchNext/useEffect is inferring pagination from delegators.length %
PAGE_SIZE, which can keep requesting the same skip value after the last full
page. Update the DelegatorsView paging flow to track an explicit hasMore flag
from the latest fetchMore response and use that in the useEffect guard instead
of relying on the current list length; make sure fetchNext clears hasMore when
fetchMoreResult.transcoder.delegators is empty or shorter than PAGE_SIZE.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@components/DelegatorsView/index.tsx`:
- Around line 21-33: DelegatorsView is a non-trivial component and needs a brief
descriptive comment explaining its purpose and contract for maintainers. Add a
short component-level description near the DelegatorsView definition that
summarizes its query wiring via useOrchestratorDelegatorsQuery,
pagination/fetchMore behavior, and the loading/error/empty/content render states
so the intent is clear without reading the full implementation.
- Around line 42-85: The auto-paging logic in fetchNext/useEffect is inferring
pagination from delegators.length % PAGE_SIZE, which can keep requesting the
same skip value after the last full page. Update the DelegatorsView paging flow
to track an explicit hasMore flag from the latest fetchMore response and use
that in the useEffect guard instead of relying on the current list length; make
sure fetchNext clears hasMore when fetchMoreResult.transcoder.delegators is
empty or shorter than PAGE_SIZE.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b22ee49f-1b03-4b4a-86f3-a6bf8a034fd7

📥 Commits

Reviewing files that changed from the base of the PR and between 5ed5b2d and 77a7714.

📒 Files selected for processing (1)
  • components/DelegatorsView/index.tsx

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Jul 6, 2026 2:52pm

Request Review

@rickstaa

rickstaa commented Jul 7, 2026

Copy link
Copy Markdown
Member

@moudi-network thanks for the contribution.

@mehrdadmms did an initial review, and everything looks good so far. The implementation works, and the code quality is high enough for the bounty to be paid out. I may request a few minor code and UI changes after Adam has reviewed it. I will try to merge this in in the comming weeks when I have more bandwith.

key1989han added a commit to key1989han/explorer that referenced this pull request Jul 17, 2026
@JJassonn69

Copy link
Copy Markdown
Contributor
screenshot

The text for the headers seems to be wrapping into two lines, not sure if this is intentional. Also some conflicts with the main.
@moudi-network

moudi-network and others added 9 commits July 24, 2026 13:38
* feat: preserve orch table state on back nav

* fix: address Copilot comments

* feat: preserve state for all major tables

* docs: add JSDoc to new persisted... hook

* chore: move default sort outside of memo

* chore: clean up persisted table state defaults
…eer#729)

One unreachable upstream failed the whole request with a 502. Fetch each
independently and fall back to null for that field, failing only when all are
down. Partial responses cache for a minute so recovery is not hidden, and the UI
shows "Unavailable" rather than "N/A" so our outage is not read as the
orchestrator having no score.
…vepeer#731)

/current-round mixed sources: round id/startBlock/initialized came from the
subgraph, but the current block from a live RPC call. When subgraph indexing
stalls the stale round is compared against a live block, so the tracker shows
a stale round number with counters running past the round length.

Read the timing from the RoundsManager contract (currentRound,
currentRoundStartBlock, currentRoundInitialized, blockNum) via l2PublicClient,
keeping startBlock and the current block consistent and independent of
subgraph health. Response shape is unchanged; aggregate stats still use the
subgraph.
Show a site-wide info banner when the subgraph is significantly behind the
L2 chain head, signalling Explorer data may be temporarily stale while the
protocol operates normally.
…ivepeer#734)

The voting list/detail pages and the Governance nav badge source polls
entirely from the subgraph, so a poll created during an indexing halt
(LIP-118 "Delegated Reward Calling") doesn't appear and can't be reached
for voting through the UI — even though voting itself is an on-chain action.

Add a temporary MANUAL_POLLS constant (subgraph-shaped entries) merged into
the voting list, the poll detail page, and the active-poll nav count, deduped
by poll address so the real tallied copy wins and the manual entry drops out
once indexing recovers. Manual polls carry no tally, so the detail page shows
a "counts not loaded" note; casting votes works normally on-chain. getTotalStake
now degrades gracefully if the subgraph is unavailable so manual polls still
render.

Revert once the subgraph has reindexed the poll.
…livepeer#735)

* fix: source round length and lock state on-chain in the round tracker

RoundStatus still mixed sources after livepeer#731: round timing came from the
RoundsManager via /current-round, but roundLength and the lock state came from
the subgraph (protocol.roundLength / protocol.lockPeriod). The lock state was
re-derived client-side (blocksRemaining <= lockPeriod) because the subgraph,
being event-driven, can't keep a per-block boolean fresh.

Extend /api/current-round to also return roundLength and locked (from
RoundsManager.roundLength and currentRoundLocked), and read both from
useCurrentRoundData. The lock state now comes straight from currentRoundLocked
— one authoritative snapshot instead of re-deriving it — and the round tracker
(ring, blocks remaining, lock badge) is fully on-chain and consistent.

The spinner now only waits on the on-chain round data, so the tracker renders
even when the subgraph is fully down; the subgraph-only stats (fees, rewards,
supply) are hidden in that case.


* chore: drop redundant comment in RoundStatus


* fix: show a loading skeleton for the round lock badge

isRoundLocked falls back to false before currentRoundInfo resolves, so the
header badge asserted "Initialized" while the round data was still loading.
Render a skeleton until currentRoundInfo is available, matching the spinner in
the content area below.


---------
…r#736)

/api/pending-stake read the current round from the subgraph and passed it to
on-chain pendingStake/pendingFees calls. When indexing falls behind, the stale
round understates both values, and a subgraph error or empty response threw
"No current round found" and returned a 500.

Read currentRound from the RoundsManager via l2PublicClient instead, so the
route is a pure contract read that no longer depends on subgraph health.
Response shape is unchanged.

This was the last caller of the subgraph-backed getCurrentRound() helper, so
drop it. queries/currentRound.graphql stays in use by getOrchestrators().
…h resyncs (livepeer#749)

Stopgap while the subgraph resyncs from scratch (livepeer/subgraph#247), which
leaves the manually surfaced LIP-118 poll showing 0% support and 0% participation
even for people who already voted.

Revert this and livepeer#734 once the subgraph has reindexed the poll.
---------

Co-authored-by: Copilot <copilot-pull-request-reviewer[bot]@users.noreply.github.com>
rickstaa and others added 5 commits July 24, 2026 13:41
…ivepeer#748)

Stopgap while the subgraph resyncs from scratch (livepeer/subgraph#247). Locks
created after indexing stalled are missing from the withdrawal list, so an
unbond appears to do nothing, and a matured lock stays invisible while being
withdrawable on-chain.

Lock ids are sequential and never reused, so anything the subgraph has not seen
sits above its highest known id. Add /api/unbonding-locks/[address] to read that
tail from the contract and append it to the subgraph's list rather than
replacing it, with the round from /api/current-round since a stale round hides a
matured lock's withdraw button.

Only fetched when the subgraph reports degraded and on the user's own account,
capped at 200 ids.

Revert once the subgraph has reindexed.

---------

Co-authored-by: CodeRabbit <coderabbitai[bot]@users.noreply.github.com>
…dexed (#…" (livepeer#752)

This reverts commit 081de4b as the new subgraph has been indexed.
… subgrap…" (livepeer#750)

This reverts commit 98f5694 as the new subgraph has been indexed.
… behind …" (livepeer#753)

This reverts commit 29fd3cc now the new subgraph is fully indexed.
…-view

# Conflicts:
#	apollo/subgraph.ts
#	components/Table/index.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/DelegatorList/index.tsx (1)

80-146: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Render the ordinal from the current row order.

row.index is the row’s index in the original data array, so with the declarative default sort by bondedAmountNumber and sortable columns, the displayed ordinal can jump ahead after sorting or page navigation. Derive the visible ordinal from the table-rendered rows, e.g. by mapping page/rows with its own index and passing it into the row cell, rather than using row.index + 1.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/DelegatorList/index.tsx` around lines 80 - 146, Update the
DelegatorList table rendering so the ordinal uses each row’s current visible
order rather than row.index from the original data array. Derive the index while
mapping the rendered page/rows and pass that value into the Cell rendering
context, then replace row.index + 1 with the passed visible ordinal while
preserving one-based numbering across sorting and pagination.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@hooks/useSubgraphHealth.ts`:
- Around line 11-13: Update the SWR request key in useSubgraphHealth to
"/api/subgraph-health" so it targets the existing API route and continues
receiving the { degraded } payload.

In `@pages/api/current-round.tsx`:
- Around line 55-69: Verify the deployed RoundsManager contract’s blockNum()
implementation or authoritative contract reference and confirm that
currentL1Block is L1-based before it is compared with currentRoundStartBlock in
RoundStatus. If blockNum() is not demonstrably L1-based, update the
current-round data flow to use a concrete L1 block source so both values share
the same basis.

---

Outside diff comments:
In `@components/DelegatorList/index.tsx`:
- Around line 80-146: Update the DelegatorList table rendering so the ordinal
uses each row’s current visible order rather than row.index from the original
data array. Derive the index while mapping the rendered page/rows and pass that
value into the Cell rendering context, then replace row.index + 1 with the
passed visible ordinal while preserving one-based numbering across sorting and
pagination.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8ecc2325-4f10-474f-bf16-d240cc5edabb

📥 Commits

Reviewing files that changed from the base of the PR and between 77a7714 and ab0314c.

📒 Files selected for processing (26)
  • apollo/subgraph.ts
  • components/DelegatorList/index.tsx
  • components/GatewayList/index.tsx
  • components/OrchestratingView/index.tsx
  • components/OrchestratorList/index.tsx
  • components/PerformanceList/index.tsx
  • components/RoundStatus/index.tsx
  • components/Table/index.tsx
  • components/TransactionsList/index.tsx
  • hooks/index.tsx
  • hooks/useExplorerStore.tsx
  • hooks/usePersistedExplorerListState.ts
  • hooks/useSubgraphHealth.ts
  • layouts/main.tsx
  • lib/api/ssr.ts
  • lib/api/types/get-current-round.ts
  • lib/api/types/get-performance.ts
  • pages/api/current-round.tsx
  • pages/api/pending-stake/[address].tsx
  • pages/api/score/[address].tsx
  • pages/api/subgraph-health.tsx
  • pages/gateways.tsx
  • pages/index.tsx
  • pages/orchestrators.tsx
  • pages/transactions.tsx
  • queries/meta.graphql
💤 Files with no reviewable changes (1)
  • lib/api/ssr.ts

Comment thread hooks/useSubgraphHealth.ts
Comment thread pages/api/current-round.tsx
@moudi-network
moudi-network force-pushed the feat/711/delegators-view branch from ab0314c to 29403dc Compare July 24, 2026 13:59
@mazlumtoprak

mazlumtoprak commented Jul 24, 2026

Copy link
Copy Markdown
screenshot The text for the headers seems to be wrapping into two lines, not sure if this is intentional. Also some conflicts with the main. @moudi-network

Fixed this with bc916b0 . Setting whitespace to nowrap

image

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.

Add a delegator list to the orchestrator detail view

5 participants