fix(client): Improve navigation search bar clarity (#59140)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
Josue Igiraneza
2025-03-13 07:29:45 +02:00
committed by GitHub
parent f4d6683adb
commit f648dac32f
4 changed files with 8 additions and 9 deletions

View File

@@ -778,13 +778,12 @@
"search": {
"label": "Search",
"placeholder": {
"default": "Search our tutorials",
"numbered": "Search {{ roundedTotalRecords }}+ tutorials"
"default": "Search our news articles, tutorials, and books",
"numbered": "Search {{ roundedTotalRecords }}+ news articles, tutorials, and books"
},
"see-results": "See all results for {{searchQuery}}",
"no-tutorials": "No tutorials found",
"try": "Looking for something? Try the search bar on this page.",
"no-results": "We could not find anything relating to <0>{{query}}</0>",
"no-results": "No results found",
"result-list": "Search results"
},
"misc": {

View File

@@ -19,7 +19,7 @@ const SearchBarFooter = ({
onMouseLeave
}: SearchBarFooterProps) => {
const { t } = useTranslation();
const title = t('search.no-tutorials');
const title = t('search.no-results');
if (!query) {
return null;

View File

@@ -142,7 +142,7 @@ describe('Search bar placeholder tests:', () => {
if (clientLocale === 'english') {
describe('Placeholder strings', () => {
test('When the total number of hits is less than 100 the expected placeholder is generated', async () => {
const expected = 'Search our tutorials';
const expected = 'Search our news articles, tutorials, and books';
const placeholderText = await generateSearchPlaceholder({
mockRecordsNum: 99,
locale: 'english'
@@ -156,7 +156,7 @@ describe('Search bar placeholder tests:', () => {
mockRecordsNum: 100,
locale: 'english'
});
const expected = 'Search 100+ tutorials';
const expected = 'Search 100+ news articles, tutorials, and books';
expect(placeholderText).toEqual(expected);
});
@@ -166,7 +166,7 @@ describe('Search bar placeholder tests:', () => {
mockRecordsNum: 11000,
locale: 'english'
});
const expected = 'Search 11,000+ tutorials';
const expected = 'Search 11,000+ news articles, tutorials, and books';
expect(placeholderText).toEqual(expected);
});

View File

@@ -139,7 +139,7 @@ test.describe('Search bar', () => {
const resultList = page.getByRole('list', { name: 'Search results' });
await expect(resultList.getByRole('listitem')).toHaveCount(1);
await expect(resultList.getByRole('listitem')).toHaveText(
'No tutorials found'
'No results found'
);
});