Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add game dashboard on home page and project manager #5963

Merged
merged 38 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
990f35b
Transfer responsibility to fetch games to the parent of GamesList
AlexandreSi Nov 23, 2023
78db44c
Add search bar on Games list
AlexandreSi Nov 23, 2023
9b40b99
Add GamesList to Manage section
AlexandreSi Nov 24, 2023
c6279ff
Add item menu in home page header
AlexandreSi Nov 24, 2023
13dd155
Add login/signup component on Manage section if user not logged in
AlexandreSi Nov 24, 2023
7f1e07e
Add message when no games
AlexandreSi Nov 24, 2023
04e0df3
Update games to display on games changes
AlexandreSi Nov 24, 2023
73db052
Add placeholder in search bar
AlexandreSi Nov 24, 2023
b8e9ed4
Display back action when no title
AlexandreSi Nov 24, 2023
966e12b
Add game details to homepage without using a dialog
AlexandreSi Nov 24, 2023
2b6a51e
Remove shortcuts reminder component
AlexandreSi Nov 24, 2023
8bdd9e9
Add info on Games dashboard in the profile dialog
AlexandreSi Nov 24, 2023
4306579
Use new icons and divide settings into project and game ones
AlexandreSi Nov 24, 2023
1f610cf
Add GamesDashboardInfo component
AlexandreSi Nov 24, 2023
00c80f9
Send analytics to know how users display the game details
AlexandreSi Nov 24, 2023
aceff8a
Adapt games dashboard project manager list item if user has games
AlexandreSi Nov 27, 2023
ad33fc9
Refactor ProjectManager into functional component
AlexandreSi Nov 27, 2023
2d78934
Move games fetching logic to project manager
AlexandreSi Nov 27, 2023
fb32f47
Open game details when clicking on Games dashboard from project manager
AlexandreSi Nov 27, 2023
d298a96
Prettier
AlexandreSi Nov 27, 2023
28ceb2b
Improve game details buttons layout on mobile
AlexandreSi Nov 27, 2023
46d0428
Fix overflowing game details
AlexandreSi Nov 27, 2023
814dd47
Remove useless fragments
AlexandreSi Nov 27, 2023
48d6f0e
Create Highlighting Tooltip component
AlexandreSi Nov 28, 2023
dcbe211
Do not display tooltip if in app tutorial is running
AlexandreSi Nov 28, 2023
e5b4933
Add hook to handle new features display logic
AlexandreSi Nov 28, 2023
5437f82
Display Games Dashboard tooltip on project manager opening
AlexandreSi Nov 28, 2023
bdf9038
Add missing ids
AlexandreSi Nov 28, 2023
f2cdb28
Display Games Dashboard tooltip on home page menu
AlexandreSi Nov 28, 2023
d58e2ef
Fix tooltip content and links
AlexandreSi Nov 28, 2023
18d5d4d
Review changes
AlexandreSi Nov 28, 2023
0b64e9b
Fix on game updated logic
AlexandreSi Nov 28, 2023
c1457e1
Use show alert
AlexandreSi Nov 28, 2023
dfd00e8
Use fuse js to search in user games
AlexandreSi Nov 28, 2023
856652c
Prettier
AlexandreSi Nov 28, 2023
793f232
Review changes
AlexandreSi Nov 28, 2023
0283868
Display manage tab when url requests for games dashboard view
AlexandreSi Nov 29, 2023
db88fc3
Simplify games updating logic
AlexandreSi Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions newIDE/app/src/MainFrame/EditorContainers/HomePage/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow
import * as React from 'react';
import { I18n } from '@lingui/react';
import { Trans } from '@lingui/macro';
import { type RenderEditorContainerPropsWithRef } from '../BaseEditor';
import {
type FileMetadataAndStorageProviderName,
Expand Down Expand Up @@ -40,6 +41,11 @@ import { type RouteArguments } from '../../RouterContext';
import { type GameDetailsTab } from '../../../GameDashboard/GameDetails';
import { type Game } from '../../../Utils/GDevelopServices/Game';
import useGamesList from '../../../GameDashboard/UseGamesList';
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';

const isShopRequested = (routeArguments: RouteArguments): boolean =>
routeArguments['initial-dialog'] === 'asset-store' || // Compatibility with old links
Expand Down Expand Up @@ -196,12 +202,35 @@ export const HomePage = React.memo<Props>(
const isShopRequestedAtOpening = React.useRef<boolean>(
isShopRequested(routeArguments)
);
const [
displayTooltipDelayed,
setDisplayTooltipDelayed,
] = React.useState<boolean>(false);
const {
games,
gamesFetchingError,
onGameUpdated,
fetchGames,
} = useGamesList();
const {
shouldDisplayNewFeatureHighlighting,
acknowledgeNewFeature,
} = useDisplayNewFeature();
const manageTabElement = document.getElementById('home-manage-tab');
const shouldDisplayTooltip = shouldDisplayNewFeatureHighlighting({
featureId: 'gamesDashboardInHomePage',
ClementPasteau marked this conversation as resolved.
Show resolved Hide resolved
});

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.
React.useEffect(
Expand Down Expand Up @@ -290,6 +319,23 @@ 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 @@ -483,6 +529,34 @@ 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>}
ClementPasteau marked this conversation as resolved.
Show resolved Hide resolved
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="https://gdevelop.io"
ClementPasteau marked this conversation as resolved.
Show resolved Hide resolved
onClick={() =>
Window.openExternalURL('https://gdevelop.io')
}
>
<Trans>Learn more</Trans>
</Link>
</Text>,
]}
placement={isMobile ? 'bottom' : 'right'}
onClose={onCloseTooltip}
closeWithBackdropClick={false}
/>
)}
</TeamProvider>
)}
</I18n>
Expand Down