Skip to content

Paginate the list/table renders the audit missed (#475)#489

Merged
NotYuSheng merged 2 commits into
mainfrom
feature/pagination-tier1-fixes
Jul 8, 2026
Merged

Paginate the list/table renders the audit missed (#475)#489
NotYuSheng merged 2 commits into
mainfrom
feature/pagination-tier1-fixes

Conversation

@NotYuSheng

@NotYuSheng NotYuSheng commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Fixes the Tier-1 gaps found when re-auditing #475 properly (after a user spotted an unpaginated Changes tab). See the reopened #475 accounting — the original audit triaged container components by filename and missed the lists they host, and the drift panels were flagged but only their data source (#480) was fixed, never the badge rendering.

Changes (all use the shared common/Pagination)

Component Was Now
ConversationDetail — packets table rendered every packet (backend loads them uncapped) — a 15k-packet conversation = 15k DOM rows pages at 50; a ?highlight deep-link jumps to the page holding that packet
SnapshotDetailModal — Changes tab snapshotEvents.map(), all events pages at 15 (matches the already-paged network-wide ChangeEventsSection) — the user-spotted one
NodeDetails — peers + history all peers of a node; full capture history peers 15/pg, history 10/pg
IpDriftPanel / ProtocolDriftPanel — badge clouds all badges per-group pagination (50/pg) inside the shared badge-group component, preserving subnet / app-vs-protocol grouping
DeviceDriftPanel — MAC badge cloud all badges combined active/absent list paged at 50

All clamp the page in render and reset on search/filter change, so a shrinking list can't strand the view (the lessons from #479/#481).

Verification (Playwright, real over-threshold data, zero console errors)

  • ConversationDetail: the 15,075-packet conversation renders 50 rows ("Showing 1 to 50 of 15075"), page 3 → "101 to 150". Previously 15k rows in the DOM.
  • Drift panels: a 213-IP group pages at 50 ("1 to 50 of 213"); app/protocol groups "1 to 50 of 125" / "of 85".
  • Changes tab: a 30-event snapshot pages at 15 ("1 to 15 of 30").
  • tsc --noEmit clean; docker compose up -d --build succeeds.

Not in this PR

Tier-2 (chat log, filter-option lists, per-payload hex, LLM timelines) — documented as conventionally-acceptable in #475, deferred.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added pagination to several detail and monitoring views, including packets, device/IP/protocol badges, snapshot changes, node connections, and history.
    • Large lists now load in smaller pages with navigation controls, making tables and badge groups easier to scan.
    • Deep links to specific packet rows continue to work correctly with the new paged view.

The #475 audit triaged several container components by filename and missed the
unbounded lists they host; the drift panels were flagged but only their data
source (#480) was fixed, never the badge rendering. Paginate all of them with
the shared common/Pagination component:

- ConversationDetail — packets table rendered every packet (the backend loads
  them uncapped); a 15k-packet conversation put 15k rows in the DOM. Now pages
  at 50, and a ?highlight deep-link jumps to the page holding that packet.
- SnapshotDetailModal — Changes tab paginates a snapshot's change events (15/pg),
  matching the already-paged network-wide ChangeEventsSection.
- NodeDetails — peers table (15/pg) and capture-history list (10/pg).
- IpDriftPanel / ProtocolDriftPanel — per-group badge pagination (50/pg) inside
  the shared badge-group component, preserving the subnet / app-vs-protocol
  grouping.
- DeviceDriftPanel — paginates the combined active/absent MAC badge cloud (50/pg).

All clamp the page in render and reset on search/filter change so a shrinking
list can't strand the view.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 24 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ece8122d-c0a1-4f1e-872a-76b822cb144f

📥 Commits

Reviewing files that changed from the base of the PR and between 885007d and 289938b.

📒 Files selected for processing (4)
  • frontend/src/components/conversation/ConversationDetail/ConversationDetail.tsx
  • frontend/src/components/monitor/IpDriftPanel/IpDriftPanel.tsx
  • frontend/src/components/monitor/ProtocolDriftPanel/ProtocolDriftPanel.tsx
  • frontend/src/components/network/NodeDetails/NodeDetails.tsx
📝 Walkthrough

Walkthrough

Six frontend components (ConversationDetail, DeviceDriftPanel, IpDriftPanel, ProtocolDriftPanel, SnapshotDetailModal, NodeDetails) add local pagination state, page-size constants, and a shared Pagination control to previously fully-rendered lists of packets, badges, changes, peers, and history entries, slicing data for the current page.

Changes

Client-side pagination rollout

Layer / File(s) Summary
ConversationDetail packet pagination
frontend/src/components/conversation/ConversationDetail/ConversationDetail.tsx
Adds packetPage/packetPageSize state, derives visiblePackets, updates deep-link highlight logic to use page size, adjusts row numbering, and adds a Pagination footer shown above 10 packets.
DeviceDriftPanel badge pagination
frontend/src/components/monitor/DeviceDriftPanel/DeviceDriftPanel.tsx
Adds page state and BADGE_PAGE_SIZE, combines active/absent badges into a sliced pageItems list, resets page on search, and renders a conditional Pagination control.
IpDriftPanel badge pagination
frontend/src/components/monitor/IpDriftPanel/IpDriftPanel.tsx
Adds BADGE_GROUP_PAGE_SIZE and page state to IpBadgeGroup, slices combined badges into pageItems, and renders a Pagination control for multi-page groups.
ProtocolDriftPanel badge pagination
frontend/src/components/monitor/ProtocolDriftPanel/ProtocolDriftPanel.tsx
Adds BADGE_GROUP_PAGE_SIZE and page state to BadgeGroup, slices combined active/absent list into pageItems, and renders a conditional Pagination control.
SnapshotDetailModal changes-tab pagination
frontend/src/components/monitor/SnapshotDetailModal/SnapshotDetailModal.tsx
Adds changesPage state and CHANGES_PAGE_SIZE, slices snapshotEvents for display, and renders a Pagination control when multiple pages exist.
NodeDetails peers and history pagination
frontend/src/components/network/NodeDetails/NodeDetails.tsx
Adds peersPage/historyPage state and HISTORY_PAGE_SIZE, derives visiblePeers/visibleHistory slices, updates both tables' row rendering, and adds Pagination controls for connections and history.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

Not applicable — the changes apply a consistent, repetitive pagination pattern across independent UI components without multi-component sequential interactions warranting a diagram.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding pagination to previously unbounded list/table renders missed by the audit.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces pagination across several components (including ConversationDetail, DeviceDriftPanel, IpDriftPanel, ProtocolDriftPanel, SnapshotDetailModal, and NodeDetails) to prevent rendering hundreds of badges or table rows at once, improving performance and usability. The review feedback highlights critical state-management issues where pagination and expansion states are not reset when switching between different entities (such as conversations or nodes) or when filtering lists via search. These omissions can cause users to be stranded on out-of-bounds pages or experience unexpected page jumps, and the reviewer has provided actionable code suggestions to reset these states using useEffect hooks.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread frontend/src/components/monitor/IpDriftPanel/IpDriftPanel.tsx
Comment thread frontend/src/components/network/NodeDetails/NodeDetails.tsx

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

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 `@frontend/src/components/monitor/DeviceDriftPanel/DeviceDriftPanel.tsx`:
- Around line 109-118: The combined active/absent badge pagination logic is
duplicated in DeviceDriftPanel, IpDriftPanel, and ProtocolDriftPanel, so it
should be centralized to prevent divergence. Extract the shared behavior
currently in the badge-group logic into a reusable hook or generic component,
such as a paged-badge helper used by DeviceDriftPanel, IpBadgeGroup, and
BadgeGroup, and make those panels consume that shared implementation for
building the combined list, calculating currentPage/totalPages, slicing
pageItems, and rendering pagination controls.

In `@frontend/src/components/monitor/ProtocolDriftPanel/ProtocolDriftPanel.tsx`:
- Around line 52-63: The BadgeGroup pagination state in ProtocolDriftPanel is
not reset when the search filter changes, so users can stay on a stale page
after results shrink. Update the search onChange handler and/or the BadgeGroup
state flow in ProtocolDriftPanel.tsx to reset the local page state back to 1
whenever the filtered items/absentItems input changes, matching the behavior in
DeviceDriftPanel and keeping pagination aligned with the current filtered
results.

In `@frontend/src/components/network/NodeDetails/NodeDetails.tsx`:
- Around line 67-69: The peer/history pagination state in NodeDetails is not
being reset when the selected node changes, so users can carry over stale page
numbers between nodes. Update NodeDetails to reset both peersPage and
historyPage back to 1 in the existing “reset on entity change” effect that
already clears history state, and make sure the pagination logic in the node
data loaders/render paths uses those local state values consistently after a
node switch.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 14b1fe80-b27f-4756-a93e-9a7fe2c21059

📥 Commits

Reviewing files that changed from the base of the PR and between 1e0b034 and 885007d.

📒 Files selected for processing (6)
  • frontend/src/components/conversation/ConversationDetail/ConversationDetail.tsx
  • frontend/src/components/monitor/DeviceDriftPanel/DeviceDriftPanel.tsx
  • frontend/src/components/monitor/IpDriftPanel/IpDriftPanel.tsx
  • frontend/src/components/monitor/ProtocolDriftPanel/ProtocolDriftPanel.tsx
  • frontend/src/components/monitor/SnapshotDetailModal/SnapshotDetailModal.tsx
  • frontend/src/components/network/NodeDetails/NodeDetails.tsx

Comment thread frontend/src/components/network/NodeDetails/NodeDetails.tsx
…nges

The render-time clamp prevented crashes, but the stale `page` state persisted, so
clearing a search or switching entities could snap back to a stale page:

- ConversationDetail: reset packetPage + collapse expanded hex on conversation.id
  change (before the highlight effect so a deep-link's page jump still wins).
- IpBadgeGroup / BadgeGroup: reset page when the filtered item counts change
  (the parent search box).
- NodeDetails: reset peersPage + historyPage on entity change (the modal isn't
  remounted between node selections).

Addresses PR #489 review (Gemini + CodeRabbit).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@NotYuSheng NotYuSheng merged commit 4a8ee4a into main Jul 8, 2026
3 checks passed
@NotYuSheng NotYuSheng deleted the feature/pagination-tier1-fixes branch July 8, 2026 04:49
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