Skip to content

fix: v1.7.4 — strip date stamps and fix double sender announcement - #8

Merged
sbcmsbgithub merged 1 commit into
masterfrom
fix/strip-date-from-body
May 18, 2026
Merged

sbcmsbgithub merged 1 commit into
masterfrom
fix/strip-date-from-body

Conversation

@sbcmsbgithub

Copy link
Copy Markdown
Owner

Problems fixed

1. Sender announced twice — "Alice: Alice: hello everyone"

VTF formats the message body element as "FirstName: message" even when the sender element contains the full name "Alice Smith". After stripping "Alice Smith" from the body, "Alice: hello everyone" was left behind. normalizeMsg was supposed to catch this with a first-name strip, but the separator character class [:·|>-]? may not have matched the specific colon variant VTF uses.

Fix:

  • stripSenderFromStart now uses \W* (any non-word characters, zero or more) after the sender name instead of the narrow \s*[:·|>-]?\s*. This absorbs any separator regardless of encoding.
  • Both extractMessageFromRoot, extractMessageGeneric, and normalizeMsg now run an explicit first-name strip after the full-name strip, so "Alice: hello" is caught even when fullSender = "Alice Smith".

2. Date stamp read aloud — "Alice May 18 Alice hello"

The chat UI injects a date string (e.g. May 18) into each message element's innerText. It appeared after timestamp stripping and blocked the sender strip from running. Added DATE_RE to remove it first.

Spoken output

Before After
Alice May 18 Alice Smith Alice hello everyone Alice: hello everyone
Alice: Alice: hello everyone Alice: hello everyone

Test plan

  • New message arrives — hear only "<name>: <message>", no date, no duplicate name
  • Message where sender says their own name in the text (e.g. "Alice here!") — only the leading duplicate is stripped, not occurrences mid-sentence

🤖 Generated with Claude Code

…ore speaking

Also fixes sender name announced twice ("Alice: Alice: hello everyone"):
- stripSenderFromStart now uses \W* instead of narrow [:·|>-]? so any
  separator character after the name is absorbed.
- Both extractors and normalizeMsg now run an explicit first-name-only strip
  after the full-name strip, covering VTF's "FirstName: message" body format.
- DATE_RE strips Month-Day date stamps injected by the chat UI before
  the sender strip runs, unblocking it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sbcmsbgithub
sbcmsbgithub merged commit aabe65c into master May 18, 2026
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