From b719059bea477a7ec2b52ed814cd0932dcacb913 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Fri, 1 May 2026 22:44:43 +0300 Subject: [PATCH] Fix: accessible community cloud screen --- .../ManageMenu/CommunityCloud/CloudSearch.tsx | 11 +++++--- .../CommunityCloud/CommunityCloud.tsx | 1 + .../CommunityCloud/SearchResults.tsx | 5 +++- .../SnippetsTable/SnippetsListTable.tsx | 26 ++++++++++++++++--- .../SnippetsTable/SnippetsTable.tsx | 1 + .../ManageMenu/SnippetsTable/TableColumns.tsx | 14 +++++++--- 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/js/components/ManageMenu/CommunityCloud/CloudSearch.tsx b/src/js/components/ManageMenu/CommunityCloud/CloudSearch.tsx index f64698dc..a31b7a4d 100644 --- a/src/js/components/ManageMenu/CommunityCloud/CloudSearch.tsx +++ b/src/js/components/ManageMenu/CommunityCloud/CloudSearch.tsx @@ -42,7 +42,12 @@ const SearchBox = () => { onChange={event => setQuery(event.target.value)} placeholder={__('e.g. Remove unused JavaScript…', 'code-snippets')} /> - {isSearching && } + + {isSearching && <> + + {__('Searching…', 'code-snippets')} + } + @@ -90,12 +95,12 @@ const SearchResultsTable = () => { } const ErrorBanner = () => -
+

{__('An error occurred while fetching search results. Please try again.')}

const NoSearchResultsBanner = () => -
+

{__('No snippets or codevault could be found with that search term. Please try again.', 'code-snippets')}

diff --git a/src/js/components/ManageMenu/CommunityCloud/CommunityCloud.tsx b/src/js/components/ManageMenu/CommunityCloud/CommunityCloud.tsx index 174fb963..d727e2ad 100644 --- a/src/js/components/ManageMenu/CommunityCloud/CommunityCloud.tsx +++ b/src/js/components/ManageMenu/CommunityCloud/CommunityCloud.tsx @@ -35,6 +35,7 @@ export const CommunityCloud = () => { key={tab} href={buildUrl(window.location.href, { type: tab })} className={classnames('nav-tab', `${tab}-tab`, { 'nav-tab-active': tab === currentTab })} + aria-current={tab === currentTab ? 'page' : undefined} onClick={event => { event.preventDefault() diff --git a/src/js/components/ManageMenu/CommunityCloud/SearchResults.tsx b/src/js/components/ManageMenu/CommunityCloud/SearchResults.tsx index a93216bd..a73937f4 100644 --- a/src/js/components/ManageMenu/CommunityCloud/SearchResults.tsx +++ b/src/js/components/ManageMenu/CommunityCloud/SearchResults.tsx @@ -46,7 +46,10 @@ const CloudSnippetDetails: React.FC = ({ snippet, setI - {snippet.vote_count} + + {snippet.vote_count} + {` ${__('votes', 'code-snippets')}`} + {0 < snippet.tags.length ? diff --git a/src/js/components/ManageMenu/SnippetsTable/SnippetsListTable.tsx b/src/js/components/ManageMenu/SnippetsTable/SnippetsListTable.tsx index 7b80bc11..757a3f05 100644 --- a/src/js/components/ManageMenu/SnippetsTable/SnippetsListTable.tsx +++ b/src/js/components/ManageMenu/SnippetsTable/SnippetsListTable.tsx @@ -1,4 +1,4 @@ -import { __, _x, sprintf } from '@wordpress/i18n' +import { __, _n, _x, sprintf } from '@wordpress/i18n' import React, { Fragment, useEffect, useMemo, useState } from 'react' import classnames from 'classnames' import { createInterpolateElement } from '@wordpress/element' @@ -7,7 +7,7 @@ import { useSnippetsList } from '../../../hooks/useSnippetsList' import { handleUnknownError } from '../../../utils/errors' import { downloadBulkSnippetExportFile } from '../../../utils/files' import { REST_BASES } from '../../../utils/restAPI' -import { getSnippetType } from '../../../utils/snippets/snippets' +import { getSnippetDisplayName, getSnippetType } from '../../../utils/snippets/snippets' import { buildUrl } from '../../../utils/urls' import { ListTable } from '../../common/ListTable' import { SubmitButton } from '../../common/SubmitButton' @@ -96,6 +96,7 @@ const SnippetStatusCounts = () => { { event.preventDefault() setCurrentStatus(status) @@ -107,8 +108,8 @@ const SnippetStatusCounts = () => { sprintf(_x('(%d)', 'table view count', 'code-snippets'), snippetsByStatus.get(status)?.length ?? 0) } + {index < visibleStatuses.length - 1 && ' | '} - {index < visibleStatuses.length - 1 && ' | '} )} ) @@ -192,9 +193,14 @@ const FilterByTagControl: React.FC = ({ visibleSnippets }) = return 0 < tagsList.size ?
+ { @@ -172,7 +174,12 @@ const RowActions: React.FC = ({ snippet }) => { const NameColumn: React.FC = ({ snippet }) => <> {snippet.locked && ( -