Skip to content

perf(customs):优化readme及任务说明。#5

Merged
kqcoxn merged 1 commit into
MaaXYZ:mainfrom
gitlihang:main
Jun 4, 2026
Merged

perf(customs):优化readme及任务说明。#5
kqcoxn merged 1 commit into
MaaXYZ:mainfrom
gitlihang:main

Conversation

@gitlihang
Copy link
Copy Markdown
Contributor

@gitlihang gitlihang commented Jun 4, 2026

Summary by Sourcery

在 UI 日志任务中澄清 OCR 结果输出的用法,并对点击目标坐标的参数文档进行统一。

增强:

  • click_target 参数文档更新为使用 [x1, y1, w, h] 坐标,而不是 [x1, y1, x2, y2]。

文档:

  • 改进 OCR 结果 UI 日志任务的 README,包含更清晰的标题、用于回答任务的使用示例,以及针对 custom_action_param 和代码块的更正使用说明。
Original summary in English

Summary by Sourcery

Clarify OCR result output usage in the UI log task and align parameter documentation for click target coordinates.

Enhancements:

  • Document the click_target parameter as using [x1, y1, w, h] coordinates instead of [x1, y1, x2, y2].

Documentation:

  • Improve the README for the OCR result UI log task with a clearer title, usage example for answering tasks, and corrected usage notes for custom_action_param and code blocks.

@kqcoxn kqcoxn merged commit 230f7ac into MaaXYZ:main Jun 4, 2026
2 of 3 checks passed
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了两个问题,并给出了一些整体性的反馈:

  • returnOCR.py 的 docstring JSON 示例中,"return_text": "输出的描述" 之后仍然缺少一个逗号,这可能会让读者困惑,或者在复制粘贴时导致问题。
  • 在 README 中,建议明确说明 click_target 的格式从 [x1, y1, x2, y2] 变为 [x1, y1, w, h] 是一次「约定变更」,以免已有用户在更新配置时误解坐标含义。
供 AI 代理使用的提示词
Please address the comments from this code review:

## Overall Comments
-`returnOCR.py` 的 docstring JSON 示例中,`"return_text": "输出的描述"` 之后仍然缺少一个逗号,这可能会让读者困惑,或者在复制粘贴时导致问题。
- 在 README 中,建议明确说明 `click_target` 的格式从 `[x1, y1, x2, y2]` 变为 `[x1, y1, w, h]` 是一次「约定变更」,以免已有用户在更新配置时误解坐标含义。

## Individual Comments

### Comment 1
<location path="Storage/customs/gitlihang/output-ocr-result-log/action/returnOCR.py" line_range="15" />
<code_context>
             "action_key": "Click",
             "recognition_name": "识别输出测试",
             "return_text": "输出的描述"
-            "click_target": []  # 点击坐标,格式为[x1, y1, x2, y2],仅在action_key为Click时使用
+            "click_target": []  # 点击坐标,格式为[x1, y1, w, h],仅在action_key为Click时使用
</code_context>
<issue_to_address>
**issue (bug_risk):**`return_text` 字段后缺少结尾逗号会导致语法错误。

示例负载在 `return_text` 这一行之后缺少逗号,因此这个字典字面量是无效的,如果被复制粘贴将会报错。请在 `"输出的描述"` 后面补充一个逗号以修正语法。
</issue_to_address>

### Comment 2
<location path="Storage/customs/gitlihang/output-ocr-result-log/README.md" line_range="3-4" />
<code_context>

-在UI日志界面上显示OCR结果
+## 使用案例:答题
+对于答题,在答题完成后,通过ocr识别答题结果(例:正确率:9/10),输出到ui方便用户查看。

 ## 功能
</code_context>
<issue_to_address>
**suggestion (typo):** 建议将 “OCR” 和 “UI” 大写以保持一致性。

在本段中,你当前使用的是小写的 “ocr” 和 “ui”,而在其他地方(例如标题)是大写形式。请在这里也改为 “OCR” 和 “UI”,以保持风格一致。

```suggestion
## 使用案例:答题
对于答题,在答题完成后,通过OCR识别答题结果(例:正确率:9/10),输出到UI方便用户查看。
```
</issue_to_address>

Sourcery 对开源项目免费——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English

