Skip to content

Commit 4d1f9b8

Browse files
committed
fix: address CHANGES_REQUESTED review feedback on PR #4174
- email-delivery-test-helper.sh: replace grep -ciE with grep -oiE | wc -l for high-risk and medium-risk phrase counting to accurately count occurrences (not just matching lines) — addresses Gemini review - accessibility-helper.sh: update font-size regex from 12px to 14px threshold (([0-9]|1[0-3])px) and tighten em branch to <=0.875em; update warning message to match — aligns code with docs (CodeRabbit) - accessibility-audit.md: update table entry from '12px' to '14px' to match helper script threshold; replace GNU-only sed '\x1b' ANSI-strip with portable bash $'\033' literal ESC byte for BSD/macOS compat - tests/test-email-thread-reconstruction.sh: change grep -qE backslash pattern from '\\' to '\\+' (one-or-more quantifier) to detect single Windows-style path separators in Markdown links
1 parent c7142b1 commit 4d1f9b8

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

.agents/scripts/accessibility-helper.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,9 @@ check_email_a11y() {
720720

721721
# Check: inline styles with small font sizes
722722
local small_fonts
723-
small_fonts=$(_grep_count 'font-size:\s*(([0-9]|1[01])px|0\.[0-9]+em)' "$file")
723+
small_fonts=$(_grep_count 'font-size:\s*(([0-9]|1[0-3])px|0\.(0[0-9]*|[1-7][0-9]*|8([0-6][0-9]*|7[0-5]?))em)' "$file")
724724
if [[ "$small_fonts" -gt 0 ]]; then
725-
_append "WARN: $small_fonts instance(s) of font-size below 12px"
725+
_append "WARN: $small_fonts instance(s) of font-size below 14px"
726726
_append " WCAG 1.4.4 — Text should be resizable; small fonts harm readability"
727727
warnings=$((warnings + 1))
728728
else

.agents/scripts/email-delivery-test-helper.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ analyze_spam_content() {
142142
local high_risk_found=0
143143
for phrase in "${high_risk_phrases[@]}"; do
144144
local count
145-
count=$(echo "$content" | grep -ciE "$phrase" || true)
145+
count=$( (echo "$content" | grep -oiE "$phrase" || true) | wc -l | tr -d ' ')
146146
count="${count:-0}"
147147
if [[ "$count" -gt 0 ]]; then
148148
print_warning "High-risk phrase found: '$phrase' ($count occurrences)"
@@ -194,7 +194,7 @@ analyze_spam_content() {
194194
local medium_risk_found=0
195195
for phrase in "${medium_risk_phrases[@]}"; do
196196
local count
197-
count=$(echo "$content" | grep -ciE "$phrase" || true)
197+
count=$( (echo "$content" | grep -oiE "$phrase" || true) | wc -l | tr -d ' ')
198198
count="${count:-0}"
199199
if [[ "$count" -gt 0 ]]; then
200200
medium_risk_found=$((medium_risk_found + 1))

.agents/services/accessibility/accessibility-audit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ accessibility-helper.sh email ./templates/welcome.html
104104
| Missing `alt` on images | 1.1.1 Non-text Content | Error |
105105
| Missing `lang` attribute | 3.1.1 Language of Page | Error |
106106
| Layout tables without `role="presentation"` | 1.3.1 Info and Relationships | Warning |
107-
| Font size below 12px | 1.4.4 Resize Text | Warning |
107+
| Font size below 14px | 1.4.4 Resize Text | Warning |
108108
| Generic link text ("click here") | 2.4.4 Link Purpose | Warning |
109109
| No heading structure | 1.3.1 Info and Relationships | Warning |
110110
| Colour-only indicators | 1.4.1 Use of Colour | Warning |
@@ -234,7 +234,7 @@ Add accessibility checks to build pipelines:
234234
```bash
235235
# Fail build if Lighthouse accessibility score drops below 90
236236
score=$(accessibility-helper.sh lighthouse https://staging.example.com \
237-
| sed 's/\x1b\[[0-9;]*m//g' | sed -E -n 's/.*Score: ([0-9]+).*/\1/p')
237+
| sed $'s/\033\\[[0-9;]*m//g' | sed -E -n 's/.*Score: ([0-9]+).*/\1/p')
238238
if [[ -z "$score" ]]; then
239239
echo "Error: Could not parse accessibility score from output." >&2
240240
exit 1

0 commit comments

Comments
 (0)