From 8c26d93001ca63f439d3b315a69a1482d48d185a Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 20 Aug 2025 14:33:22 -0400 Subject: [PATCH] Progress bar monitoring updates. Hopefully fixed some false positives, and updated claude-code progress monitoring. --- .../onScreenUpdate/65000-progress_detector.py | 19 +++++++++++++++---- src/fenrirscreenreader/fenrirVersion.py | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/fenrirscreenreader/commands/onScreenUpdate/65000-progress_detector.py b/src/fenrirscreenreader/commands/onScreenUpdate/65000-progress_detector.py index da24037a..75dcb8e3 100644 --- a/src/fenrirscreenreader/commands/onScreenUpdate/65000-progress_detector.py +++ b/src/fenrirscreenreader/commands/onScreenUpdate/65000-progress_detector.py @@ -146,8 +146,8 @@ class command: # Pattern 1b: Time/token activity (not percentage-based, so use single # beep) - time_match = re.search(r"(\d+)s\s", text) - token_match = re.search(r"(\d+)\s+tokens", text) + time_match = re.search(r"(?:(?:remaining|elapsed|left|ETA|eta)[:;\s]*(\d+)s|(\d+)s\s+(?:remaining|elapsed|left))", text, re.IGNORECASE) + token_match = re.search(r"(?:processing|generating|used|consumed)\s+(\d+)\s+tokens", text, re.IGNORECASE) # Pattern 1c: dd command output (bytes copied with transfer rate) dd_match = re.search(r"\d+\s+bytes.*copied.*\d+\s+s.*[kMGT]?B/s", text) # Pattern 1d: Curl-style transfer data (bytes, speed indicators) @@ -183,7 +183,10 @@ class command: if fraction_match: current = int(fraction_match.group(1)) total = int(fraction_match.group(2)) - if total > 0: + # Filter out dates, page numbers, and other non-progress fractions + if (total > 0 and total <= 1000 and current <= total and + not re.search(r"\b(?:page|chapter|section|line|row|column|year|month|day)\b", text, re.IGNORECASE) and + not re.search(r"\d{1,2}/\d{1,2}/\d{2,4}", text)): # Date pattern percentage = (current / total) * 100 if ( percentage @@ -245,7 +248,15 @@ class command: self.env["commandBuffer"]["lastProgressTime"] = current_time return - # Pattern 6: Moon phase progress indicators + # Pattern 6: Claude Code progress indicators + claude_progress_match = re.search(r'^[·✢✒*]\s+\w+[…\.]*\s*\(esc to interrupt\)\s*$', text) + if claude_progress_match: + if current_time - self.env["commandBuffer"]["lastProgressTime"] >= 1.0: + self.play_activity_beep() + self.env["commandBuffer"]["lastProgressTime"] = current_time + return + + # Pattern 7: Moon phase progress indicators moon_match = re.search(r'[πŸŒ‘πŸŒ’πŸŒ“πŸŒ”πŸŒ•πŸŒ–πŸŒ—πŸŒ˜]', text) if moon_match: moon_phases = { diff --git a/src/fenrirscreenreader/fenrirVersion.py b/src/fenrirscreenreader/fenrirVersion.py index bd44604a..a35af8df 100644 --- a/src/fenrirscreenreader/fenrirVersion.py +++ b/src/fenrirscreenreader/fenrirVersion.py @@ -4,6 +4,6 @@ # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributors. -version = "2025.08.04" +version = "2025.08.20" codeName = "testing" code_name = "testing"