fix(drag-drop): IDM 拖拽问题#2711
Conversation
Reviewer's Guide调整 FormMain 中更新后的 DragEnter 处理流程图flowchart TD
DragEnterStart["DragEnter handler start"]
CheckPrevData["Check PrevData and e.Data equality"]
ReturnPrevEffects["Set e.Effects to PrevEffects and return"]
InitEffects["Set e.Effects to None"]
SavePrevData["PrevData = e.Data"]
CheckFileDrop["e.Data.GetDataPresent(FileDrop)?"]
GetFiles["Files = e.Data.GetData(FileDrop)"]
FilesNotEmpty["Files not null and length > 0?"]
SetLinkEffect["Set e.Effects to Link"]
CheckText["e.Data.GetDataPresent(Text)?"]
GetText["Str = TryCast(e.Data.GetData(Text), String)"]
TextNull["Str is null?"]
CheckAuthlib["Str.StartsWithF(authlib-injector:yggdrasil-server:)?"]
CheckFileUri["Str.StartsWithF(file:///)?"]
CheckRootedPath["Path.IsPathRooted(Str)?"]
SetCopyEffect["Set e.Effects to Copy"]
SavePrevEffects["PrevEffects = e.Effects"]
LogEffect["Log drag effect"]
EndDragEnter["DragEnter handler end"]
DragEnterStart --> CheckPrevData
CheckPrevData -- equal --> ReturnPrevEffects
CheckPrevData -- not equal --> InitEffects
InitEffects --> SavePrevData
SavePrevData --> CheckFileDrop
CheckFileDrop -- yes --> GetFiles
GetFiles --> FilesNotEmpty
FilesNotEmpty -- yes --> SetLinkEffect
FilesNotEmpty -- no --> CheckText
CheckFileDrop -- no --> CheckText
CheckText -- no --> SavePrevEffects
CheckText -- yes --> GetText
GetText --> TextNull
TextNull -- yes --> SavePrevEffects
TextNull -- no --> CheckAuthlib
CheckAuthlib -- yes --> SetCopyEffect
CheckAuthlib -- no --> CheckFileUri
CheckFileUri -- yes --> SetCopyEffect
CheckFileUri -- no --> CheckRootedPath
CheckRootedPath -- yes --> SetCopyEffect
CheckRootedPath -- no --> SavePrevEffects
SetCopyEffect --> SavePrevEffects
SetLinkEffect --> SavePrevEffects
SavePrevEffects --> LogEffect
LogEffect --> EndDragEnter
FormMain 中更新后的 Drop 处理流程图flowchart TD
DropStart["Drop handler start"]
CheckTextPresent["e.Data.GetDataPresent(Text)?"]
GetDropText["Str = TryCast(e.Data.GetData(Text), String)"]
TextNullDrop["Str is null?"]
LogTextDrop["Log accepted text drag"]
CheckRootedPathDrop["Path.IsPathRooted(Str)?"]
GoToPathText["Jump to PathText branch"]
CheckAuthlibDrop["Str.StartsWithF(authlib-injector:yggdrasil-server:)?"]
HandleAuthlib["Handle authlib injector drop"]
CheckFileUriDrop["Str.StartsWithF(file:///)?"]
HandleFileUriText["Handle file:/// URI text drop"]
CheckFileDropPresent["e.Data.GetDataPresent(FileDrop)?"]
PathText["PathText: unified file handling entry"]
GetFileDrop["FilePathRaw = e.Data.GetData(FileDrop)"]
CheckFilePathRaw["FilePathRaw is null?"]
HandleFileDrop["Handle file(s) or path(s) drop"]
EndDrop["Drop handler end"]
DropStart --> CheckTextPresent
CheckTextPresent -- yes --> GetDropText
CheckTextPresent -- no --> CheckFileDropPresent
GetDropText --> TextNullDrop
TextNullDrop -- yes --> EndDrop
TextNullDrop -- no --> LogTextDrop
LogTextDrop --> CheckRootedPathDrop
CheckRootedPathDrop -- yes --> GoToPathText
CheckRootedPathDrop -- no --> CheckAuthlibDrop
CheckAuthlibDrop -- yes --> HandleAuthlib
CheckAuthlibDrop -- no --> CheckFileUriDrop
CheckFileUriDrop -- yes --> HandleFileUriText
CheckFileUriDrop -- no --> EndDrop
HandleAuthlib --> EndDrop
HandleFileUriText --> EndDrop
CheckFileDropPresent -- yes --> PathText
CheckFileDropPresent -- no --> EndDrop
GoToPathText --> PathText
PathText --> GetFileDrop
GetFileDrop --> CheckFilePathRaw
CheckFilePathRaw -- yes --> EndDrop
CheckFilePathRaw -- no --> HandleFileDrop
HandleFileDrop --> EndDrop
文件级变更说明
与关联 Issue 的对照评估
提示与命令与 Sourcery 交互
自定义你的体验前往你的 控制面板 以:
获取帮助Original review guide in EnglishReviewer's GuideAdjusts drag-and-drop handling in FormMain.xaml.vb to prioritize file-drop data over text data, robustly handle text-based URIs and file paths (including rooted paths without file:///), and add null-safe casting and shared file handling flow for both file-drop and plain-path drags. Flow diagram for updated DragEnter handling in FormMainflowchart TD
DragEnterStart["DragEnter handler start"]
CheckPrevData["Check PrevData and e.Data equality"]
ReturnPrevEffects["Set e.Effects to PrevEffects and return"]
InitEffects["Set e.Effects to None"]
SavePrevData["PrevData = e.Data"]
CheckFileDrop["e.Data.GetDataPresent(FileDrop)?"]
GetFiles["Files = e.Data.GetData(FileDrop)"]
FilesNotEmpty["Files not null and length > 0?"]
SetLinkEffect["Set e.Effects to Link"]
CheckText["e.Data.GetDataPresent(Text)?"]
GetText["Str = TryCast(e.Data.GetData(Text), String)"]
TextNull["Str is null?"]
CheckAuthlib["Str.StartsWithF(authlib-injector:yggdrasil-server:)?"]
CheckFileUri["Str.StartsWithF(file:///)?"]
CheckRootedPath["Path.IsPathRooted(Str)?"]
SetCopyEffect["Set e.Effects to Copy"]
SavePrevEffects["PrevEffects = e.Effects"]
LogEffect["Log drag effect"]
EndDragEnter["DragEnter handler end"]
DragEnterStart --> CheckPrevData
CheckPrevData -- equal --> ReturnPrevEffects
CheckPrevData -- not equal --> InitEffects
InitEffects --> SavePrevData
SavePrevData --> CheckFileDrop
CheckFileDrop -- yes --> GetFiles
GetFiles --> FilesNotEmpty
FilesNotEmpty -- yes --> SetLinkEffect
FilesNotEmpty -- no --> CheckText
CheckFileDrop -- no --> CheckText
CheckText -- no --> SavePrevEffects
CheckText -- yes --> GetText
GetText --> TextNull
TextNull -- yes --> SavePrevEffects
TextNull -- no --> CheckAuthlib
CheckAuthlib -- yes --> SetCopyEffect
CheckAuthlib -- no --> CheckFileUri
CheckFileUri -- yes --> SetCopyEffect
CheckFileUri -- no --> CheckRootedPath
CheckRootedPath -- yes --> SetCopyEffect
CheckRootedPath -- no --> SavePrevEffects
SetCopyEffect --> SavePrevEffects
SetLinkEffect --> SavePrevEffects
SavePrevEffects --> LogEffect
LogEffect --> EndDragEnter
Flow diagram for updated Drop handling in FormMainflowchart TD
DropStart["Drop handler start"]
CheckTextPresent["e.Data.GetDataPresent(Text)?"]
GetDropText["Str = TryCast(e.Data.GetData(Text), String)"]
TextNullDrop["Str is null?"]
LogTextDrop["Log accepted text drag"]
CheckRootedPathDrop["Path.IsPathRooted(Str)?"]
GoToPathText["Jump to PathText branch"]
CheckAuthlibDrop["Str.StartsWithF(authlib-injector:yggdrasil-server:)?"]
HandleAuthlib["Handle authlib injector drop"]
CheckFileUriDrop["Str.StartsWithF(file:///)?"]
HandleFileUriText["Handle file:/// URI text drop"]
CheckFileDropPresent["e.Data.GetDataPresent(FileDrop)?"]
PathText["PathText: unified file handling entry"]
GetFileDrop["FilePathRaw = e.Data.GetData(FileDrop)"]
CheckFilePathRaw["FilePathRaw is null?"]
HandleFileDrop["Handle file(s) or path(s) drop"]
EndDrop["Drop handler end"]
DropStart --> CheckTextPresent
CheckTextPresent -- yes --> GetDropText
CheckTextPresent -- no --> CheckFileDropPresent
GetDropText --> TextNullDrop
TextNullDrop -- yes --> EndDrop
TextNullDrop -- no --> LogTextDrop
LogTextDrop --> CheckRootedPathDrop
CheckRootedPathDrop -- yes --> GoToPathText
CheckRootedPathDrop -- no --> CheckAuthlibDrop
CheckAuthlibDrop -- yes --> HandleAuthlib
CheckAuthlibDrop -- no --> CheckFileUriDrop
CheckFileUriDrop -- yes --> HandleFileUriText
CheckFileUriDrop -- no --> EndDrop
HandleAuthlib --> EndDrop
HandleFileUriText --> EndDrop
CheckFileDropPresent -- yes --> PathText
CheckFileDropPresent -- no --> EndDrop
GoToPathText --> PathText
PathText --> GetFileDrop
GetFileDrop --> CheckFilePathRaw
CheckFilePathRaw -- yes --> EndDrop
CheckFilePathRaw -- no --> HandleFileDrop
HandleFileDrop --> EndDrop
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体性的反馈:
- 当使用
e.Data.GetData(DataFormats.Text)获取文本时,建议在调用字符串方法或File.Exists之前,使用TryCast并进行空检查,以避免当数据实际上不是字符串时出现潜在的无效类型转换异常。 - 在调用
File.Exists(Str)之前,建议先对文本进行规范化/校验(例如修剪空白字符,或检查Path.IsPathRooted),这样可以减少任意文本内容触发不必要文件系统查询的可能性。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- When retrieving text with `e.Data.GetData(DataFormats.Text)`, consider using `TryCast` and a null check before calling string methods or `File.Exists` to avoid potential invalid-cast exceptions if the data is not actually a string.
- Before calling `File.Exists(Str)`, consider normalizing/validating the text (e.g., trimming whitespace or checking `Path.IsPathRooted`) so that arbitrary text payloads are less likely to trigger unnecessary filesystem lookups.帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've left some high level feedback:
- When retrieving text with
e.Data.GetData(DataFormats.Text), consider usingTryCastand a null check before calling string methods orFile.Existsto avoid potential invalid-cast exceptions if the data is not actually a string. - Before calling
File.Exists(Str), consider normalizing/validating the text (e.g., trimming whitespace or checkingPath.IsPathRooted) so that arbitrary text payloads are less likely to trigger unnecessary filesystem lookups.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- When retrieving text with `e.Data.GetData(DataFormats.Text)`, consider using `TryCast` and a null check before calling string methods or `File.Exists` to avoid potential invalid-cast exceptions if the data is not actually a string.
- Before calling `File.Exists(Str)`, consider normalizing/validating the text (e.g., trimming whitespace or checking `Path.IsPathRooted`) so that arbitrary text payloads are less likely to trigger unnecessary filesystem lookups.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我在这里给出一些整体反馈:
- 在
DragEnter逻辑中,当Str Is Nothing时提前返回,会导致这一事件路径中不再设置PrevData,从而改变了之前的行为;建议保持该处理函数的控制流一致,在合适的情况下始终更新PrevData。 - 在文本负载上新增的
File.Exists(Str)检查,可能会为任意拖入的文本引入额外的文件系统查询;建议对这一分支加以约束(例如仅针对看起来像路径的模式),或尽快短路返回,以避免在频繁拖拽时产生不必要的 IO。
给 AI 代理的提示
请根据本次代码评审中的评论进行修改:
## 总体评论
- 在 `DragEnter` 逻辑中,当 `Str Is Nothing` 时提前返回,会导致这一事件路径中不再设置 `PrevData`,从而改变了之前的行为;建议保持该处理函数的控制流一致,在合适的情况下始终更新 `PrevData`。
- 在文本负载上新增的 `File.Exists(Str)` 检查,可能会为任意拖入的文本引入额外的文件系统查询;建议对这一分支加以约束(例如仅针对看起来像路径的模式),或尽快短路返回,以避免在频繁拖拽时产生不必要的 IO。帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've left some high level feedback:
- In the
DragEnterlogic, returning early whenStr Is NothingmeansPrevDatais no longer set for this event path, which changes previous behavior; consider keeping the handler's control flow consistent soPrevDatais always updated when appropriate. - The added
File.Exists(Str)check on text payloads may introduce extra file system lookups for arbitrary drag text; consider constraining this branch (e.g., only for plausible path patterns) or short‑circuiting quickly to avoid unnecessary IO on frequent drags.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the `DragEnter` logic, returning early when `Str Is Nothing` means `PrevData` is no longer set for this event path, which changes previous behavior; consider keeping the handler's control flow consistent so `PrevData` is always updated when appropriate.
- The added `File.Exists(Str)` check on text payloads may introduce extra file system lookups for arbitrary drag text; consider constraining this branch (e.g., only for plausible path patterns) or short‑circuiting quickly to avoid unnecessary IO on frequent drags.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体性的反馈:
- 在新的 text 分支中,
If Str Is Nothing Then Return PrevData = e.Data这行代码会导致后面的PrevData赋值语句永远无法执行;如果你希望在这种情况下保留PrevData,请在Return之前设置它,或者移除Return之后的那条赋值语句。 - 条件
ElseIf Str.Contains(":\") OrElse Str.Contains("\") AndAlso File.Exists(Str)依赖 VB 的运算符优先级;建议添加括号,明确预期的分组方式,以避免未来被误解。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- In the new text branch, `If Str Is Nothing Then Return PrevData = e.Data` makes the `PrevData` assignment unreachable; if you intend to preserve `PrevData` for this case, set it before returning or remove the assignment after `Return`.
- The `ElseIf Str.Contains(":\") OrElse Str.Contains("\") AndAlso File.Exists(Str)` condition relies on VB operator precedence; consider adding parentheses to make the intended grouping explicit and avoid future misinterpretation.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've left some high level feedback:
- In the new text branch,
If Str Is Nothing Then Return PrevData = e.Datamakes thePrevDataassignment unreachable; if you intend to preservePrevDatafor this case, set it before returning or remove the assignment afterReturn. - The
ElseIf Str.Contains(":\") OrElse Str.Contains("\") AndAlso File.Exists(Str)condition relies on VB operator precedence; consider adding parentheses to make the intended grouping explicit and avoid future misinterpretation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the new text branch, `If Str Is Nothing Then Return PrevData = e.Data` makes the `PrevData` assignment unreachable; if you intend to preserve `PrevData` for this case, set it before returning or remove the assignment after `Return`.
- The `ElseIf Str.Contains(":\") OrElse Str.Contains("\") AndAlso File.Exists(Str)` condition relies on VB operator precedence; consider adding parentheses to make the intended grouping explicit and avoid future misinterpretation.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我在这里给出一些整体性的反馈:
- 在文本分支中检测普通文件路径时,建议使用
Path.IsPathRooted(Str)(并且可以考虑检查 URI scheme),而不是使用Str.Contains(":\") OrElse Str.Contains("\"),以避免误报,并让路径检测在不同路径格式下都更加健壮。 - 在处理
DataFormats.Text时,当Str为Nothing时你现在会提前返回而不更新PrevData;如果PrevData会被用于后续比较,建议在返回前先更新它,以保持与其他分支一致的行为。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- For detecting plain file paths in the text branch, consider using `Path.IsPathRooted(Str)` (and possibly checking for URI schemes) instead of `Str.Contains(":\") OrElse Str.Contains("\")` to avoid false positives and make path detection more robust across different path formats.
- In the `DataFormats.Text` handling, when `Str` is `Nothing` you now early-return without updating `PrevData`; if `PrevData` is used for later comparisons, you may want to set it before returning to keep behavior consistent with the other branches.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've left some high level feedback:
- For detecting plain file paths in the text branch, consider using
Path.IsPathRooted(Str)(and possibly checking for URI schemes) instead ofStr.Contains(":\") OrElse Str.Contains("\")to avoid false positives and make path detection more robust across different path formats. - In the
DataFormats.Texthandling, whenStrisNothingyou now early-return without updatingPrevData; ifPrevDatais used for later comparisons, you may want to set it before returning to keep behavior consistent with the other branches.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- For detecting plain file paths in the text branch, consider using `Path.IsPathRooted(Str)` (and possibly checking for URI schemes) instead of `Str.Contains(":\") OrElse Str.Contains("\")` to avoid false positives and make path detection more robust across different path formats.
- In the `DataFormats.Text` handling, when `Str` is `Nothing` you now early-return without updating `PrevData`; if `PrevData` is used for later comparisons, you may want to set it before returning to keep behavior consistent with the other branches.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@sourcery-ai dismiss |
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我在这里给出了一些高层次的反馈:
- 在
DragOver期间调用File.Exists可能会引入明显的 UI 延迟,尤其是针对 UNC 或网络路径时;可以考虑放宽为仅做语法层面的路径检查(例如:是否为根路径 / 扩展名是否有效),并把真正的存在性检查推迟到 drop 处理程序中再进行。 - 目前的文本路径检测会将任何根路径或以
\\开头的字符串都视为路径;你可能需要进一步收紧判断条件(比如通过Uri.TryCreate或简单的模式匹配)以避免把任意文本误判为文件路径,从而意外改变拖拽时的效果。
面向 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- Calling `File.Exists` during `DragOver` can introduce noticeable UI latency, especially for UNC or network paths; consider relaxing this to a syntactic path check (e.g., rooted path / valid extension) and deferring existence checks to the drop handler.
- The text-path detection currently treats any rooted or `\\`-prefixed string as a path; you may want to further constrain this (e.g., via `Uri.TryCreate` or simple pattern checks) to avoid misclassifying arbitrary text as file paths and unexpectedly changing drag effects.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据这些反馈来改进后续的 Review。
Original comment in English
Hey - I've left some high level feedback:
- Calling
File.ExistsduringDragOvercan introduce noticeable UI latency, especially for UNC or network paths; consider relaxing this to a syntactic path check (e.g., rooted path / valid extension) and deferring existence checks to the drop handler. - The text-path detection currently treats any rooted or
\-prefixed string as a path; you may want to further constrain this (e.g., viaUri.TryCreateor simple pattern checks) to avoid misclassifying arbitrary text as file paths and unexpectedly changing drag effects.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Calling `File.Exists` during `DragOver` can introduce noticeable UI latency, especially for UNC or network paths; consider relaxing this to a syntactic path check (e.g., rooted path / valid extension) and deferring existence checks to the drop handler.
- The text-path detection currently treats any rooted or `\`-prefixed string as a path; you may want to further constrain this (e.g., via `Uri.TryCreate` or simple pattern checks) to avoid misclassifying arbitrary text as file paths and unexpectedly changing drag effects.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我在这里给出了一些高层次的反馈:
- 现在
DragEnter逻辑会将普通的根路径(Path.IsPathRooted)视为可复制,但对应的 drop 处理程序仍然只识别authlib-injector:和file:///前缀。建议更新 drop 处理逻辑,使其与新的路径识别规则保持一致,以避免悬停和释放操作之间出现行为不一致的问题。
供 AI 智能体使用的提示
Please address the comments from this code review:
## Overall Comments
- The `DragEnter` logic now treats plain rooted paths (`Path.IsPathRooted`) as copyable, but the corresponding drop handler still only recognizes `authlib-injector:` and `file:///` prefixes, so consider updating the drop handling to mirror the new path recognition to avoid inconsistent behavior between hover and drop.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码评审。
Original comment in English
Hey - I've left some high level feedback:
- The
DragEnterlogic now treats plain rooted paths (Path.IsPathRooted) as copyable, but the corresponding drop handler still only recognizesauthlib-injector:andfile:///prefixes, so consider updating the drop handling to mirror the new path recognition to avoid inconsistent behavior between hover and drop.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `DragEnter` logic now treats plain rooted paths (`Path.IsPathRooted`) as copyable, but the corresponding drop handler still only recognizes `authlib-injector:` and `file:///` prefixes, so consider updating the drop handling to mirror the new path recognition to avoid inconsistent behavior between hover and drop.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - 我在这里给出了一些总体反馈:
- 引入用于处理根路径文本和文件拖放的
GoTo PathText标签,说明这些代码路径现在彼此纠缠在一起;建议把共享的文件/路径处理逻辑提取到一个单独的方法中,而不是使用GoTo,这样控制流会更清晰,也更易于维护。 - 由于将
PrevData = e.Data移到了拖放效果检测之前,现在在发生提前返回(例如文本转换失败)时,会更新PrevData却不更新PrevEffects;建议保持这两个字段一起更新(或将PrevData移回下面),以避免出现前一状态不一致的组合。
供 AI 代理使用的提示
Please address the comments from this code review:
## Overall Comments
- The introduction of the `GoTo PathText` label for handling rooted path text and file drops suggests the code paths are now intertwined; consider extracting the shared file/path handling into a separate method instead of using `GoTo` so the control flow remains clearer and easier to maintain.
- With `PrevData = e.Data` moved before drop-effect detection, early returns (e.g., when text casting fails) now update `PrevData` without updating `PrevEffects`; consider keeping these two fields updated together (or moving `PrevData` back down) to avoid inconsistent previous-state combinations.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据反馈改进后续的评审。
Original comment in English
Hey - I've left some high level feedback:
- The introduction of the
GoTo PathTextlabel for handling rooted path text and file drops suggests the code paths are now intertwined; consider extracting the shared file/path handling into a separate method instead of usingGoToso the control flow remains clearer and easier to maintain. - With
PrevData = e.Datamoved before drop-effect detection, early returns (e.g., when text casting fails) now updatePrevDatawithout updatingPrevEffects; consider keeping these two fields updated together (or movingPrevDataback down) to avoid inconsistent previous-state combinations.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The introduction of the `GoTo PathText` label for handling rooted path text and file drops suggests the code paths are now intertwined; consider extracting the shared file/path handling into a separate method instead of using `GoTo` so the control flow remains clearer and easier to maintain.
- With `PrevData = e.Data` moved before drop-effect detection, early returns (e.g., when text casting fails) now update `PrevData` without updating `PrevEffects`; consider keeping these two fields updated together (or moving `PrevData` back down) to avoid inconsistent previous-state combinations.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
算了还是重构掉比较好,这东西太草台班子了 |
Resolve #2220
Summary by Sourcery
调整拖放处理方式,以正确识别 IDM 风格的文件拖放,以及基于文本的文件路径或 URI。
Bug 修复:
file:///前缀的纯文件路径)能够正确触发复制效果,而不是被忽略或错误处理。Original summary in English
Summary by Sourcery
Adjust drag-and-drop handling to correctly recognize IDM-style file drops and text-based file paths or URIs.
Bug Fixes:
Summary by Sourcery
改进拖放处理,以正确解析文件拖放以及基于文本的文件路径或 URI。
Bug 修复:
增强功能:
Original summary in English
Summary by Sourcery
Improve drag-and-drop handling to correctly interpret file drops and text-based file paths or URIs.
Bug Fixes:
Enhancements:
Bug 修复:
Original summary in English
Summary by Sourcery
改进拖放处理,以正确解析文件拖放以及基于文本的文件路径或 URI。
Bug 修复:
增强功能:
Original summary in English
Summary by Sourcery
Improve drag-and-drop handling to correctly interpret file drops and text-based file paths or URIs.
Bug Fixes:
Enhancements: