fix: 修复会话归组和文件预览编码
This commit is contained in:
4
.trellis/tasks/08-07-file-preview-encoding/check.jsonl
Normal file
4
.trellis/tasks/08-07-file-preview-encoding/check.jsonl
Normal file
@@ -0,0 +1,4 @@
|
||||
{"file":".trellis/spec/backend/index.md","reason":"后端检查入口规范"}
|
||||
{"file":".trellis/spec/backend/quality-guidelines.md","reason":"验证测试覆盖与质量"}
|
||||
{"file":".trellis/spec/backend/error-handling.md","reason":"验证 API 错误行为"}
|
||||
{"file":".trellis/tasks/08-07-file-preview-encoding/prd.md","reason":"逐条核验验收标准"}
|
||||
@@ -0,0 +1,4 @@
|
||||
{"file":".trellis/spec/backend/index.md","reason":"后端开发入口规范"}
|
||||
{"file":".trellis/spec/backend/quality-guidelines.md","reason":"回归测试和代码质量要求"}
|
||||
{"file":".trellis/spec/backend/error-handling.md","reason":"API 错误行为要求"}
|
||||
{"file":".trellis/tasks/08-07-file-preview-encoding/prd.md","reason":"本任务需求与验收标准"}
|
||||
21
.trellis/tasks/08-07-file-preview-encoding/prd.md
Normal file
21
.trellis/tasks/08-07-file-preview-encoding/prd.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# 中文文件预览编码兼容
|
||||
|
||||
## 背景
|
||||
|
||||
文件浏览器预览部分历史 C# 源文件时,ASCII 内容正常但中文注释显示为 `<60>`。这些文件通常使用 GBK、GB2312 或 GB18030,而当前服务端固定按 UTF-8 解码。
|
||||
|
||||
## 验收标准
|
||||
|
||||
1. UTF-8(含中文)保持正确显示。
|
||||
2. UTF-8 BOM、UTF-16LE BOM、UTF-16BE BOM 能正确预览,且正文不显示 BOM。
|
||||
3. GBK/GB2312/GB18030 中文文本能正确预览。
|
||||
4. API 返回实际识别编码,便于定位异常文件。
|
||||
5. 二进制文件仍返回 415,不因编码回退被误判为文本。
|
||||
6. 预览大小限制和路径安全逻辑不变。
|
||||
7. 增加端到端回归测试,覆盖 UTF-8、GB18030 与二进制拒绝。
|
||||
|
||||
## 非目标
|
||||
|
||||
- 不修改源文件编码。
|
||||
- 不在前端增加手动编码选择器。
|
||||
- 不引入新的生产依赖。
|
||||
26
.trellis/tasks/08-07-file-preview-encoding/task.json
Normal file
26
.trellis/tasks/08-07-file-preview-encoding/task.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "file-preview-encoding",
|
||||
"name": "file-preview-encoding",
|
||||
"title": "兼容中文文件预览编码",
|
||||
"description": "",
|
||||
"status": "in_progress",
|
||||
"dev_type": null,
|
||||
"scope": null,
|
||||
"package": null,
|
||||
"priority": "P2",
|
||||
"creator": "shiyue",
|
||||
"assignee": "shiyue",
|
||||
"createdAt": "2026-08-07",
|
||||
"completedAt": null,
|
||||
"branch": null,
|
||||
"base_branch": "main",
|
||||
"worktree_path": null,
|
||||
"commit": null,
|
||||
"pr_url": null,
|
||||
"subtasks": [],
|
||||
"children": [],
|
||||
"parent": null,
|
||||
"relatedFiles": [],
|
||||
"notes": "",
|
||||
"meta": {}
|
||||
}
|
||||
Reference in New Issue
Block a user