Skip to content

fix: v1.8.1 — strip date and name residue leaking into spoken body - #11

Merged
sbcmsbgithub merged 1 commit into
masterfrom
claude/ecstatic-mestorf-31cfd6
May 20, 2026
Merged

sbcmsbgithub merged 1 commit into
masterfrom
claude/ecstatic-mestorf-31cfd6

Conversation

@sbcmsbgithub

Copy link
Copy Markdown
Owner

Summary

  • DATE_RE word-boundary fix — \b silently fails when the Angular DOM concatenates inline elements without whitespace (e.g. AliceMay 20). Boundaries removed; the \s+\d{1,2} suffix is already discriminating enough.
  • Sender-word & badge residue — normalizeMsg now strips each individual word of fullSender from the body start, then sweeps leading badge words. Closes the loop on the FirstName MonthDay FullName message pattern that was regressing.

Test plan

  • Hard-refresh the target tab after installing v1.8.1 in Tampermonkey
  • Confirm [Streaming Message Reader] UI mounted. in DevTools console with no errors
  • Send/receive a message — verify spoken output is <username>: <message> only (no date, no duplicate name)
  • Verify Start / Pause / Skip / Stop still work
  • Verify ignore list still suppresses listed users

🤖 Generated with Claude Code

DATE_RE \b boundaries fail when Angular renders inline elements without
whitespace (e.g. "AliceMay 20"); removed in favour of the already-specific
\s+\d{1,2} suffix. normalizeMsg now also strips individual sender-name
words and leading badge words to close the loop on the
FirstName MonthDay FullName message pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sbcmsbgithub
sbcmsbgithub merged commit 0d92a4c into master May 20, 2026
@sbcmsbgithub
sbcmsbgithub deleted the claude/ecstatic-mestorf-31cfd6 branch May 20, 2026 19:31

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 29226c6d0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const DATE_RE = /\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s+\d{1,2}(?:,?\s*\d{4})?\b/gi;
// No \b boundaries — the Angular DOM can concatenate inline elements without spaces
// (e.g. "AliceMay 20"), which breaks \b. The \s+\d{1,2} suffix is specific enough.
const DATE_RE = /(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s+\d{1,2}(?:,?\s*\d{4})?/gi;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reinstate end boundary in date-stripping regex

Removing the trailing \b from DATE_RE makes the cleaner delete month/day substrings inside normal words such as "May 20th" (it now strips "May 20" and leaves "th"). This is a regression from the previous pattern and will corrupt spoken message content whenever users include ordinal dates, even though those are not UI-injected date chips.

Useful? React with 👍 / 👎.

Comment on lines +429 to +430
msg.fullSender.split(/\s+/).filter(p => p.length > 1).forEach(part => {
msg.body = stripSenderFromStart(msg.body, part);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require word boundary when stripping sender name parts

The new per-word sender stripping pass calls stripSenderFromStart for each token of fullSender, but that helper matches raw prefixes without a boundary. This means a sender part can delete the start of an unrelated word (e.g., sender "Ann Lee", body "Leeds won" becomes "ds won"), causing message text corruption in production chat reads.

Useful? React with 👍 / 👎.

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