From 4f6609db4992bed5f68be38d9e0ca47881010fe7 Mon Sep 17 00:00:00 2001 From: Abe Jellinek <1770299+AbeJellinek@users.noreply.github.com> Date: Mon, 9 Mar 2026 13:30:53 -0400 Subject: [PATCH 1/2] Read Aloud: Indicate skip granularity on buttons Using new `-granular` icons that just include the inner chevron from the normal ones. --- res/icons/20/skip-ahead-granular.svg | 3 +++ res/icons/20/skip-back-granular.svg | 3 +++ .../utility-popup/read-aloud-popup.js | 25 ++++++++++++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 res/icons/20/skip-ahead-granular.svg create mode 100644 res/icons/20/skip-back-granular.svg diff --git a/res/icons/20/skip-ahead-granular.svg b/res/icons/20/skip-ahead-granular.svg new file mode 100644 index 000000000..b6c6939ae --- /dev/null +++ b/res/icons/20/skip-ahead-granular.svg @@ -0,0 +1,3 @@ + + + diff --git a/res/icons/20/skip-back-granular.svg b/res/icons/20/skip-back-granular.svg new file mode 100644 index 000000000..c71549dd3 --- /dev/null +++ b/res/icons/20/skip-back-granular.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/common/components/utility-popup/read-aloud-popup.js b/src/common/components/utility-popup/read-aloud-popup.js index bb7738830..e4a2e63f0 100644 --- a/src/common/components/utility-popup/read-aloud-popup.js +++ b/src/common/components/utility-popup/read-aloud-popup.js @@ -7,6 +7,8 @@ import IconSkipBack from '../../../../res/icons/20/skip-back.svg'; import IconPlay from '../../../../res/icons/20/play.svg'; import IconPause from '../../../../res/icons/20/pause.svg'; import IconSkipAhead from '../../../../res/icons/20/skip-ahead.svg'; +import IconSkipBackGranular from '../../../../res/icons/20/skip-back-granular.svg'; +import IconSkipAheadGranular from '../../../../res/icons/20/skip-ahead-granular.svg'; import IconAnnotate from '../../../../res/icons/20/read-aloud-annotate.svg'; import IconLoading from '../../../../res/icons/16/loading.svg'; import IconClock from '../../../../res/icons/12/clock.svg'; @@ -461,6 +463,19 @@ function PlaybackControls(props) { const { l10n } = useLocalization(); let { showOptions, onToggleOptions, showSpinner, paused, onPlayPause, controller, onAddAnnotation, onLockPosition } = props; + let [altDown, setAltDown] = useState(false); + + useEffect(() => { + let handleKey = (event) => { + setAltDown(event.altKey); + }; + window.addEventListener('keydown', handleKey); + window.addEventListener('keyup', handleKey); + return () => { + window.removeEventListener('keydown', handleKey); + window.removeEventListener('keyup', handleKey); + }; + }, []); function handleAddAnnotation() { let segment = controller?.getSegmentToAnnotate(); @@ -470,7 +485,11 @@ function PlaybackControls(props) { } return ( -
+
setAltDown(event.altKey)} + >
+ >{altDown ? : } {showSpinner ? + >{altDown ? : }