Repository navigation
Fix Windows import filenames / 修复 Windows 导入文件名提取 - #21
Merged
Merged
Conversation
This was referenced Sep 19, 2026
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.
English · 简体中文
English
Pass a filename—not an entire Windows path—in the account import payload's
filenamefield. One production line changes.Problem and minimal fix
The file picker can return a path such as
C:\Users\name\Downloads\accounts.json. Splitting only on/leaves that whole string infilenameinstead ofaccounts.json; UNC paths have the same issue.The file is still read from the original full path. Only the filename metadata sent to the backend changes. File contents, format parsing, account deduplication, and credentials are untouched. This does not claim that every Windows import fails; it corrects the basename extraction itself.
Verification
Local Windows validation at head
689c39dpassed:The 2 tests evaluate the actual source expression with Windows drive paths, UNC paths, Unicode/spaces, POSIX paths, mixed separators, and plain filenames. They test extraction, not native file-picker interaction.
Review surface: 2 files, +24/−1 lines including tests; one commit directly on upstream
main(f64a44a). No dependency on another PR. #17 edits a different part of the same modal for OAuth links; this filename fix can be accepted independently.简体中文
让账号导入请求的
filename字段收到文件名,而不是整条 Windows 路径。实际代码只改一行。问题与最小修正
文件选择器可能返回
C:\Users\name\Downloads\accounts.json。现有代码只按/分割,因此filename仍是完整路径,而非accounts.json;UNC 路径也存在同样的问题。读取文件时仍使用原始完整路径,只修正传给后端的文件名字段。**不改文件内容、格式解析、账号去重或凭据。**这里并不是说所有 Windows 导入都会失败,而是修正文件名提取这一处明确的不一致。
验证依据
在 Windows 上针对当前提交
689c39d完成本地验证:2 个测试直接执行源码中的提取表达式,覆盖 Windows 盘符路径、UNC 路径、Unicode/空格、POSIX 路径、混合分隔符和单独文件名。测试针对路径提取,不将其表述为原生文件选择器交互测试。
**审阅范围:**含测试共 2 个文件、+24/−1 行,直接基于 upstream
main(f64a44a)的单个提交,不依赖其他 PR。#17 修改同一弹窗中的 OAuth 链接区域,与本行无关,本修正可单独接受。