Hey - I've found 2 issues, and left some high level feedback:

  • In returnOCR.py’s docstring JSON example, there is still a missing comma after "return_text": "输出的描述", which could confuse readers or copy-paste usage.
  • In the README, consider explicitly clarifying that the click_target format change from [x1, y1, x2, y2] to [x1, y1, w, h] is a convention change so existing users don’t misinterpret coordinates when updating configs.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `returnOCR.py`’s docstring JSON example, there is still a missing comma after `"return_text": "输出的描述"`, which could confuse readers or copy-paste usage.
- In the README, consider explicitly clarifying that the `click_target` format change from `[x1, y1, x2, y2]` to `[x1, y1, w, h]` is a convention change so existing users don’t misinterpret coordinates when updating configs.

## Individual Comments

### Comment 1
<location path="Storage/customs/gitlihang/output-ocr-result-log/action/returnOCR.py" line_range="15" />
<code_context>
             "action_key": "Click",
             "recognition_name": "识别输出测试",
             "return_text": "输出的描述"
-            "click_target": []  # 点击坐标,格式为[x1, y1, x2, y2],仅在action_key为Click时使用
+            "click_target": []  # 点击坐标,格式为[x1, y1, w, h],仅在action_key为Click时使用
</code_context>
<issue_to_address>
**issue (bug_risk):** Missing trailing comma after the `return_text` field will cause a syntax error.

The example payload is missing a comma after the `return_text` line, so the dict literal is invalid and will fail if copy-pasted. Please add a trailing comma after `"输出的描述"` to correct the syntax.
</issue_to_address>

### Comment 2
<location path="Storage/customs/gitlihang/output-ocr-result-log/README.md" line_range="3-4" />
<code_context>

-在UI日志界面上显示OCR结果
+## 使用案例:答题
+对于答题,在答题完成后,通过ocr识别答题结果(例:正确率:9/10),输出到ui方便用户查看。

 ## 功能
</code_context>
<issue_to_address>
**suggestion (typo):** Consider capitalizing “OCR” and “UI” for consistency.

In this section you currently use lowercase “ocr” and “ui”, while elsewhere (e.g., the title) they’re uppercase. Please update them here to “OCR” and “UI” for consistency.

```suggestion
## 使用案例:答题
对于答题,在答题完成后,通过OCR识别答题结果(例:正确率:9/10),输出到UI方便用户查看。
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -13,12 +13,12 @@ class ReturnOCR(CustomAction):
"action_key": "Click",
"recognition_name": "识别输出测试",
"return_text": "输出的描述"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk):return_text 字段后缺少结尾逗号会导致语法错误。

示例负载在 return_text 这一行之后缺少逗号,因此这个字典字面量是无效的,如果被复制粘贴将会报错。请在 "输出的描述" 后面补充一个逗号以修正语法。

Original comment in English

issue (bug_risk): Missing trailing comma after the return_text field will cause a syntax error.

The example payload is missing a comma after the return_text line, so the dict literal is invalid and will fail if copy-pasted. Please add a trailing comma after "输出的描述" to correct the syntax.

Comment on lines +3 to +4
## 使用案例:答题
对于答题,在答题完成后,通过ocr识别答题结果(例:正确率:9/10),输出到ui方便用户查看。
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): 建议将 “OCR” 和 “UI” 大写以保持一致性。

在本段中,你当前使用的是小写的 “ocr” 和 “ui”,而在其他地方(例如标题)是大写形式。请在这里也改为 “OCR” 和 “UI”,以保持风格一致。

Suggested change
## 使用案例:答题
对于答题,在答题完成后,通过ocr识别答题结果(例:正确率:9/10),输出到ui方便用户查看
## 使用案例:答题
对于答题,在答题完成后,通过OCR识别答题结果(例:正确率:9/10),输出到UI方便用户查看
Original comment in English

suggestion (typo): Consider capitalizing “OCR” and “UI” for consistency.

In this section you currently use lowercase “ocr” and “ui”, while elsewhere (e.g., the title) they’re uppercase. Please update them here to “OCR” and “UI” for consistency.

Suggested change
## 使用案例:答题
对于答题,在答题完成后,通过ocr识别答题结果(例:正确率:9/10),输出到ui方便用户查看
## 使用案例:答题
对于答题,在答题完成后,通过OCR识别答题结果(例:正确率:9/10),输出到UI方便用户查看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants