Repository navigation
fix: keep the device list usable while the scanners are enumerated - #47
Conversation
Reviewer's GuideThe PR keeps the scanner manager responsive during slow SANE discovery by presenting local cameras immediately, replacing the modal loader with a parented movable overlay, and representing scanner enumeration in the title row until completion; it also adds diagnostics and refreshes the maintained translation catalogs. Sequence diagram for responsive device enumerationsequenceDiagram
actor User
participant MainWindow
participant ScannersWidget
participant ScannerDevice
participant ScannerWorker
participant SANE
User->>MainWindow: updateDeviceList()
MainWindow->>ScannersWidget: setScannerSearching(true)
MainWindow->>ScannersWidget: updateDeviceList(scanner, webcam)
ScannersWidget->>ScannersWidget: rebuildList()
ScannersWidget-->>User: Show local cameras and searching state
MainWindow->>ScannerDevice: requestAvailableDevices()
ScannerDevice->>ScannerWorker: doGetAvailableDevices()
ScannerWorker->>SANE: sane_get_devices()
Note over User,ScannersWidget: Window and camera entries remain usable while enumeration runs
SANE-->>ScannerWorker: device list
ScannerWorker-->>ScannerDevice: availableDevicesReady(deviceNames)
ScannerDevice-->>MainWindow: availableDevicesReady(deviceNames)
MainWindow->>ScannersWidget: setScannerSearching(false)
MainWindow->>ScannersWidget: updateDeviceList(scanner, webcam)
ScannersWidget->>ScannersWidget: rebuildList()
ScannersWidget-->>User: Show scanners and final empty state if needed
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The device list was covered by a modal loading overlay until the SANE enumeration returned, so nothing was usable for as long as the backend needed. The overlay is a child widget now and follows the window, the cameras are listed immediately while the scanning state moves to the title row, and the empty state appears only when no enumeration is in flight. The four maintainable .ts files were refreshed. 设备列表原本被模态加载浮层挡住,SANE 枚举返回前界面完全不可用。现改为窗口内的子控件浮层并随 窗口移动,本地摄像头立即列出、"正在搜索"移到标题行,只有枚举全部结束才显示空状态;同时刷新 四个可维护的 .ts 翻译文件。 Log: 加载设备列表期间界面不再阻塞,进入扫描管理器即可见本地设备 PMS: BUG-316711 Influence: 加载期间窗口可拖动、列表可交互、无摄像头时不再与"正在加载设备..."同时显示"未找到设备";打包构建不再产生 translations/ 的改动。
d2078e9 to
4827ed4
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 代码逻辑整体正确,边界条件处理完善。availableDevicesReady 回调中的重试机制设计合理,showScanView 中的防重复打开检查正确。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 注释质量优秀,每个改动都附有详尽的设计理由说明。addPlaceholder() 方法的提取消除了代码重复。LoadingDialog 从模态对话框改为子组件覆盖层的设计合理。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 本次修改显著提升了用户体验性能:移除了阻塞式模态加载对话框和首次运行3秒延迟,设备列表立即可用。QElapsedTimer 诊断计时开销可忽略不计。eventFilter 仅在可见时响应 Resize 事件,设计高效。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 本次修改不涉及用户输入处理、网络操作、文件路径操作等安全敏感场景。新增的日志输出仅包含设备枚举耗时和设备数量,不泄露敏感信息。 💡 改进建议代码示例// 暂无代码示例本报告由 AI 代码审查工具自动生成 |
|
/retest |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, re2zero 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 |
|
/merge |
|
This pr cannot be merged! (status: unstable) |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
fix: keep the device list usable while the scanners are enumerated
The device list was covered by a modal loading overlay until the SANE
enumeration returned, so nothing was usable for as long as the backend needed.
The overlay is a child widget now and follows the window, the cameras are
listed immediately while the scanning state moves to the title row, and the
empty state appears only when no enumeration is in flight. The four
maintainable .ts files were refreshed.
设备列表原本被模态加载浮层挡住,SANE 枚举返回前界面完全不可用。现改为窗口内的子控件浮层并随
窗口移动,本地摄像头立即列出、"正在搜索"移到标题行,只有枚举全部结束才显示空状态;同时刷新
四个可维护的 .ts 翻译文件。
Log: 加载设备列表期间界面不再阻塞,进入扫描管理器即可见本地设备
PMS: BUG-316711
Influence: 加载期间窗口可拖动、列表可交互、无摄像头时不再与"正在加载设备..."同时显示"未找到设备";打包构建不再产生 translations/ 的改动。
Summary by Sourcery
Keep the device manager interactive while scanner devices are being discovered.
New Features:
Bug Fixes:
Enhancements:
Chores: