Add privacy: hide exact words in dictation notifications

- Replace exact text preview with word count in notifications
- Change 'Speaking' notification to show 'Dictating... (X words)' instead of text
- Change 'Dictation' notification to show 'Text typed successfully (X words)' instead of preview
- Improves privacy by not displaying sensitive dictation content in notifications
This commit is contained in:
Kade.Heyborne 2025-12-04 11:50:21 -07:00
parent 73a15d03cd
commit cf2ebc9afa
No known key found for this signature in database
GPG Key ID: 8CF0EAA31FC81FC5

View File

@ -370,10 +370,11 @@ def process_partial_text(text):
if app_state == AppState.DICTATION: if app_state == AppState.DICTATION:
logging.info(f"💭 {text}") logging.info(f"💭 {text}")
# Show brief notification for longer partial text # Show brief notification without revealing exact words (privacy)
if len(text) > 3: if len(text) > 3:
word_count = len(text.split())
send_notification( send_notification(
"🎤 Speaking", text[:50] + "..." if len(text) > 50 else text, 1000 "🎤 Listening", f"Dictating... ({word_count} words)", 1000
) )
elif app_state == AppState.CONVERSATION: elif app_state == AppState.CONVERSATION:
logging.info(f"💭 [Conversation] {text}") logging.info(f"💭 [Conversation] {text}")
@ -429,9 +430,10 @@ async def process_final_text(text):
if app_state == AppState.DICTATION: if app_state == AppState.DICTATION:
logging.info(f"{formatted}") logging.info(f"{formatted}")
word_count = len(formatted.split())
send_notification( send_notification(
"🎤 Dictation", "🎤 Dictation Complete",
f"Typed: {formatted[:30]}{'...' if len(formatted) > 30 else ''}", f"Text typed successfully ({word_count} words)",
2000, 2000,
) )