fix: fix notification text being truncated after replace#1619
Conversation
Replace dataChanged signal with remove+insert row operations to force ListView to recalculate delegate size, preventing notification content from being clipped. Log: Fixed notification text truncation issue after replacement Influence: 1. Test notification replacement with various text lengths 2. Verify notification bubble height adapts to content 3. Test multiple rapid replacements for stability 4. Verify notification text is fully visible after each replace fix: 修复通知替换后文字被截断问题 将 dataChanged 信号替换为移除+插入行操作,强制 ListView 重新计算委托大 小,防止通知内容被裁剪。 Log: 修复通知替换后文字截断问题 Influence: 1. 测试不同文本长度下的通知替换功能 2. 验证通知气泡高度能自适应内容 3. 测试多次快速替换的稳定性 4. 验证每次替换后通知文字完整可见
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReworks bubble replacement in the notification model to use remove/insert row operations instead of dataChanged so that the view recreates delegates and recalculates ListView item height, preventing notification text from being visually truncated after replacement. Sequence diagram for notification bubble replacement using remove/insert rowssequenceDiagram
participant ListView
participant BubbleModel
ListView->>BubbleModel: replaceBubble(bubble)
activate BubbleModel
BubbleModel->>BubbleModel: beginRemoveRows(QModelIndex, replaceIndex, replaceIndex)
BubbleModel->>BubbleModel: m_bubbles.removeAt(replaceIndex)
BubbleModel-->>ListView: rowsRemoved
BubbleModel->>BubbleModel: endRemoveRows()
BubbleModel->>BubbleModel: beginInsertRows(QModelIndex, replaceIndex, replaceIndex)
BubbleModel->>BubbleModel: m_bubbles.insert(replaceIndex, bubble)
BubbleModel-->>ListView: rowsInserted
BubbleModel->>BubbleModel: endInsertRows()
deactivate BubbleModel
rect rgba(200,200,255,0.2)
Note over ListView: ListView recreates delegates and recalculates item height
end
%% Previous behavior (now removed)
%% ListView->>BubbleModel: replaceBubble(bubble)
%% BubbleModel->>BubbleModel: m_bubbles.replace(replaceIndex, bubble)
%% BubbleModel-->>ListView: dataChanged(index, index)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review你好!我是CodeGeeX。我已仔细审查了你提供的 Git Diff 代码。这次修改的核心目的是通过 整体思路上,使用 以下是详细的审查意见和改进建议: 1. 语法与逻辑 (内存管理隐患 - 严重)在原代码中, 问题: 改进建议: 2. 代码性能 (视图刷新开销)使用 改进建议:
3. 代码安全 (空指针与越界风险)代码中 改进建议: 改进后的代码示例结合以上分析,我为你提供两个版本的改进代码: 版本一:基于你当前的
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, fly602 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
Replace dataChanged signal with remove+insert row operations to force
ListView to recalculate delegate size, preventing notification content
from being clipped.
Log: Fixed notification text truncation issue after replacement
Influence:
fix: 修复通知替换后文字被截断问题
将 dataChanged 信号替换为移除+插入行操作,强制 ListView 重新计算委托大
小,防止通知内容被裁剪。
Log: 修复通知替换后文字截断问题
Influence:
Summary by Sourcery
Bug Fixes: