Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

feat(launchpad): arrow cursors, inset resume cover, and the full actions menu on the resume card

Josh Corbette6e3defaf58f
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/home/IntentTiles.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/home/IntentTiles.tsx
index c95c2623e2..1afde3f405 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/home/IntentTiles.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/home/IntentTiles.tsx
@@ -17,6 +17,9 @@ import { useTranslation } from 'react-i18next';
*/
const TILE_COLUMNS = { base: 1, lg: 5, sm: 2 } as const;
+// Pro-app convention (see the theme's cursor tokens): tiles act like
+// controls, so they keep the arrow instead of the anchor's pointer.
+const TILE_LINK_STYLE = { cursor: 'default' } as const;
const TILE_HOVER = { bg: 'bg.muted', borderColor: 'border.emphasized' } as const;
const TILE_TRANSITION =
'border-color var(--wb-motion-duration-medium) ease, background var(--wb-motion-duration-medium) ease';
@@ -52,7 +55,7 @@ const IntentTile = ({ id }: { id: LaunchpadIntentId }) => {
const search = useMemo(() => ({ intent: id, new: true }) as const, [id]);
return (
- <Link search={search} to="/app">
+ <Link search={search} style={TILE_LINK_STYLE} to="/app">
<Stack
bg="bg.subtle"
borderColor="border.subtle"
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/home/RecentProjectsRow.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/home/RecentProjectsRow.tsx
index 2ef85443f7..ce93d08cf5 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/home/RecentProjectsRow.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/home/RecentProjectsRow.tsx
@@ -36,7 +36,7 @@ export const RecentProjectsRow = ({
<Text fontSize="xs" fontWeight="700">
{t('launchpad.home.recentProjects')}
</Text>
- <Button asChild size="2xs" variant="ghost">
+ <Button asChild size="xs" variant="ghost">
<Link to="/projects">
{t('launchpad.home.viewAllProjects')}
<ArrowRightIcon />
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/home/ResumeCard.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/home/ResumeCard.tsx
index 4060b9bd4f..a22ed1df91 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/home/ResumeCard.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/home/ResumeCard.tsx
@@ -1,15 +1,18 @@
import type { ProjectSummary } from '@workbench/projects/library';
+import type { MouseEvent } from 'react';
-import { Box, Flex, Stack, Text } from '@chakra-ui/react';
-import { Button } from '@platform/ui/Button';
+import { Box, Flex, HStack, Menu, Stack, Text } from '@chakra-ui/react';
+import { Button, IconButton } from '@platform/ui/Button';
import { MiddleTruncate } from '@platform/ui/MiddleTruncate';
import { Link } from '@tanstack/react-router';
import { formatRelativeTime } from '@workbench/launchpad/formatRelativeTime';
+import { ProjectActionsMenu } from '@workbench/launchpad/projects/ProjectActionsMenu';
import { ProjectCompatibilityBadge } from '@workbench/launchpad/projects/ProjectCompatibilityBadge';
import { ProjectCover } from '@workbench/launchpad/projects/ProjectCover';
+import { useProjectCardActions } from '@workbench/launchpad/projects/useProjectCardActions';
import { isProjectSummaryCompatible } from '@workbench/projects/library';
-import { ArrowRightIcon } from 'lucide-react';
-import { useMemo } from 'react';
+import { ArrowRightIcon, EllipsisVerticalIcon } from 'lucide-react';
+import { useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
/**
@@ -17,20 +20,47 @@ import { useTranslation } from 'react-i18next';
*
* Returning users almost always want the thing they were last working on, and
* making them find it in a grid of equals is the small tax the old home screen
- * charged on every visit.
+ * charged on every visit. It is still a library project, so it carries the
+ * same actions menu as the grid cards — on right-click and on the corner dots.
*/
const CARD_HOVER = { bg: 'bg.muted', borderColor: 'border.emphasized' } as const;
-const LINK_STYLE = { inset: 0, position: 'absolute' } as const;
+const LINK_STYLE = { cursor: 'default', inset: 0, position: 'absolute' } as const;
const CARD_TRANSITION =
'border-color var(--wb-motion-duration-medium) ease, background var(--wb-motion-duration-medium) ease';
const COVER_WIDTH = { base: '32', sm: '40' } as const;
-export const ResumeCard = ({ summary }: { summary: ProjectSummary }) => {
+export const ResumeCard = ({
+ isPinned,
+ summary,
+ onTogglePin,
+}: {
+ isPinned: boolean;
+ summary: ProjectSummary;
+ onTogglePin: (projectId: string) => void;
+}) => {
const { t } = useTranslation();
+ const actions = useProjectCardActions(summary);
+ const [isActionsOpen, setIsActionsOpen] = useState(false);
+ const [contextMenuTarget, setContextMenuTarget] = useState<{ x: number; y: number } | null>(null);
const search = useMemo(() => ({ project: summary.id }), [summary.id]);
const isCompatible = isProjectSummaryCompatible(summary);
+ const handleContextMenu = useCallback((event: MouseEvent<HTMLDivElement>) => {
+ event.preventDefault();
+ setContextMenuTarget({ x: event.clientX, y: event.clientY });
+ setIsActionsOpen(true);
+ }, []);
+ const handleOpenChange = useCallback((event: { open: boolean }) => {
+ setIsActionsOpen(event.open);
+
+ if (!event.open) {
+ setContextMenuTarget(null);
+ }
+ }, []);
+ const clearContextMenuTarget = useCallback(() => setContextMenuTarget(null), []);
+ const handleTogglePin = useCallback(() => onTogglePin(summary.id), [onTogglePin, summary.id]);
+
return (
<Flex
align="stretch"
@@ -42,6 +72,7 @@ export const ResumeCard = ({ summary }: { summary: ProjectSummary }) => {
rounded="lg"
transition={CARD_TRANSITION}
_hover={CARD_HOVER}
+ onContextMenu={handleContextMenu}
>
{isCompatible ? (
<Link
@@ -60,9 +91,11 @@ export const ResumeCard = ({ summary }: { summary: ProjectSummary }) => {
title={t('projects.file.updateClient')}
/>
)}
- <Box flexShrink={0} pointerEvents="none" w={COVER_WIDTH}>
- <ProjectCover coverUrl={summary.coverUrl} />
- </Box>
+ <Flex align="center" flexShrink={0} p="1.5" pointerEvents="none" w={COVER_WIDTH}>
+ <Box overflow="hidden" rounded="md" w="full">
+ <ProjectCover coverUrl={summary.coverUrl} />
+ </Box>
+ </Flex>
<Flex align="center" flex="1" gap="3" justify="space-between" minW="0" p="4" pointerEvents="none" wrap="wrap">
<Stack gap="0.5" minW="0">
<Text color="fg.muted" fontSize="2xs" fontWeight="600" textTransform="uppercase">
@@ -74,7 +107,7 @@ export const ResumeCard = ({ summary }: { summary: ProjectSummary }) => {
</Text>
<ProjectCompatibilityBadge summary={summary} />
</Stack>
- <Box pointerEvents="auto">
+ <HStack gap="1.5" pointerEvents="auto">
{isCompatible ? (
<Button asChild size="xs" variant="solid">
<Link search={search} to="/app">
@@ -88,7 +121,30 @@ export const ResumeCard = ({ summary }: { summary: ProjectSummary }) => {
<ArrowRightIcon />
</Button>
)}
- </Box>
+ <ProjectActionsMenu
+ actions={actions}
+ contextMenuTarget={contextMenuTarget}
+ isOpen={isActionsOpen}
+ isCompatible={isCompatible}
+ isPinned={isPinned}
+ projectId={summary.id}
+ projectName={summary.name}
+ onOpenChange={handleOpenChange}
+ onTogglePin={handleTogglePin}
+ >
+ <Menu.Trigger asChild>
+ <IconButton
+ aria-label={t('common.actions')}
+ color="fg.muted"
+ size="xs"
+ variant="ghost"
+ onClick={clearContextMenuTarget}
+ >
+ <EllipsisVerticalIcon />
+ </IconButton>
+ </Menu.Trigger>
+ </ProjectActionsMenu>
+ </HStack>
</Flex>
</Flex>
);
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/pages/HomePage.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/pages/HomePage.tsx
index 9d6998e36c..737962ab25 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/pages/HomePage.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/pages/HomePage.tsx
@@ -102,7 +102,15 @@ export const HomePage = () => {
{canManageModels ? <LivePanel panel="models" /> : null}
<LivePanel panel="queue" />
- {isFirstLoad ? <Skeleton minH="24" rounded="lg" /> : mostRecent ? <ResumeCard summary={mostRecent} /> : null}
+ {isFirstLoad ? (
+ <Skeleton minH="24" rounded="lg" />
+ ) : mostRecent ? (
+ <ResumeCard
+ isPinned={pinnedIds.includes(mostRecent.id)}
+ summary={mostRecent}
+ onTogglePin={toggleProjectPinPreference}
+ />
+ ) : null}
<Stack gap="3">
<Text fontSize="xs" fontWeight="700">
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectCard.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectCard.tsx
index 6c0c40753e..812d6d4f77 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectCard.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectCard.tsx
@@ -24,7 +24,7 @@ import { useProjectCardActions } from './useProjectCardActions';
const CARD_HOVER = { bg: 'bg.muted', borderColor: 'border.emphasized' } as const;
const REVEAL_ON_HOVER = { opacity: 1 } as const;
-const LINK_STYLE = { inset: 0, position: 'absolute' } as const;
+const LINK_STYLE = { cursor: 'default', inset: 0, position: 'absolute' } as const;
const CARD_TRANSITION =
'border-color var(--wb-motion-duration-medium) ease, background var(--wb-motion-duration-medium) ease';
diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectRow.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectRow.tsx
index 5361b066e1..5e2c09918c 100644
--- a/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectRow.tsx
+++ b/invokeai/frontend/webv2/src/workbench/launchpad/projects/ProjectRow.tsx
@@ -23,7 +23,7 @@ import { useProjectCardActions } from './useProjectCardActions';
* only the shape differs.
*/
-const LINK_STYLE = { inset: 0, position: 'absolute' } as const;
+const LINK_STYLE = { cursor: 'default', inset: 0, position: 'absolute' } as const;
const REVEAL_ON_HOVER = { opacity: 1 } as const;
const THUMBNAIL_WIDTH = '14';