0

[FaceGaze] Add list context for dialog item spoken feedback

* Add list order 'x of y' to spoken feedback for dialog items.

Screenshot of relevant UI:
https://screenshot.googleplex.com/5CAgoRQLgiBJfWs

Fixed: 373701124
Change-Id: I10a8260778d7362690cc1f18d8fac751960bee27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5950825
Commit-Queue: Amanda Lin Dietz <aldietz@google.com>
Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372096}
This commit is contained in:
Amanda Lin Dietz 2024-10-22 16:25:11 +00:00 committed by Chromium LUCI CQ
parent b99c5f00b4
commit 8e9c198f91
2 changed files with 11 additions and 5 deletions
chrome
app
browser/resources/ash/settings/os_a11y_page

@ -1344,10 +1344,10 @@
Add an action
</message>
<message name="IDS_OS_SETTINGS_ACCESSIBILITY_FACEGAZE_ACTIONS_DIALOG_SELECTED_ITEM_INSTRUCTION" desc="Instruction read by screen reader when users can unselect a list item." is_accessibility_with_no_ui="true">
<ph name="ITEM">$1<ex>Pause or resume face control</ex></ph> selected. Press Search plus Space to unselect.
<ph name="ITEM">$1<ex>Pause or resume face control</ex></ph> selected. <ph name="INDEX">$2<ex>1</ex></ph> of <ph name="COUNT">$3<ex>13</ex></ph>. Press Search plus Space to unselect.
</message>
<message name="IDS_OS_SETTINGS_ACCESSIBILITY_FACEGAZE_ACTIONS_DIALOG_NOT_SELECTED_ITEM_INSTRUCTION" desc="Instruction read by screen reader when users can select a list item." is_accessibility_with_no_ui="true">
<ph name="ITEM">$1<ex>Pause or resume face control</ex></ph> not selected. Press Search plus Space to select.
<ph name="ITEM">$1<ex>Pause or resume face control</ex></ph> not selected. <ph name="INDEX">$2<ex>1</ex></ph> of <ph name="COUNT">$3<ex>13</ex></ph>. Press Search plus Space to select.
</message>
<message name="IDS_OS_SETTINGS_ACCESSIBILITY_FACEGAZE_ACTIONS_DIALOG_KEY_COMBINATION_TITLE" desc="Title for dialog page to create a custom key combination in the action settings.">
Create key combination

@ -402,14 +402,20 @@ export class FaceGazeAddActionDialogElement extends
private getActionAriaLabel_(macro: MacroName, selected: boolean): string {
const label = selected ? 'faceGazeActionsDialogSelectedItemInstruction' :
'faceGazeActionsDialogNotSelectedItemInstruction';
return this.i18n(label, this.getActionDisplayText_(macro));
return this.i18n(
label, this.getActionDisplayText_(macro),
this.displayedActions_.indexOf(macro) + 1,
this.displayedActions_.length);
}
private getGestureAriaLabel_(macro: FacialGesture, selected: boolean):
private getGestureAriaLabel_(gesture: FacialGesture, selected: boolean):
string {
const displayedGestures = this.get('displayedGestures_');
const label = selected ? 'faceGazeActionsDialogSelectedItemInstruction' :
'faceGazeActionsDialogNotSelectedItemInstruction';
return this.i18n(label, this.getGestureDisplayText_(macro));
return this.i18n(
label, this.getGestureDisplayText_(gesture),
displayedGestures.indexOf(gesture) + 1, displayedGestures.length);
}
// Dialog page navigation.