From fe61ddf92e42fb52a5313fa4b01e1584f4c09e34 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Fri, 17 Jan 2025 10:42:01 +0000 Subject: [PATCH] Improve project search UI (#22909) GitOrigin-RevId: 83bc59269250afef3d25434b14151dbde5be5e5c --- services/web/frontend/extracted-translations.json | 4 ++++ .../js/features/ui/components/types/icon-button-props.ts | 2 +- services/web/frontend/js/shared/context/layout-context.tsx | 3 +-- services/web/locales/en.json | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 4e40711a4c..5d3bbf00df 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1168,6 +1168,10 @@ "project_ownership_transfer_confirmation_2": "", "project_renamed_or_deleted": "", "project_renamed_or_deleted_detail": "", + "project_search_file_count": "", + "project_search_file_count_plural": "", + "project_search_result_count": "", + "project_search_result_count_plural": "", "project_synced_with_git_repo_at": "", "project_synchronisation": "", "project_timed_out_enable_stop_on_first_error": "", diff --git a/services/web/frontend/js/features/ui/components/types/icon-button-props.ts b/services/web/frontend/js/features/ui/components/types/icon-button-props.ts index ec39180c7c..ec75bb6115 100644 --- a/services/web/frontend/js/features/ui/components/types/icon-button-props.ts +++ b/services/web/frontend/js/features/ui/components/types/icon-button-props.ts @@ -3,5 +3,5 @@ import { ButtonProps } from './button-props' export type IconButtonProps = ButtonProps & { accessibilityLabel?: string icon: string - type?: 'button' + type?: 'button' | 'submit' } diff --git a/services/web/frontend/js/shared/context/layout-context.tsx b/services/web/frontend/js/shared/context/layout-context.tsx index 05dcb28131..e285cb6b46 100644 --- a/services/web/frontend/js/shared/context/layout-context.tsx +++ b/services/web/frontend/js/shared/context/layout-context.tsx @@ -19,6 +19,7 @@ import { BinaryFile } from '@/features/file-view/types/binary-file' import useScopeEventEmitter from '@/shared/hooks/use-scope-event-emitter' import useEventListener from '@/shared/hooks/use-event-listener' import { isSplitTestEnabled } from '@/utils/splitTestUtils' +import { isMac } from '@/shared/utils/os' export type IdeLayout = 'sideBySide' | 'flat' export type IdeView = 'editor' | 'file' | 'pdf' | 'history' @@ -55,8 +56,6 @@ type LayoutContextValue = { setProjectSearchIsOpen: Dispatch> } -const isMac = /Mac/.test(window.navigator?.platform) - const debugPdfDetach = getMeta('ol-debugPdfDetach') export const LayoutContext = createContext( diff --git a/services/web/locales/en.json b/services/web/locales/en.json index e617afe901..f758c24979 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -1579,6 +1579,10 @@ "project_ownership_transfer_confirmation_2": "This action cannot be undone. The new owner will be notified and will be able to change project access settings (including removing your own access).", "project_renamed_or_deleted": "Project Renamed or Deleted", "project_renamed_or_deleted_detail": "This project has either been renamed or deleted by an external data source such as Dropbox. We don’t want to delete your data on Overleaf, so this project still contains your history and collaborators. If the project has been renamed please look in your project list for a new project under the new name.", + "project_search_file_count": "in __count__ file", + "project_search_file_count_plural": "in __count__ files", + "project_search_result_count": "__count__ result", + "project_search_result_count_plural": "__count__ results", "project_synced_with_git_repo_at": "This project is synced with the GitHub repository at", "project_synchronisation": "Project Synchronisation", "project_timed_out_enable_stop_on_first_error": "<0>Enable “Stop on first error” to help you find and fix errors right away.",