fix: 深度代码审查修复(6个issue)#15
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove dead code in logviewer.cpp/h: parseLogFile, filterLogs, displayLogs, searchInItem, clearHighlightsInItem, clearSearchHighlights - Remove unused escapeForJson in logexporter.cpp/h - Fix C++ standard from c++11 to c++17 in LogReader.pro - Replace include_directories with target_include_directories in tests/CMakeLists.txt - Add operator== to LogEntry struct - Fix test timestamp format from hh:mm:ss to HH:mm:ss (24-hour) - Add missing QElapsedTimer include in test_logentry.cpp - Convert AppSettings raw pointer to std::unique_ptr<QSettings> - Include file path in LogLoader error message - Scope stylesheet from qApp to this window in logviewer.cpp Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88b4a4d97e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| out << " " << QJsonDocument(QJsonValue(key)).toJson(QJsonDocument::Compact) | ||
| << ": " | ||
| << QJsonDocument(QJsonValue(value)).toJson(QJsonDocument::Compact); |
There was a problem hiding this comment.
Replace invalid QJsonDocument(QJsonValue) construction
The new JSON streaming path constructs QJsonDocument from QJsonValue when writing keys/values, but QJsonDocument only has constructors for QJsonObject/QJsonArray (plus copy/move), so this does not compile on supported Qt versions and blocks both qmake/CMake builds. This needs to use a valid escaping path (for example a QJsonObject/QJsonArray wrapper or another escaping API) instead of QJsonDocument(QJsonValue(...)).
Useful? React with 👍 / 👎.
Quality CI: - clang-format 检查现在会真正阻断 CI(移除 || echo) - clang-tidy 仅在发现 error 时失败(移除无条件 || true) - 添加 -DENABLE_TESTING=ON,运行测试 - 移除 Windows 多余的 MinGW 安装 - Sanitizers 仅在 Ubuntu 运行(Windows ASan 不可靠) - 移除 Sanitizers/Coverage 中重复的 clang-tidy - 修复 Coverage 中无效的 --help 尝试 - 移除无效的 -DENABLE_CODE_COVERAGE=ON Release CI: - 统一 Qt 版本为 6.5.3 - 移除 continue-on-error,构建失败应阻断发布 - Windows 改用 MSVC/Ninja 替代过时的 MinGW 8.1.0 - 添加 -DENABLE_DEPLOY=ON 启用 windeployqt - 修复 Windows 打包,正确收集 windeployqt 输出 - 移除与 CMake 冲突的单独 lrelease 调用 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
QJsonDocument has no constructor for QJsonValue, causing compilation failure. Use QJsonArray wrapping + mid() for proper JSON string escaping. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 458340db02
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| void LogViewer::onSearchTextChanged(const QString& text) | ||
| { | ||
| currentSearchText = text; | ||
| highlightSearchMatches(); | ||
| searchDebounceTimer->start(); | ||
| } |
There was a problem hiding this comment.
Recompute search matches before using debounced results
onSearchTextChanged() now only starts a 200ms timer, so searchResults can remain stale while the user immediately triggers actions like export/navigation. In onExportSearchResults(), this can produce a false “no matches” message for text that is actually present if the button is clicked before the timer fires. Please force a synchronous refresh (or flush a pending debounce timer) before any logic that depends on searchResults.
Useful? React with 👍 / 👎.
- 统一 Qt 版本为 5.14.2 - macOS runner 改用 macos-13(Qt 5.14.2 无 ARM 预编译包) - macOS 架构改为仅 x86_64(移除不兼容的 arm64) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CI 环境无 X11 显示服务器,Qt 测试程序因 xcb 插件加载失败而 abort。设置 QT_QPA_PLATFORM=offscreen 使用离屏渲染。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add flushSearchDebounce() that stops the pending timer and runs highlightSearchMatches() synchronously. Called at the start of onSearchPrevious(), onSearchNext(), and onExportSearchResults() to prevent stale searchResults from being used. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
quality.yml: - lint job: clang-format + cppcheck (continue-on-error, 不阻断) - build job: Ubuntu + Windows 矩阵构建,Ninja 编译,offscreen 测试 - 移除不可靠的 sanitizers/coverage job - 移除重复的 clang-tidy 运行 release.yml: - 精简为 3 平台构建 + 统一发布 job - 移除 continue-on-error - macOS 使用 macos-13 (Qt 5.14.2 x86_64) - 使用 Ninja 替代 MinGW/Make 同时修复 clang-format 格式违规。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4c5638514
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| needs: [build-windows, build-linux, build-macos] | ||
| if: always() && (needs.build-windows.result == 'success' || needs.build-linux.result == 'success' || needs.build-macos.result == 'success') | ||
|
|
||
| if: always() && !cancelled() |
There was a problem hiding this comment.
Restrict release publishing to successful build jobs
Gate the release job on at least one successful build result instead of if: always() && !cancelled(). In its current form, the publish step still runs after failed build jobs, and because fail_on_unmatched_files is false, a tag can produce a release without usable binaries when all platform builds fail.
Useful? React with 👍 / 👎.
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true |
There was a problem hiding this comment.
Remove the non-blocking configuration for the lint job. With continue-on-error: true, lint failures do not fail the workflow, so formatting and static-analysis regressions can merge undetected even though this workflow is intended to enforce code quality.
Useful? React with 👍 / 👎.
- Windows Qt 显式指定 win64_msvc2017_64,避免链接 MinGW 库 - 移除 lint job 的 continue-on-error,格式违规阻断 CI - release job 改为至少一个平台构建成功才发布 - 修复 logloader.cpp/h clang-format 违规 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Windows runner defaults to MinGW GCC which conflicts with MSVC-built Qt libraries. Add ilammy/msvc-dev-cmd to both quality.yml and release.yml to ensure Ninja uses cl.exe. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ensures MSVC correctly parses Chinese characters in source files regardless of system locale (code page). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
基于深度代码审查,修复了 6 个 issue,涵盖 Critical/Major/Minor 级别问题。
Changes
src/ui/logviewer.cpp/hsrc/core/logexporter.cpp/hsrc/core/logentry.hsrc/core/logloader.cppsrc/utils/languagemanager.h/cppsrc/utils/appsettings.h/cppsrc/main.cppLogReader.protests/CMakeLists.txttests/test_logentry.cppTest plan
ctest --output-on-failure全部通过@codex @droid 请 review 代码变更,特别关注:
🤖 Generated with Claude Code