Skip to content

fix(Table): parameter IsTriggerByPagination not work#7754

Merged
ArgoZhang merged 2 commits intomainfrom
fix-table
Mar 8, 2026
Merged

fix(Table): parameter IsTriggerByPagination not work#7754
ArgoZhang merged 2 commits intomainfrom
fix-table

Conversation

@ArgoZhang
Copy link
Member

@ArgoZhang ArgoZhang commented Mar 8, 2026

Link issues

fixes #7753

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Bug Fixes:

  • Propagate the pagination trigger flag into the table query options so IsTriggerByPagination works as intended.

Copilot AI review requested due to automatic review settings March 8, 2026 02:48
@bb-auto bb-auto bot added the bug Something isn't working label Mar 8, 2026
@bb-auto bb-auto bot added this to the v10.4.0 milestone Mar 8, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 8, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Propagates the Table component's pagination trigger flag into the query options so that consumers can detect when data queries are caused by pagination changes.

Sequence diagram for Table pagination-triggered data query

sequenceDiagram
    participant User
    participant TableComponent
    participant QueryOptions
    participant DataProvider

    User->>TableComponent: changePage(pageIndex)
    activate TableComponent
    TableComponent->>TableComponent: QueryData(triggerByPagination = true)
    TableComponent->>QueryOptions: BuildQueryPageOptions()
    activate QueryOptions
    QueryOptions-->>TableComponent: queryOption
    deactivate QueryOptions

    TableComponent->>TableComponent: _firstQuery check
    TableComponent->>QueryOptions: set IsFirstQuery = _firstQuery
    TableComponent->>QueryOptions: set IsTriggerByPagination = true

    TableComponent->>DataProvider: OnQueryAsync(queryOption)
    activate DataProvider
    DataProvider-->>TableComponent: QueryResult
    deactivate DataProvider
    TableComponent-->>User: render paged data
    deactivate TableComponent
Loading

Updated class diagram for query options used by Table

classDiagram
    class Table~TItem~ {
        - bool _firstQuery
        + Task QueryData(bool triggerByPagination)
        + QueryPageOptions BuildQueryPageOptions()
    }

    class QueryPageOptions {
        + bool IsFirstQuery
        + bool IsTriggerByPagination
        + int PageIndex
        + int PageItems
        + string? SortName
        + bool SortOrder
        + string? SearchText
    }

    class DataProvider~TItem~ {
        + Task OnQueryAsync(QueryPageOptions options)
    }

    Table --> QueryPageOptions : builds
    Table --> DataProvider : calls OnQueryAsync
    DataProvider --> QueryPageOptions : reads flags
Loading

File-Level Changes

Change Details Files
Ensure the data query options are aware when a query is triggered via pagination.
  • Set the IsTriggerByPagination flag on the query options based on the triggerByPagination parameter in QueryData
  • Keep existing behavior for building query options and marking the first query unchanged
src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#7753 Ensure the Table component correctly propagates the IsTriggerByPagination parameter so that it affects query behavior when data is requested (e.g., during pagination-triggered queries).

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang merged commit faf8c2e into main Mar 8, 2026
4 checks passed
@ArgoZhang ArgoZhang deleted the fix-table branch March 8, 2026 02:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes Issue #7753 by ensuring the Table component correctly propagates “triggered by pagination” state into the QueryPageOptions passed to OnQueryAsync, enabling consumers to distinguish pagination-driven queries.

Changes:

  • Set QueryPageOptions.IsTriggerByPagination based on QueryData(triggerByPagination) input.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 553 to +556
var queryOption = BuildQueryPageOptions();
// Set whether it is the first query
queryOption.IsFirstQuery = _firstQuery;
queryOption.IsTriggerByPagination = triggerByPagination;
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

This change fixes QueryPageOptions.IsTriggerByPagination being left at its default, but there’s currently no Table unit test asserting the flag becomes true when a user clicks a page link. Please add/extend a test (e.g., in test/UnitTest/Components/TableTest.cs, similar to ListViewTest.Pageable_Ok) that clicks a .page-link and verifies the OnQueryAsync callback receives option.IsTriggerByPagination == true.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (25b6bb8) to head (407849b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7754   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          750       750           
  Lines        33269     33270    +1     
  Branches      4612      4612           
=========================================
+ Hits         33269     33270    +1     
Flag Coverage Δ
BB 100.00% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(Table): parameter IsTriggerByPagination not work

2 participants