From edaf2f5f836ca7749cf1e40c396cfb17cce52e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pasteau?= <4895034+ClementPasteau@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:04:26 +0100 Subject: [PATCH] Remove games dashboard new feature highlight --- .../EditorContainers/HomePage/index.js | 78 ------------------- newIDE/app/src/Utils/UseDisplayNewFeature.js | 19 ++--- 2 files changed, 8 insertions(+), 89 deletions(-) diff --git a/newIDE/app/src/MainFrame/EditorContainers/HomePage/index.js b/newIDE/app/src/MainFrame/EditorContainers/HomePage/index.js index a293c2dc8883..502109c538f8 100644 --- a/newIDE/app/src/MainFrame/EditorContainers/HomePage/index.js +++ b/newIDE/app/src/MainFrame/EditorContainers/HomePage/index.js @@ -2,7 +2,6 @@ import * as React from 'react'; import { I18n } from '@lingui/react'; import { type I18n as I18nType } from '@lingui/core'; -import { Trans } from '@lingui/macro'; import { type RenderEditorContainerPropsWithRef } from '../BaseEditor'; import { type FileMetadataAndStorageProviderName, @@ -38,12 +37,6 @@ import { } from '../../../Utils/Analytics/EventSender'; import RouterContext, { type RouteArguments } from '../../RouterContext'; import { type GameDetailsTab } from '../../../GameDashboard'; -import useDisplayNewFeature from '../../../Utils/UseDisplayNewFeature'; -import HighlightingTooltip from '../../../UI/HighlightingTooltip'; -import Text from '../../../UI/Text'; -import Link from '../../../UI/Link'; -import Window from '../../../Utils/Window'; -import { getHelpLink } from '../../../Utils/HelpLink'; import { canUseClassroomFeature } from '../../../Utils/GDevelopServices/Usage'; import EducationMarketingSection from './EducationMarketingSection'; import useEducationForm from './UseEducationForm'; @@ -51,7 +44,6 @@ import { type NewProjectSetup } from '../../../ProjectCreation/NewProjectSetupDi import { type ObjectWithContext } from '../../../ObjectsList/EnumerateObjects'; import { type GamesList } from '../../../GameDashboard/UseGamesList'; -const gamesDashboardWikiArticle = getHelpLink('/interface/games-dashboard/'); const getRequestedTab = (routeArguments: RouteArguments): HomeTab | null => { if ( routeArguments['initial-dialog'] === 'asset-store' || // Compatibility with old links @@ -258,10 +250,6 @@ export const HomePage = React.memo( const { setInitialPackUserFriendlySlug } = React.useContext( AssetStoreContext ); - const [ - displayTooltipDelayed, - setDisplayTooltipDelayed, - ] = React.useState(false); const openedGame = React.useMemo( () => !openedGameId || !games @@ -269,29 +257,10 @@ export const HomePage = React.memo( : games.find(game => game.id === openedGameId), [games, openedGameId] ); - const { - shouldDisplayNewFeatureHighlighting, - acknowledgeNewFeature, - } = useDisplayNewFeature(); - const manageTabElement = document.getElementById('home-manage-tab'); - const shouldDisplayTooltip = shouldDisplayNewFeatureHighlighting({ - featureId: 'gamesDashboardInHomePage', - }); const { subscriptionPlansWithPricingSystems } = useSubscriptionPlans({ includeLegacy: false, }); - const displayTooltip = - isActive && shouldDisplayTooltip && manageTabElement; - - const onCloseTooltip = React.useCallback( - () => { - setDisplayTooltipDelayed(false); - acknowledgeNewFeature({ featureId: 'gamesDashboardInHomePage' }); - }, - [acknowledgeNewFeature] - ); - // Open the store and a pack or game template if asked to do so, either at // app opening, either when the route changes (when clicking on an announcement // that redirects to the asset store for instance). @@ -371,23 +340,6 @@ export const HomePage = React.memo( [fetchGames, activeTab, games] ); - React.useEffect( - () => { - if (displayTooltip) { - const timeoutId = setTimeout(() => { - setDisplayTooltipDelayed(true); - }, 500); - return () => clearTimeout(timeoutId); - } else { - setDisplayTooltipDelayed(false); - } - }, - // Delay display of tooltip because home tab is the first to be opened - // but the editor might open a project at start, displaying the tooltip - // while the project is loading, giving the impression of a glitch. - [displayTooltip] - ); - // Fetch user cloud projects when home page becomes active React.useEffect( () => { @@ -609,36 +561,6 @@ export const HomePage = React.memo( onOpenAbout={onOpenAbout} /> - {displayTooltipDelayed && ( - Games Dashboard} - thumbnailSource="res/features/games-dashboard.svg" - thumbnailAlt={'Red hero presenting games analytics'} - content={[ - - - Follow your games’ online performance, manage published - versions, and collect player feedback. - - , - - - Window.openExternalURL(gamesDashboardWikiArticle) - } - > - Learn more - - , - ]} - placement={isMobile ? 'bottom' : 'right'} - onClose={onCloseTooltip} - closeWithBackdropClick={false} - /> - )} )} diff --git a/newIDE/app/src/Utils/UseDisplayNewFeature.js b/newIDE/app/src/Utils/UseDisplayNewFeature.js index ba959b798278..8e807f68ac1e 100644 --- a/newIDE/app/src/Utils/UseDisplayNewFeature.js +++ b/newIDE/app/src/Utils/UseDisplayNewFeature.js @@ -4,19 +4,16 @@ import * as React from 'react'; import PreferencesContext from '../MainFrame/Preferences/PreferencesContext'; import { getProgramOpeningCount } from './Analytics/LocalStats'; -const featuresDisplaySettings = { - gamesDashboardInProjectManager: { - count: 2, - intervalInDays: 7, - minimumProgramOpeningCount: 10, - }, - gamesDashboardInHomePage: { - count: 2, - intervalInDays: 7, - minimumProgramOpeningCount: 10, - }, +type FeatureDisplaySettings = { + [key: string]: {| + count: number, + intervalInDays: number, + minimumProgramOpeningCount: number, + |}, }; +const featuresDisplaySettings: FeatureDisplaySettings = {}; + const ONE_DAY = 24 * 3600 * 1000; type Feature = string;