Skip to content

doc(Table): update fix column sample code#8057

Merged
ArgoZhang merged 4 commits into
mainfrom
feat-table-FixedColumn
May 27, 2026
Merged

doc(Table): update fix column sample code#8057
ArgoZhang merged 4 commits into
mainfrom
feat-table-FixedColumn

Conversation

@Tony-ST0754

@Tony-ST0754 Tony-ST0754 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

feat(Table): 当表格ShowLineNo属性为true,且表格中有列属性Fixed为true时,FixedLineNoColumn该属性自动为true

Link issues

fixes #8056

问题描述 / Problem Description

doc(Table): update fix column sample code

影响范围 / Impact

对老用户无影响

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

Automatically fix the table line-number column when other columns are fixed and clarify related persisted state behavior.

New Features:

  • Automatically fix the line-number column when ShowLineNo is enabled and any data column is fixed.

Enhancements:

  • Ensure the line-number fixed behavior also works correctly with persisted table layouts.
  • Clarify documentation for FixedLineNoColumn behavior and table width persistence metadata.

…mn该属性自动为true

feat(Table): 当表格ShowLineNo属性为true,且表格中有列属性Fixed为true时,FixedLineNoColumn该属性自动为true
@bb-auto

bb-auto Bot commented May 26, 2026

Copy link
Copy Markdown

Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@sourcery-ai

sourcery-ai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the Table component so that when row numbers are shown and any data column is fixed, the LineNo column automatically becomes fixed (including after state persistence), and clarifies related property documentation.

Sequence diagram for automatic LineNo column fixing in Table rendering

sequenceDiagram
    participant BlazorRenderer
    participant Table as TableComponent
    participant Column as TableColumn

    BlazorRenderer->>Table: RenderContentRow(item)
    loop ForEachVisibleColumn
        Table->>Column: Access Fixed
        alt ShowLineNo && Column.Fixed && !FixedLineNoColumn
            Table->>Table: FixedLineNoColumn = Column.Fixed
            Table->>Table: StateHasChanged()
        end
        Table->>BlazorRenderer: RenderContentCell(context)
    end
Loading

File-Level Changes

Change Details Files
Auto-fix LineNo column when ShowLineNo is enabled and any column is fixed, including during persisted state rendering.
  • Within row rendering, detect when ShowLineNo is true, a column is fixed, and FixedLineNoColumn is false, then set FixedLineNoColumn to true
  • Trigger StateHasChanged after auto-setting FixedLineNoColumn to ensure correct behavior when loading persisted configurations
  • Minor formatting tweak in the content-row rendering loop
src/BootstrapBlazor/Components/Table/Table.razor.cs
Document the new auto-fix behavior on the FixedLineNoColumn parameter.
  • Update Chinese and English XML doc comments for FixedLineNoColumn to state that it automatically becomes true when there are fixed columns in the table
src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs
Clarify semantics of TableWidth in client status persistence.
  • Adjust XML doc comments to explain that TableWidth = 0 means the table width is auto-sized
src/BootstrapBlazor/Components/Table/TableColumnClientStatus.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#8056 When the table has ShowLineNo = true and at least one column with Fixed = true, automatically set FixedLineNoColumn to true so that the line number column is fixed during horizontal scrolling.

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

@bb-auto bb-auto Bot requested a review from ArgoZhang May 26, 2026 14:35
@bb-auto bb-auto Bot added the enhancement New feature or request label May 26, 2026
@bb-auto bb-auto Bot added this to the v10.6.0 milestone May 26, 2026

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

Hey - I've left some high level feedback:

  • The logic that sets FixedLineNoColumn and calls StateHasChanged() inside RenderContentRow introduces side effects during rendering and risks unnecessary re-renders or render loops; consider computing this once (e.g., in OnParametersSet/OnAfterRender) based on the column metadata instead of mutating state from within the cell render loop.
  • FixedLineNoColumn is a [Parameter] but is being mutated inside the component; if consumers can set this parameter explicitly, it would be clearer either to treat it as internal state (with a backing field) or to introduce a separate internal flag so the component does not overwrite a value controlled by the parent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The logic that sets `FixedLineNoColumn` and calls `StateHasChanged()` inside `RenderContentRow` introduces side effects during rendering and risks unnecessary re-renders or render loops; consider computing this once (e.g., in `OnParametersSet`/`OnAfterRender`) based on the column metadata instead of mutating state from within the cell render loop.
- `FixedLineNoColumn` is a `[Parameter]` but is being mutated inside the component; if consumers can set this parameter explicitly, it would be clearer either to treat it as internal state (with a backing field) or to introduce a separate internal flag so the component does not overwrite a value controlled by the parent.

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.

@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8057   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          766       766           
  Lines        34155     34155           
  Branches      4697      4697           
=========================================
  Hits         34155     34155           
Flag Coverage Δ
BB 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.

@ArgoZhang ArgoZhang changed the title feat(Table): 当表格ShowLineNo属性为true,且表格中有列属性Fixed为true时,FixedLineNoColumn该属性自动为true doc(Table): update fix column sample code May 27, 2026
@ArgoZhang ArgoZhang merged commit e74637c into main May 27, 2026
4 checks passed
@ArgoZhang ArgoZhang deleted the feat-table-FixedColumn branch May 27, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc(Table): update fix column sample code

2 participants