Skip to content

Commit

Permalink
Remove games dashboard new feature highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementPasteau committed Nov 20, 2024
1 parent e6343df commit edaf2f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 89 deletions.
78 changes: 0 additions & 78 deletions newIDE/app/src/MainFrame/EditorContainers/HomePage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -38,20 +37,13 @@ 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';
import { type NewProjectSetup } from '../../../ProjectCreation/NewProjectSetupDialog';
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
Expand Down Expand Up @@ -258,40 +250,17 @@ export const HomePage = React.memo<Props>(
const { setInitialPackUserFriendlySlug } = React.useContext(
AssetStoreContext
);
const [
displayTooltipDelayed,
setDisplayTooltipDelayed,
] = React.useState<boolean>(false);
const openedGame = React.useMemo(
() =>
!openedGameId || !games
? null
: 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).
Expand Down Expand Up @@ -371,23 +340,6 @@ export const HomePage = React.memo<Props>(
[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(
() => {
Expand Down Expand Up @@ -609,36 +561,6 @@ export const HomePage = React.memo<Props>(
onOpenAbout={onOpenAbout}
/>
</div>
{displayTooltipDelayed && (
<HighlightingTooltip
// $FlowIgnore - displayTooltipDelayed makes sure the element is defined
anchorElement={manageTabElement}
title={<Trans>Games Dashboard</Trans>}
thumbnailSource="res/features/games-dashboard.svg"
thumbnailAlt={'Red hero presenting games analytics'}
content={[
<Text noMargin key="paragraph">
<Trans>
Follow your games’ online performance, manage published
versions, and collect player feedback.
</Trans>
</Text>,
<Text noMargin key="link">
<Link
href={gamesDashboardWikiArticle}
onClick={() =>
Window.openExternalURL(gamesDashboardWikiArticle)
}
>
<Trans>Learn more</Trans>
</Link>
</Text>,
]}
placement={isMobile ? 'bottom' : 'right'}
onClose={onCloseTooltip}
closeWithBackdropClick={false}
/>
)}
</TeamProvider>
)}
</I18n>
Expand Down
19 changes: 8 additions & 11 deletions newIDE/app/src/Utils/UseDisplayNewFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit edaf2f5

Please sign in to comment.