Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions lib/cjs/generated/rum.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,10 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & {
* Performance data. (Web Vitals, etc.)
*/
performance?: ViewPerformanceData;
/**
* Accessibility properties of the view
*/
accessibility?: ViewAccessibilityProperties;
[k: string]: unknown;
};
/**
Expand Down Expand Up @@ -1740,3 +1744,93 @@ export interface RumRect {
readonly height: number;
[k: string]: unknown;
}
/**
* Compact representation of accessibility features for a view
*/
export interface ViewAccessibilityProperties {
/**
* User’s preferred text scale relative to the default system size.
*/
readonly text_size?: string;
/**
* Indicates whether a screen reader is currently active.
*/
readonly screen_reader_enabled?: boolean;
/**
* Indicates whether the system-wide bold text accessibility setting is enabled.
*/
readonly bold_text_enabled?: boolean;
/**
* Indicates whether the system-wide reduce transparency setting is enabled.
*/
readonly reduce_transparency_enabled?: boolean;
/**
* Indicates whether the system-wide reduce motion setting is enabled.
*/
readonly reduce_motion_enabled?: boolean;
Comment on lines +1767 to +1770

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❓ question: ‏ What is the difference between reduce_motion_enabled and reduced_animations_enabled? In the browser, we expect animations to be reduced or removed when we detect the prefers-reduced-motion flag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

reduce_motion_enabled indicates whether the Reduce Motion setting is in an enabled state. (doc)
reduce_animations_enabled indicates whether the Reduce Motion and the Prefer Cross-Fade Transitions settings are in an enabled state. (doc)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems that reduce_motion is only available on iOS, while Android and the web focus more on animations. Should we consolidate this into a single value?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion !
Just to give some context, we aligned on these two attributes a while ago through multiple RFCs, and they’re already being sent as custom attributes behind a feature flag. The implementation has been released in the iOS SDK and is currently being dogfooded in the iOS mobile app, where it's also used to populate a dashboard.
At this stage, the work is already quite far along, so I don't think it would make sense to revisit the structure unless there's a critical issue.

/**
* Indicates whether the system-wide button shapes setting is enabled.
*/
readonly button_shapes_enabled?: boolean;
/**
* Indicates whether the system-wide color inversion setting is enabled.
*/
readonly invert_colors_enabled?: boolean;
Comment thread
mormubis marked this conversation as resolved.
/**
* Indicates whether the system-wide increase contrast setting is enabled.
*/
readonly increase_contrast_enabled?: boolean;
/**
* Indicates whether an alternative input method like Switch Control or Switch Access is currently enabled.
*/
readonly assistive_switch_enabled?: boolean;
/**
* Indicates whether the system-wide AssistiveTouch feature is currently enabled.
*/
readonly assistive_touch_enabled?: boolean;
/**
* Indicates whether the video autoplay setting is enabled in the system or application.
*/
readonly video_autoplay_enabled?: boolean;
/**
* Indicates whether closed captioning is enabled for media playback.
*/
readonly closed_captioning_enabled?: boolean;
/**
* Indicates whether the system-wide mono audio setting is enabled.
*/
readonly mono_audio_enabled?: boolean;
/**
* Indicates whether the Shake to Undo feature is enabled.
*/
readonly shake_to_undo_enabled?: boolean;
/**
* Indicates whether the user prefers reduced animations or cross-fade transitions.
*/
readonly reduced_animations_enabled?: boolean;
/**
* Indicates whether the system should differentiate interface elements without relying solely on color.
*/
readonly should_differentiate_without_color?: boolean;
/**
* Indicates whether the device display is currently using grayscale mode.
*/
readonly grayscale_enabled?: boolean;
/**
* Indicates whether the device is currently locked to a single app through Guided Access or Screen Pinning.
*/
readonly single_app_mode_enabled?: boolean;
/**
* Indicates whether on/off switch labels are enabled in the system settings.
*/
readonly on_off_switch_labels_enabled?: boolean;
/**
* Indicates whether the Speak Screen feature is enabled.
*/
readonly speak_screen_enabled?: boolean;
/**
* Indicates whether the text-to-speech selection feature is enabled.
*/
readonly speak_selection_enabled?: boolean;
[k: string]: unknown;
}
94 changes: 94 additions & 0 deletions lib/esm/generated/rum.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,10 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & {
* Performance data. (Web Vitals, etc.)
*/
performance?: ViewPerformanceData;
/**
* Accessibility properties of the view
*/
accessibility?: ViewAccessibilityProperties;
[k: string]: unknown;
};
/**
Expand Down Expand Up @@ -1740,3 +1744,93 @@ export interface RumRect {
readonly height: number;
[k: string]: unknown;
}
/**
* Compact representation of accessibility features for a view
*/
export interface ViewAccessibilityProperties {
/**
* User’s preferred text scale relative to the default system size.
*/
readonly text_size?: string;
/**
* Indicates whether a screen reader is currently active.
*/
readonly screen_reader_enabled?: boolean;
/**
* Indicates whether the system-wide bold text accessibility setting is enabled.
*/
readonly bold_text_enabled?: boolean;
/**
* Indicates whether the system-wide reduce transparency setting is enabled.
*/
readonly reduce_transparency_enabled?: boolean;
/**
* Indicates whether the system-wide reduce motion setting is enabled.
*/
readonly reduce_motion_enabled?: boolean;
/**
* Indicates whether the system-wide button shapes setting is enabled.
*/
readonly button_shapes_enabled?: boolean;
/**
* Indicates whether the system-wide color inversion setting is enabled.
*/
readonly invert_colors_enabled?: boolean;
/**
* Indicates whether the system-wide increase contrast setting is enabled.
*/
readonly increase_contrast_enabled?: boolean;
/**
* Indicates whether an alternative input method like Switch Control or Switch Access is currently enabled.
*/
readonly assistive_switch_enabled?: boolean;
/**
* Indicates whether the system-wide AssistiveTouch feature is currently enabled.
*/
readonly assistive_touch_enabled?: boolean;
/**
* Indicates whether the video autoplay setting is enabled in the system or application.
*/
readonly video_autoplay_enabled?: boolean;
/**
* Indicates whether closed captioning is enabled for media playback.
*/
readonly closed_captioning_enabled?: boolean;
/**
* Indicates whether the system-wide mono audio setting is enabled.
*/
readonly mono_audio_enabled?: boolean;
/**
* Indicates whether the Shake to Undo feature is enabled.
*/
readonly shake_to_undo_enabled?: boolean;
/**
* Indicates whether the user prefers reduced animations or cross-fade transitions.
*/
readonly reduced_animations_enabled?: boolean;
/**
* Indicates whether the system should differentiate interface elements without relying solely on color.
*/
readonly should_differentiate_without_color?: boolean;
/**
* Indicates whether the device display is currently using grayscale mode.
*/
readonly grayscale_enabled?: boolean;
/**
* Indicates whether the device is currently locked to a single app through Guided Access or Screen Pinning.
*/
readonly single_app_mode_enabled?: boolean;
/**
* Indicates whether on/off switch labels are enabled in the system settings.
*/
readonly on_off_switch_labels_enabled?: boolean;
/**
* Indicates whether the Speak Screen feature is enabled.
*/
readonly speak_screen_enabled?: boolean;
/**
* Indicates whether the text-to-speech selection feature is enabled.
*/
readonly speak_selection_enabled?: boolean;
[k: string]: unknown;
}
115 changes: 115 additions & 0 deletions schemas/rum/_view-accessibility-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "rum/_view-accessibility-schema.json",
"title": "ViewAccessibilityProperties",
"type": "object",
"description": "Compact representation of accessibility features for a view",
"readOnly": true,
"properties": {
"text_size": {
"type": "string",
"description": "User’s preferred text scale relative to the default system size.",
"readOnly": true
},
"screen_reader_enabled": {
"type": "boolean",
"description": "Indicates whether a screen reader is currently active.",
"readOnly": true
},
"bold_text_enabled": {
"type": "boolean",
"description": "Indicates whether the system-wide bold text accessibility setting is enabled.",
"readOnly": true
},
"reduce_transparency_enabled": {
"type": "boolean",
"description": "Indicates whether the system-wide reduce transparency setting is enabled.",
"readOnly": true
},
"reduce_motion_enabled": {
"type": "boolean",
"description": "Indicates whether the system-wide reduce motion setting is enabled.",
"readOnly": true
},
"button_shapes_enabled": {
"type": "boolean",
"description": "Indicates whether the system-wide button shapes setting is enabled.",
"readOnly": true
},
"invert_colors_enabled": {
"type": "boolean",
"description": "Indicates whether the system-wide color inversion setting is enabled.",
"readOnly": true
},
"increase_contrast_enabled": {
"type": "boolean",
"description": "Indicates whether the system-wide increase contrast setting is enabled.",
"readOnly": true
},
"assistive_switch_enabled": {
"type": "boolean",
"description": "Indicates whether an alternative input method like Switch Control or Switch Access is currently enabled.",
"readOnly": true
},
"assistive_touch_enabled": {
"type": "boolean",
"description": "Indicates whether the system-wide AssistiveTouch feature is currently enabled.",
"readOnly": true
},
"video_autoplay_enabled": {
"type": "boolean",
"description": "Indicates whether the video autoplay setting is enabled in the system or application.",
"readOnly": true
},
"closed_captioning_enabled": {
"type": "boolean",
"description": "Indicates whether closed captioning is enabled for media playback.",
"readOnly": true
},
"mono_audio_enabled": {
"type": "boolean",
"description": "Indicates whether the system-wide mono audio setting is enabled.",
"readOnly": true
},
"shake_to_undo_enabled": {
"type": "boolean",
"description": "Indicates whether the Shake to Undo feature is enabled.",
"readOnly": true
},
"reduced_animations_enabled": {
"type": "boolean",
"description": "Indicates whether the user prefers reduced animations or cross-fade transitions.",
"readOnly": true
},
"should_differentiate_without_color": {
"type": "boolean",
"description": "Indicates whether the system should differentiate interface elements without relying solely on color.",
"readOnly": true
},
"grayscale_enabled": {
"type": "boolean",
"description": "Indicates whether the device display is currently using grayscale mode.",
"readOnly": true
},
"single_app_mode_enabled": {
"type": "boolean",
"description": "Indicates whether the device is currently locked to a single app through Guided Access or Screen Pinning.",
"readOnly": true
},
"on_off_switch_labels_enabled": {
"type": "boolean",
"description": "Indicates whether on/off switch labels are enabled in the system settings.",
"readOnly": true
},
"speak_screen_enabled": {
"type": "boolean",
"description": "Indicates whether the Speak Screen feature is enabled.",
"readOnly": true
},
"speak_selection_enabled": {
"type": "boolean",
"description": "Indicates whether the text-to-speech selection feature is enabled.",
"readOnly": true
}
}
}
4 changes: 4 additions & 0 deletions schemas/rum/view-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@
"performance": {
"description": "Performance data. (Web Vitals, etc.)",
"allOf": [{ "$ref": "_view-performance-schema.json" }]
},
"accessibility": {
"description": "Accessibility properties of the view",
"allOf": [{ "$ref": "_view-accessibility-schema.json" }]
}
},
"readOnly": true
Expand Down