From b4ff3f15adee782c402dab68ad0b7dec6a6eb9a4 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Thu, 8 Jan 2026 11:44:14 +0000 Subject: [PATCH] Tear down full-project-search-promo (#30474) GitOrigin-RevId: 9af516202bdf281b11348726667037fa458d66d9 --- .../Features/Tutorial/TutorialController.mjs | 1 - .../web/frontend/extracted-translations.json | 1 - .../components/full-project-search-button.tsx | 122 +----------------- services/web/locales/en.json | 1 - 4 files changed, 4 insertions(+), 121 deletions(-) diff --git a/services/web/app/src/Features/Tutorial/TutorialController.mjs b/services/web/app/src/Features/Tutorial/TutorialController.mjs index d31cd2da39..fd74350367 100644 --- a/services/web/app/src/Features/Tutorial/TutorialController.mjs +++ b/services/web/app/src/Features/Tutorial/TutorialController.mjs @@ -12,7 +12,6 @@ const VALID_KEYS = [ 'history-restore-promo', 'us-gov-banner', 'us-gov-banner-fedramp', - 'full-project-search-promo', 'editor-popup-ux-survey', 'wf-features-moved', 'review-mode', diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 4279d8a8c3..fceb8b6558 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1188,7 +1188,6 @@ "notification_personal_and_group_subscriptions": "", "notification_project_invite_accepted_message": "", "notification_project_invite_message": "", - "now_you_can_search_your_whole_project_not_just_this_file": "", "number_of_users": "", "numbered_list": "", "oauth_orcid_description": "", diff --git a/services/web/frontend/js/features/source-editor/components/full-project-search-button.tsx b/services/web/frontend/js/features/source-editor/components/full-project-search-button.tsx index ca46aed5fe..dc46f3b497 100644 --- a/services/web/frontend/js/features/source-editor/components/full-project-search-button.tsx +++ b/services/web/frontend/js/features/source-editor/components/full-project-search-button.tsx @@ -3,49 +3,19 @@ import OLButton from '@/shared/components/ol/ol-button' import OLTooltip from '@/shared/components/ol/ol-tooltip' import { useLayoutContext } from '@/shared/context/layout-context' import { closeSearchPanel, SearchQuery } from '@codemirror/search' -import { forwardRef, memo, Ref, useCallback, useEffect, useRef } from 'react' +import { useCallback } from 'react' import { useCodeMirrorViewContext } from './codemirror-context' import MaterialIcon from '@/shared/components/material-icon' import { useTranslation } from 'react-i18next' -import { Overlay, Popover } from 'react-bootstrap' -import Close from '@/shared/components/close' -import useTutorial from '@/shared/hooks/promotions/use-tutorial' -import { useEditorContext } from '@/shared/context/editor-context' -import getMeta from '@/utils/meta' import { useIsNewEditorEnabled } from '@/features/ide-redesign/utils/new-editor-utils' import { useRailContext } from '@/features/ide-redesign/contexts/rail-context' -const PROMOTION_SIGNUP_CUT_OFF_DATE = new Date('2025-04-22T00:00:00Z') - export const FullProjectSearchButton = ({ query }: { query: SearchQuery }) => { const view = useCodeMirrorViewContext() const { t } = useTranslation() const { setProjectSearchIsOpen } = useLayoutContext() const newEditor = useIsNewEditorEnabled() const { openTab } = useRailContext() - const ref = useRef(null) - - const { inactiveTutorials } = useEditorContext() - - const hasCompletedTutorial = inactiveTutorials.includes( - 'full-project-search-promo' - ) - - const { showPopup, tryShowingPopup, hideUntilReload, completeTutorial } = - useTutorial('full-project-search-promo', { - name: 'full-project-search-promotion', - }) - - let isEligibleForPromotion = true - const signUpDateString = getMeta('ol-user')?.signUpDate - if (!signUpDateString) { - isEligibleForPromotion = false - } else { - const signupDate = new Date(signUpDateString) - if (signupDate > PROMOTION_SIGNUP_CUT_OFF_DATE) { - isEligibleForPromotion = false - } - } const openFullProjectSearch = useCallback(() => { if (newEditor) { @@ -68,106 +38,22 @@ export const FullProjectSearchButton = ({ query }: { query: SearchQuery }) => { location: 'search-form', }) openFullProjectSearch() - if (!hasCompletedTutorial && isEligibleForPromotion) { - completeTutorial({ action: 'complete', event: 'promo-click' }) - } - }, [ - completeTutorial, - openFullProjectSearch, - hasCompletedTutorial, - isEligibleForPromotion, - ]) + }, [openFullProjectSearch]) return ( <> - + - {!hasCompletedTutorial && isEligibleForPromotion && ( - - )} ) } - -type PromotionOverlayProps = { - showPopup: boolean - tryShowingPopup: () => void - completeTutorial: (event: { - action: 'complete' - event: 'promo-dismiss' - }) => void - hideUntilReload: () => void -} - -const PromotionOverlay = forwardRef( - function PromotionOverlay( - props: PromotionOverlayProps, - ref: Ref - ) { - if (typeof ref === 'function' || !ref?.current) { - return null - } - - return - } -) - -const PromotionContent = memo(function PromotionContent({ - showPopup, - tryShowingPopup, - completeTutorial, - hideUntilReload, - target, -}: PromotionOverlayProps & { - target: HTMLButtonElement -}) { - const { t } = useTranslation() - - useEffect(() => { - tryShowingPopup() - }, [tryShowingPopup]) - - const onHide = useCallback(() => { - hideUntilReload() - }, [hideUntilReload]) - - const onClose = useCallback(() => { - completeTutorial({ - action: 'complete', - event: 'promo-dismiss', - }) - }, [completeTutorial]) - - return ( - - - - - {t('now_you_can_search_your_whole_project_not_just_this_file')} - - - - ) -}) diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 651c066307..6a54e768bc 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -1542,7 +1542,6 @@ "notification_project_invite_accepted_message": "You’ve joined __projectName__", "notification_project_invite_message": "__userName__ would like you to join __projectName__", "november": "November", - "now_you_can_search_your_whole_project_not_just_this_file": "Now you can search your whole project (not just this file!)", "number_collab": "Number of collaborators", "number_collab_info": "The number of people you can invite to work on a project with you. The limit is per project, so you can invite different people to each project.", "number_of_projects": "Number of projects",