MM-61634 - adjust rhs a11y structure (#30168)

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Pablo Vélez
2025-02-19 00:26:41 -05:00
коммит произвёл GitHub
родитель bd376d3473
Коммит b0b379e167
8 изменённых файлов: 30 добавлений и 6 удалений

Просмотреть файл

@@ -41,7 +41,9 @@ const Header = ({channel, isArchived, isMobile, onClose}: Props) => {
/> />
</button> </button>
)} )}
<HeaderTitle> <HeaderTitle
id='rhsPanelTitle'
>
<FormattedMessage <FormattedMessage
id='channel_info_rhs.header.title' id='channel_info_rhs.header.title'
defaultMessage='Info' defaultMessage='Info'

Просмотреть файл

@@ -40,7 +40,9 @@ const Header = ({channel, canGoBack, onClose, goBack}: Props) => {
</button> </button>
)} )}
<HeaderTitle> <HeaderTitle
id='rhsPanelTitle'
>
<FormattedMessage <FormattedMessage
id='channel_members_rhs.header.title' id='channel_members_rhs.header.title'
defaultMessage='Members' defaultMessage='Members'

Просмотреть файл

@@ -18,6 +18,7 @@ exports[`components/post_edit_history should display error screen if errors are
> >
<span <span
class="sidebar--right__title" class="sidebar--right__title"
id="rhsPanelTitle"
> >
Edit History Edit History
<div <div
@@ -181,6 +182,7 @@ exports[`components/post_edit_history should match snapshot 1`] = `
> >
<span <span
class="sidebar--right__title" class="sidebar--right__title"
id="rhsPanelTitle"
> >
Edit History Edit History
<div <div

Просмотреть файл

@@ -14,6 +14,8 @@ import {shouldRhsOverlapChannelView} from '../utils';
interface Props extends HTMLAttributes<'div'> { interface Props extends HTMLAttributes<'div'> {
children: React.ReactNode; children: React.ReactNode;
rightWidthHolderRef: React.RefObject<HTMLDivElement>; rightWidthHolderRef: React.RefObject<HTMLDivElement>;
ariaLabel?: string;
ariaLabeledby?: string;
} }
function ResizableRhs({ function ResizableRhs({
@@ -22,6 +24,8 @@ function ResizableRhs({
id, id,
className, className,
rightWidthHolderRef, rightWidthHolderRef,
ariaLabel,
ariaLabeledby,
}: Props) { }: Props) {
const containerRef = useRef<HTMLDivElement>(null); const containerRef = useRef<HTMLDivElement>(null);
@@ -91,7 +95,8 @@ function ResizableRhs({
className={className} className={className}
role={role} role={role}
ref={containerRef} ref={containerRef}
aria-labelledby='rhsPanelTitle' aria-label={ariaLabel}
aria-labelledby={ariaLabeledby || 'rhsPanelTitle'}
> >
{children} {children}
<ResizableDivider <ResizableDivider

Просмотреть файл

@@ -135,7 +135,10 @@ class RhsCardHeader extends React.PureComponent<Props> {
return ( return (
<div className='sidebar--right__header'> <div className='sidebar--right__header'>
<span className='sidebar--right__title'> <span
className='sidebar--right__title'
id='rhsPanelTitle'
>
{back} {back}
<FormattedMessage <FormattedMessage
id='search_header.title5' id='search_header.title5'

Просмотреть файл

@@ -167,7 +167,10 @@ class RhsHeaderPost extends React.PureComponent<Props> {
return ( return (
<div className='sidebar--right__header'> <div className='sidebar--right__header'>
<span className='sidebar--right__title'> <span
className='sidebar--right__title'
id='rhsPanelTitle'
>
{back} {back}
<FormattedMessage <FormattedMessage
id='rhs_header.details' id='rhs_header.details'

Просмотреть файл

@@ -52,7 +52,10 @@ function SearchResultsHeader(props: Props) {
return ( return (
<div className='sidebar--right__header'> <div className='sidebar--right__header'>
<span className='sidebar--right__title'> <span
className='sidebar--right__title'
id='rhsPanelTitle'
>
{props.canGoBack && ( {props.canGoBack && (
<button <button
className='sidebar--right__back btn btn-icon btn-sm' className='sidebar--right__back btn btn-icon btn-sm'

Просмотреть файл

@@ -52,6 +52,8 @@ export type Props = {
selectedPostCardId: string; selectedPostCardId: string;
isSavedPosts?: boolean; isSavedPosts?: boolean;
isRecentMentions?: boolean; isRecentMentions?: boolean;
ariaLabel?: string;
ariaLabeledby?: string;
actions: { actions: {
setRhsExpanded: (expanded: boolean) => void; setRhsExpanded: (expanded: boolean) => void;
showPinnedPosts: (channelId: string) => void; showPinnedPosts: (channelId: string) => void;
@@ -339,6 +341,8 @@ export default class SidebarRight extends React.PureComponent<Props, State> {
id='sidebar-right' id='sidebar-right'
role='region' role='region'
rightWidthHolderRef={this.sidebarRightWidthHolder} rightWidthHolderRef={this.sidebarRightWidthHolder}
ariaLabel={this.props.ariaLabel}
ariaLabeledby={this.props.ariaLabeledby}
> >
<div <div
tabIndex={-1} tabIndex={-1}