feat: enhance preview command with indexed content validation#357
Conversation
1. Added PreviewStatus enum to distinguish successful (0) and not- indexed (1) preview results 2. Moved preview command logic to separate preview_command module 3. Added thorough validation for indexed content paths 4. Improved error reporting for non-indexed paths with detailed messages 5. Added new test cases for not-indexed preview scenarios 6. Extended ContentRetriever to return NotIndexed status for invalid paths/types Log: Added validation and error handling for preview command when accessing non-indexed content Influence: 1. Test preview command with paths to non-indexed content 2. Verify error messages for non-indexed paths 3. Check behavior with different search types (content/ocr/semantic) 4. Test preview output formats (JSON/text) with invalid inputs 5. Verify PreviewStatus values in API responses 6. Test handling of semantic search routing failures feat: 增强预览命令的索引内容验证功能 1. 添加 PreviewStatus 枚举区分成功(0)和未索引(1)的预览结果 2. 将预览命令逻辑移动到独立的 preview_command 模块 3. 添加对索引内容路径的全面验证 4. 为未索引路径改进错误报告,包含详细消息 5. 新增未索引场景的测试用例 6. 扩展 ContentRetriever 对无效路径/类型返回 NotIndexed 状态 Log: 新增预览命令访问非索引内容时的验证和错误处理 Influence: 1. 测试预览命令在访问非索引内容时的行为 2. 验证非索引路径的错误消息 3. 检查不同搜索类型(content/ocr/semantic)的行为差异 4. 测试无效输入时的输出格式(JSON/文本) 5. 验证 API 响应中的 PreviewStatus 值 6. 测试语义搜索路由失败时的处理情况
There was a problem hiding this comment.
Sorry @Johnson-zs, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // src/dfm-search/dfm-search-client/preview_command.cpp
// 建议:使用 "\n" 替代 Qt::endl 以确保更好的跨版本兼容性
QString buildPreviewText(const QList<PreviewEntry> &entries)
{
QString text;
QTextStream out(&text);
for (const PreviewEntry &entry : entries) {
out << entry.path << "\n";
if (!entry.content.isEmpty()) {
out << " " << entry.content << "\n";
} else {
out << " (no content)\n";
}
out << " Char count: " << entry.charCount << "\n";
- out << Qt::endl;
+ out << "\n";
}
return text;
} |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
indexed (1) preview results
paths/types
Log: Added validation and error handling for preview command when
accessing non-indexed content
Influence:
feat: 增强预览命令的索引内容验证功能
Log: 新增预览命令访问非索引内容时的验证和错误处理
Influence: