fix(ui): prevent duplicate elements on repeated clicks#598
Merged
Conversation
Entire-Checkpoint: ee8fe3150e4d
jbykkk
commented
Apr 13, 2026
Contributor
Author
jbykkk
left a comment
There was a problem hiding this comment.
感谢添加的测试用例!祝Voyager越来越好!
Entire-Checkpoint: 3fe59bb3cebc
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.
Description / 描述
修复了在文件夹模块下,“导入/导出文件夹”和“创建文件夹”两个按钮多次点击后会被多次触发导致窗口多开的问题。
主要更改 (Changes Made):
FolderManager中添加实例变量(activeFolderInput,activeImportExportMenu,activeImportDialog)来严格跟踪当前活跃的 UI 元素,实现单例行为。MutationObserver监听document.body的实现方案。将状态清理逻辑明确绑定到相关 DOM 元素的.remove()生命周期中(如保存、取消或点击外部区域时),从根本上避免了潜在的内存泄漏和性能衰退。Related Issue / 相关 Issue
我已提出相关bug修复的Issue #597。
Visual Proof / 可视化证据
问题图片已经在Issue中给出,这里只做在Firefox和Chrome浏览器上修复后的效果展示。
Firefox展示录屏如下:
firefox.mov
Chrome界面展示录屏如下:
chrome.mov
Browser Testing / 浏览器测试
Checklist / 检查清单
bun run lint,bun run typecheck,bun run formatandbun run build. / 我已运行代码校验、类型检查、格式化及构建。bun run test). / 我已添加/更新了必要的测试并确保通过(bun run test)。