Skip to content

訊息閱讀器功能改進與 bug 修正#48

Merged
keyang556 merged 3 commits intomainfrom
claude/gracious-wright
Apr 9, 2026
Merged

訊息閱讀器功能改進與 bug 修正#48
keyang556 merged 3 commits intomainfrom
claude/gracious-wright

Conversation

@keyang556
Copy link
Copy Markdown
Owner

@keyang556 keyang556 commented Apr 9, 2026

Summary

  • 修正 _messageReaderHandleSaveDialog 的縮排錯誤(line 5989)
  • 修正 _RECALL_RE 正則表達式缺少空格(與 _MSG_RE 格式一致)
  • 移除 _messageReaderHandleSaveDialog 函式開頭重複的 import tempfile

Changes

  1. 縮排修正self._messageReaderPending = False 使用正確的 tab 縮排
  2. 正則表達式修正_RECALL_RE 姓名捕獲組後補上空格,使其與標準訊息格式相符
  3. 移除冗余導入:刪除函式開頭的重複 import tempfile,保留後續使用的那個

Testing

已透過 NVDA 測試驗證訊息閱讀器功能正常運作。

🤖 Generated by Claude Code

Greptile Summary

此 PR 修正了訊息閱讀器功能中三個問題:縮排錯誤、正規表達式格式不一致,以及函式中重複的 import tempfile 宣告。

  • 縮排修正_messageReaderHandleSaveDialog 中,self._messageReaderPending = False(line 5988)現在正確地在 if not editHwnd: 區塊內,確保只有在找不到編輯控制項時才會重設狀態,避免了狀態被錯誤清除的 bug。
  • 正規表達式修正_RECALL_RE(\\S+?) 後補上空格,使其與 _MSG_RE 格式一致,確保「已收回訊息」格式能被正確匹配。
  • 移除重複 import:刪除 _messageReaderHandleSaveDialog 函式開頭重複的 import tempfile,保留函式中實際使用的那個。

Confidence Score: 5/5

此 PR 僅包含三個小範圍的 bug 修正,邏輯清晰,可安全合併。

三項修正(縮排、正規表達式、重複 import)皆有明確的問題與對應修正,且範圍小、風險低。修正後的程式碼邏輯正確,與周圍程式碼一致。

無需特別關注的檔案。

Vulnerabilities

未發現安全疑慮。

Important Files Changed

Filename Overview
addon/appModules/_chatParser.py 補上 _RECALL_RE(\S+?) 後缺少的空格,使其與 _MSG_RE 格式一致,確保「已收回訊息」行能被正確解析。
addon/appModules/line.py 修正 _messageReaderHandleSaveDialogself._messageReaderPending = False 的縮排,使其正確位於 if not editHwnd: 區塊內;並移除函式開頭重複的 import tempfile

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[_messageReaderHandleSaveDialog 呼叫] --> B{找到 Save As 對話框?}
    B -- 否, retriesLeft > 0 --> C[callLater 300ms 重試]
    B -- 否, retriesLeft == 0 --> D[_messageReaderPending = False\n顯示錯誤訊息]
    D --> E[return]
    C --> A
    B -- 是 --> F[建立暫存檔路徑\nimport tempfile]
    F --> G[預先刪除既有檔案]
    G --> H[_findSaveDialogEdit]
    H --> I{找到 Edit 控制項?}
    I -- 否 --> J[_messageReaderPending = False\n縮排修正\n顯示錯誤訊息]
    J --> K[return]
    I -- 是 --> L[SendMessageW 設定檔名]
    L --> M[callLater 200ms\n_messageReaderPressSave]
Loading

Reviews (1): Last reviewed commit: "Merge branch 'claude/gracious-wright' of..." | Re-trigger Greptile

(4/5) You can add custom instructions or style guidelines for the agent here!

keyang556 and others added 3 commits April 9, 2026 08:46
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- _RECALL_RE 正則表達式姓名捕獲組後補上空格,與 _MSG_RE 格式一致
- 移除 _messageReaderHandleSaveDialog 函式開頭重複的 import tempfile

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@keyang556 keyang556 merged commit 5929d03 into main Apr 9, 2026
2 of 3 checks passed
@keyang556 keyang556 deleted the claude/gracious-wright branch April 9, 2026 07:34
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.

1 participant