Skip to content

fix: correct off-by-one in PageOverview row count - #858

Closed
add-uos wants to merge 1 commit into
linuxdeepin:masterfrom
add-uos:agent/bug/08bc251c0414
Closed

add-uos wants to merge 1 commit into
linuxdeepin:masterfrom
add-uos:agent/bug/08bc251c0414

Conversation

@add-uos

@add-uos add-uos commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

fix: correct off-by-one in PageOverview row count

  1. Root cause: PageOverview::updateInfo passed row-1 to
    setColumnAndRow, but DetailTreeView reserves the last row
    for expand/collapse button, requiring N+1 rows for N items
  2. Fix: change setColumnAndRow(row-1) to setColumnAndRow(row+1)
    to match PageSingleInfo and PageBoardInfo behavior
  3. Impact: single-item maps now display correctly, multi-item
    maps no longer lose the last row to silent out-of-bounds

Log: fix overview table showing empty or missing last item

Influence:

  1. Test overview page with single item in map
  2. Test overview page with multiple items in map
  3. Verify all items display correctly in overview table

fix: 修复概览页表格行数差一错误

  1. 根因:PageOverview::updateInfo 传入 row-1 给 setColumnAndRow,
    但 DetailTreeView 保留最后一行用于展开/收起按钮,N 条数据需要 N+1 行
  2. 方案:将 setColumnAndRow(row-1) 改为 setColumnAndRow(row+1),
    与 PageSingleInfo 和 PageBoardInfo 保持一致
  3. 影响:单条目 map 不再显示空表格,多条目 map 不再丢失末行数据

Log: 修复概览页表格显示为空或缺少最后一项的问题

Influence:

  1. 测试概览页 map 仅含单条目时的显示
  2. 测试概览页 map 含多条目时的显示
  3. 验证概览页表格所有条目均正确显示

PMS: BUG-3

Summary by Sourcery

Bug Fixes:

  • Fix the overview table row count so single-item and multi-item maps display all entries correctly.

1. Root cause: PageOverview::updateInfo passed row-1 to
   setColumnAndRow, but DetailTreeView reserves the last row
   for expand/collapse button, requiring N+1 rows for N items
2. Fix: change setColumnAndRow(row-1) to setColumnAndRow(row+1)
   to match PageSingleInfo and PageBoardInfo behavior
3. Impact: single-item maps now display correctly, multi-item
   maps no longer lose the last row to silent out-of-bounds

Log: fix overview table showing empty or missing last item

Influence:
1. Test overview page with single item in map
2. Test overview page with multiple items in map
3. Verify all items display correctly in overview table

fix: 修复概览页表格行数差一错误

1. 根因:PageOverview::updateInfo 传入 row-1 给 setColumnAndRow,
   但 DetailTreeView 保留最后一行用于展开/收起按钮,N 条数据需要 N+1 行
2. 方案:将 setColumnAndRow(row-1) 改为 setColumnAndRow(row+1),
   与 PageSingleInfo 和 PageBoardInfo 保持一致
3. 影响:单条目 map 不再显示空表格,多条目 map 不再丢失末行数据

Log: 修复概览页表格显示为空或缺少最后一项的问题

Influence:
1. 测试概览页 map 仅含单条目时的显示
2. 测试概览页 map 含多条目时的显示
3. 验证概览页表格所有条目均正确显示

PMS: BUG-3
@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Sorry @add-uos, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 days and 9 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026

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

Reviewer's Guide

Fixes an off-by-one row allocation in PageOverview by reserving the additional DetailTreeView control row, preventing empty single-item tables and missing final entries in multi-item maps.

Flow diagram for PageOverview row allocation

flowchart TD
    A[PageOverview::updateInfo receives map] --> B[Count map entries as row]
    B --> C["mp_Overview.setColumnAndRow(row + 1)"]
    C --> D[DetailTreeView reserves final control row]
    D --> E[All map entries display correctly]
Loading

File-Level Changes

Change Details Files
Correct the overview table row allocation to account for the reserved expand/collapse control row.
  • Replace the row count calculation from row - 1 to row + 1.
  • Align PageOverview behavior with the row sizing used by the other page views.
  • Ensure single-item and multi-item maps retain all displayed entries.
deepin-devicemanager/src/Page/PageOverview.cpp

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

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交修复了 PageOverview::updateInfo 中表格行数的 off-by-one 错误,将 setColumnAndRow(row - 1) 修正为 setColumnAndRow(row + 1),确保表格行数充足。变更最小且聚焦,四维度均无问题,OCR 审查也未发现任何问题。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: []


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: []


💡 改进建议代码示例


本报告由 AI 代码审查工具自动生成

@add-uos add-uos closed this Oct 26, 2026
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