Skip to content

Conversation

@gilbert-hernandez
Copy link
Contributor

@gilbert-hernandez gilbert-hernandez commented Nov 24, 2025

https://stellarwp.atlassian.net/browse/KAD-4904
https://stellarwp.atlassian.net/browse/KAD-4905
https://stellarwp.atlassian.net/browse/KAD-4907

Several changes for accessibility for the countdown block. Adds a play/pause button, adds a "timer" role to the the html, and adds an announcement for screen readers.

Video:
https://share.zight.com/Kou27Z7G

@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2025

🎉 Zip build complete

Build timestamp

@gilbert-hernandez gilbert-hernandez marked this pull request as draft December 15, 2025 20:10
@gilbert-hernandez gilbert-hernandez marked this pull request as ready for review December 16, 2025 16:42
@gilbert-hernandez gilbert-hernandez requested review from alaca, pramodjodhani and ravinderk and removed request for oakesjosh December 16, 2025 17:06
<button
type="button"
className={`kb-countdown-pause-button kb-countdown-pause-button-${pauseButtonPosition || 'top-right'}`}
aria-label="Pause countdown timer"
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez can we make this translatable?

title="Pause countdown"
>
<span className="kb-countdown-pause-icon" aria-hidden="true">
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez I suggest using an SVG icon instead of a symbol for visual consistency.

}}
>
<span className="kb-countdown-pause-icon" aria-hidden="true">
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez I suggest using an SVG icon instead of a symbol for visual consistency.

newButton.setAttribute('title', 'Resume countdown');
const icon = newButton.querySelector('.kb-countdown-pause-icon');
if (icon) {
icon.textContent = '▶';
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez I suggest using an SVG icon instead of a symbol for visual consistency.

if (window.kadenceCountdown.prefersReducedMotion) {
window.kadenceCountdown.cache[id].paused = true;
newButton.setAttribute('aria-pressed', 'true');
newButton.setAttribute('aria-label', 'Resume countdown timer');
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez can we make this translatable?

window.kadenceCountdown.cache[id].paused = true;
button.setAttribute('aria-pressed', 'true');
button.setAttribute('aria-label', 'Resume countdown timer');
button.setAttribute('title', 'Resume countdown');
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez can we make this translatable?

window.kadenceCountdown.cache[id].paused = false;
button.setAttribute('aria-pressed', 'false');
button.setAttribute('aria-label', 'Pause countdown timer');
button.setAttribute('title', 'Pause countdown');
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez can we make this translatable?

// Resume
window.kadenceCountdown.cache[id].paused = false;
button.setAttribute('aria-pressed', 'false');
button.setAttribute('aria-label', 'Pause countdown timer');
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez can we make this translatable?

'Countdown timer has ended. ' + completeText
);
} else {
window.kadenceCountdown.announceToScreenReader(
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez can we make this translatable?

completeContent.textContent || completeContent.innerText || ''
);
if (completeText.trim()) {
window.kadenceCountdown.announceToScreenReader(
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez can we make this translatable?

Copy link
Member

@alaca alaca left a comment

Choose a reason for hiding this comment

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

Looks good 👍

button.setAttribute('title', 'Pause countdown');
const icon = button.querySelector('.kb-countdown-pause-icon');
if (icon) {
icon.textContent = '⏸';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replace with SVG

@gilbert-hernandez
Copy link
Contributor Author

I reached out to Jeffrey regarding SVG play/pause icons.

@gilbert-hernandez
Copy link
Contributor Author

Updated translations and replaced play/pause buttons with SVG icons.

@gilbert-hernandez gilbert-hernandez merged commit 0deeacb into accessibility_audit Jan 12, 2026
@gilbert-hernandez gilbert-hernandez deleted the KAD-4904_count_down_pause_button branch January 12, 2026 17:16
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.

5 participants