Repository navigation
Conversation
同一连接可以同时打开多个终端分屏,每个分屏的侧栏文件管理器面板都订阅全局 SFTP 执行器并按连接身份过滤;一笔传输结束时所有面板各弹一条「上传完成」, 用户因此看到多条重复提示(issue #499)。 把完成提示的通知 id 固定为传输 id(Notification::id1):后到的同 id 提示 替换先到的,任一窗口最终只保留一条;不同传输 id 不同,仍各自提示。ZMODEM 路径不涉及跨面板重复,保持不变。 - 新增 TransferFinishNotification 标记类型与 notify_transfer_finish 的 transfer_id 参数 - 新增回归测试 duplicate_panels_collapse_finish_toast_into_one:同一窗口 两个同连接面板完成同一笔下载后只保留一条通知(修复前实测 2 条) Refs #499
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
issue #499 报告:覆盖上传一个文件成功后,会弹出 3 个「上传成功」提示框。
根因:同一连接可以同时打开多个终端分屏,每个分屏的侧栏各有一个
FileManagerPanel,都在构造时订阅同一个全局 SFTP 执行器,并按连接身份(SftpConnectionIdentity,同连接各分屏一致)过滤事件。一笔传输进入Finished时,所有面板都会push_notification一条随机 id 的成功提示,于是弹出 N 条。ToastManager 只在同 id 时替换,所以随机 id 无法去重。本 PR 的提交
b1940928efix(terminal): 按传输 id 去重上传/下载完成提示,修复多分屏重复弹窗FileManagerPanel::notify_transfer_finish增加transfer_id参数,通知改用Notification::id1::<TransferFinishNotification>(("sftp-transfer-finish", transfer_id.as_u64()))固定 idbackground_tasks.rs)不存在跨面板重复,保持不变验证
duplicate_panels_collapse_finish_toast_into_one:同一窗口内构造两个同连接面板,完成同一笔下载后断言通知数为 1;临时移除id1去重后该测试得到 2,可复现 issue 现象cargo test -p terminal_view --lib(573 passed)cargo check -p terminal_view --all-targets(通过)cargo clippy -p terminal_view --all-targets:改动文件无新增 warning(仓库既有的 one_ui/ssh 基线 lint 仍存在)说明
不含 CHANGELOG 与版本 bump。issue 正文里的「会话级不再确认覆盖」属于独立功能建议,未包含在本修复内。