From fb92a437552d29076a89be228b6a54c9a13780eb Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Wed, 18 Mar 2026 11:03:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8(frontend)=20hint=20min=20char=20se?= =?UTF-8?q?arch=20users?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We give a hint to the user about the minimum number of characters required to perform a search in the quick search input of the doc share modal. This is to improve the user experience. --- CHANGELOG.md | 4 +++ .../app-impress/doc-member-create.spec.ts | 35 +++++++++++++++++++ .../quick-search/QuickSearchInput.tsx | 3 +- .../quick-search/QuickSearchStyle.tsx | 5 +-- .../components/DocShareAddMemberList.tsx | 3 +- .../doc-share/components/DocShareModal.tsx | 30 +++++++++++++--- 6 files changed, 72 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0ddb080..5564342c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to ## [Unreleased] +### Added + +- 🚸(frontend) hint min char search users #2064 + ### Changed - 💄(frontend) improve comments highlights #1961 diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-member-create.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-member-create.spec.ts index a95b78aa..8f2418b4 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-member-create.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-member-create.spec.ts @@ -17,6 +17,41 @@ test.describe('Document create member', () => { await page.goto('/'); }); + test('it checks search hints', async ({ page, browserName }) => { + await createDoc(page, 'select-multi-users', browserName, 1); + + await page.getByRole('button', { name: 'Share' }).click(); + + const shareModal = page.getByLabel('Share the document'); + await expect(shareModal.getByText('Document owner')).toBeVisible(); + + const inputSearch = page.getByTestId('quick-search-input'); + await inputSearch.fill('u'); + await expect(shareModal.getByText('Document owner')).toBeHidden(); + await expect( + shareModal.getByText('Type at least 3 characters to display user names'), + ).toBeVisible(); + await inputSearch.fill('user'); + await expect( + shareModal.getByText('Type at least 3 characters to display user names'), + ).toBeHidden(); + await expect(shareModal.getByText('Choose a user')).toBeVisible(); + await inputSearch.fill('anything'); + await expect(shareModal.getByText('Choose a user')).toBeHidden(); + await expect( + shareModal.getByText( + 'No results. Type a full email address to invite someone.', + ), + ).toBeVisible(); + await inputSearch.fill('anything@test.com'); + await expect( + shareModal.getByText( + 'No results. Type a full email address to invite someone.', + ), + ).toBeHidden(); + await expect(shareModal.getByText('Choose the email')).toBeVisible(); + }); + test('it selects 2 users and 1 invitation', async ({ page, browserName }) => { const inputFill = 'user.test'; const responsePromise = page.waitForResponse( diff --git a/src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx b/src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx index 8137464c..aa04efcf 100644 --- a/src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx +++ b/src/frontend/apps/impress/src/components/quick-search/QuickSearchInput.tsx @@ -48,7 +48,7 @@ export const QuickSearchInput = ({ $direction="row" $align="center" className="quick-search-input" - $gap={spacingsTokens['2xs']} + $gap={spacingsTokens['xxs']} $padding={{ horizontal: 'base', vertical: 'xxs' }} >