Skip to content

fix(frontend): keep bundle pagination page count correct after deletes - #2787

Merged
riderx merged 4 commits into
mainfrom
cursor/fix-bundle-pagination-after-delete-e820
Jul 29, 2026
Merged

fix(frontend): keep bundle pagination page count correct after deletes#2787
riderx merged 4 commits into
mainfrom
cursor/fix-bundle-pagination-after-delete-e820

Conversation

@riderx

@riderx riderx commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary (AI generated)

  • Fixed DataTable pagination so last-page / next controls use a fixed page size (offset) instead of the current page’s row count
  • Passed offset from bundle and other server-side tables (channels, devices, history, apps, builds already passed it)
  • Clamped the current page in BundleTable when deletes shrink the total below the active page

Motivation (AI generated)

After deleting bundles, the last page often has fewer rows than the page size. DataTable previously treated that short page length as the page size, so “last page” and “next” calculated too many pages and produced empty/weird navigation.

Business Impact (AI generated)

Improves console UX for customers managing large bundle lists so pagination stays trustworthy after cleanup/deletes.

Test Plan (AI generated)

  • Open an app with enough bundles for multiple pages
  • Go to the last page and confirm the next/last controls are disabled when appropriate
  • Delete one or more bundles (normal or unsafe) and confirm total/page controls update
  • From a high page URL after deletes, confirm the table clamps to the new last page instead of showing empty results
  • Smoke-check channels/devices tables still paginate correctly

Generated with AI

Open in Web Open in Cursor 

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added consistent fixed page-size and pagination offset support across application, channel, device, bundle, and history tables.
  • Improvements
    • Enhanced pagination controls and the “showing X–Y” row range to match the effective page size.
  • Bug Fixes
    • Added safeguards to keep the current page valid when total results change (for example, after deletions), preventing out-of-range navigation.

Inferring page size from the current page length made last-page/next
controls jump past real pages when the final page was short after
bundle deletes. Use an explicit offset and clamp out-of-range pages.

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 36 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

Run ID: 09fcc9f5-c949-4646-b8fa-d20d9b32df20

📥 Commits

Reviewing files that changed from the base of the PR and between 50eb6d5 and c1c6998.

📒 Files selected for processing (3)
  • src/components/tables/BundleTable.vue
  • src/components/tables/ChannelTable.vue
  • src/services/tablePagination.ts
📝 Walkthrough

Walkthrough

DataTable now supports fixed page sizes for pagination calculations. App and table components pass explicit offsets, while BundleTable clamps and refetches when updated totals invalidate the current page.

Changes

Pagination behavior

Layer / File(s) Summary
DataTable fixed page calculations
src/components/DataTable.vue
Adds an optional fixed page-size prop and uses it for total pages, displayed ranges, next-page checks, and fast-forward behavior.
Fixed page-size propagation
src/components/tables/AppTable.vue, src/pages/apps.vue, src/components/tables/*Table.vue
Exposes and forwards offset values from application and table consumers to DataTable.
BundleTable page correction
src/components/tables/BundleTable.vue
Updates totals before processing results, clamps invalid pages, refetches when needed, and passes the offset to DataTable.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TableView
  participant DataTable
  participant BundleTable
  participant DataSource
  TableView->>DataTable: provide offset and total
  DataTable->>TableView: emit current page changes
  BundleTable->>DataSource: fetch page data and count
  DataSource-->>BundleTable: return elements and total
  BundleTable->>BundleTable: clamp out-of-range current page
  BundleTable->>DataTable: provide corrected offset and elements
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and test plan, but it omits the required Checklist and Screenshots sections. Add the missing Checklist section and include screenshots or note that none are needed, keeping the required template headings.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main fix: bundle pagination page counts after deletes.
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.

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

@codspeed-hq

codspeed-hq Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing cursor/fix-bundle-pagination-after-delete-e820 (c1c6998) with main (622efa9)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cursor
cursor Bot marked this pull request as ready for review July 29, 2026 16:23
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_9c58f203-7b79-400e-b5bb-ac80af413982)

@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: 1

🤖 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 `@src/components/tables/BundleTable.vue`:
- Around line 250-257: Update the pagination handling in getData so the
clamped-page refetch is awaited before the invocation clears isLoading, keeping
loading active until fresh rows arrive. Coordinate the currentPage update with
the DataTable automatic reload mechanism to prevent issuing both the automatic
request and the explicit getData request.
🪄 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

Run ID: 60d4d4d0-21bf-4f46-8959-457633eb5384

📥 Commits

Reviewing files that changed from the base of the PR and between 622efa9 and 8b6e609.

📒 Files selected for processing (8)
  • src/components/DataTable.vue
  • src/components/tables/AppTable.vue
  • src/components/tables/BundleTable.vue
  • src/components/tables/ChannelHistoryTable.vue
  • src/components/tables/ChannelTable.vue
  • src/components/tables/DeviceTable.vue
  • src/components/tables/HistoryTable.vue
  • src/pages/apps.vue
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

Comment thread src/components/tables/BundleTable.vue Outdated
Keep loading state true until the out-of-range page refetch finishes.

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@cursor
cursor Bot temporarily deployed to deepsec-pr July 29, 2026 16:31 Inactive
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_73cd145c-4f37-40f6-a38f-f3d7420f77a6)

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

♻️ Duplicate comments (1)
src/components/tables/BundleTable.vue (1)

250-257: ⚠️ Potential issue | 🟡 Minor

Avoid refetching the clamped page twice.

currentPage.value = maxPage can trigger DataTable’s automatic reload, while this branch also calls await getData(). That can issue two requests for the same page and allow the last response to overwrite the table state. Make one path authoritative: suppress the automatic reload for this correction or rely on it instead of explicitly refetching.

🤖 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 `@src/components/tables/BundleTable.vue` around lines 250 - 257, Update the
clamped-page handling in getData so changing currentPage.value to maxPage does
not trigger a second fetch alongside the explicit await getData() call. Make the
correction path authoritative by suppressing DataTable’s automatic reload while
retaining the awaited refetch, and preserve the existing loading and return
behavior.
🤖 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.

Duplicate comments:
In `@src/components/tables/BundleTable.vue`:
- Around line 250-257: Update the clamped-page handling in getData so changing
currentPage.value to maxPage does not trigger a second fetch alongside the
explicit await getData() call. Make the correction path authoritative by
suppressing DataTable’s automatic reload while retaining the awaited refetch,
and preserve the existing loading and return behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 68183945-6eb2-4a25-9cf3-d0004aaf4490

📥 Commits

Reviewing files that changed from the base of the PR and between 8b6e609 and 50eb6d5.

📒 Files selected for processing (1)
  • src/components/tables/BundleTable.vue
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/components/tables/ChannelTable.vue
Keep the table on a valid page when the last item on a page is deleted,
matching BundleTable pagination behavior.

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@cursor
cursor Bot temporarily deployed to deepsec-pr July 29, 2026 16:38 Inactive
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_10f7de32-ca75-4054-b29a-b4e96f00c5e9)

Extract clamp-and-refetch into one helper so BundleTable and ChannelTable
do not duplicate pagination recovery after deletes.

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@cursor
cursor Bot temporarily deployed to deepsec-pr July 29, 2026 16:47 Inactive
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_d7b42931-d91a-44ee-bcc3-931c38f49606)

@riderx
riderx merged commit 8e3f630 into main Jul 29, 2026
53 of 73 checks passed
@riderx
riderx deleted the cursor/fix-bundle-pagination-after-delete-e820 branch July 29, 2026 16:54
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants