From 72b68f7bf76f99afee8b8e6c3f7cf82631601171 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 6 Nov 2025 01:22:30 +0000 Subject: [PATCH 1/2] Add dropdown menu to recent projects cards - Added dropdown menu with rename, clone, convert to template, and delete options to SquareProjectCardPresentation component - Updated SelectProjectPresentation to pass dropdown callbacks to recent projects cards - Matches functionality from ProjectCardPresentation in the Projects section Co-Authored-By: Satya Patel --- .../_components/select-presentation.tsx | 31 ++-- .../square-project-card-presentation.tsx | 150 ++++++++++++++++-- 2 files changed, 154 insertions(+), 27 deletions(-) diff --git a/apps/web/client/src/app/projects/_components/select-presentation.tsx b/apps/web/client/src/app/projects/_components/select-presentation.tsx index c202357ab3..c330a2b5ed 100644 --- a/apps/web/client/src/app/projects/_components/select-presentation.tsx +++ b/apps/web/client/src/app/projects/_components/select-presentation.tsx @@ -1,19 +1,19 @@ 'use client'; import { useEffect, useMemo, useRef, useState } from 'react'; -import { Carousel } from './carousel'; import { AnimatePresence, motion } from 'motion/react'; import type { Project } from '@onlook/models'; import { Button } from '@onlook/ui/button'; import { Icons } from '@onlook/ui/icons'; -import { Templates } from './templates'; -import { TemplateModalPresentation } from './templates/template-modal-presentation'; +import { Carousel } from './carousel'; import { HighlightText } from './select/highlight-text'; import { MasonryLayout } from './select/masonry-layout'; import { ProjectCardPresentation } from './select/project-card-presentation'; import { SquareProjectCardPresentation } from './select/square-project-card-presentation'; +import { Templates } from './templates'; +import { TemplateModalPresentation } from './templates/template-modal-presentation'; interface SelectProjectPresentationProps { /** All projects including templates */ @@ -230,11 +230,7 @@ export const SelectProjectPresentation = ({ Create a new project to get started
- + + e.stopPropagation()} + > + {onRename && ( + { + event.preventDefault(); + onRename(project); + }} + className="text-foreground-active hover:!bg-background-onlook hover:!text-foreground-active gap-2" + > + + Rename Project + + )} + {onClone && ( + { + event.preventDefault(); + onClone(project); + }} + className="text-foreground-active hover:!bg-background-onlook hover:!text-foreground-active gap-2" + > + + Clone Project + + )} + {onToggleTemplate && ( + { + event.preventDefault(); + onToggleTemplate(project); + }} + className="text-foreground-active hover:!bg-background-onlook hover:!text-foreground-active gap-2" + > + {isTemplate ? ( + <> + + Unmark as template + + ) : ( + <> + + Convert to template + + )} + + )} + {onDelete && ( + { + event.preventDefault(); + onDelete(project); + }} + className="gap-2 text-red-400 hover:!bg-red-200/80 hover:!text-red-700 dark:text-red-200 dark:hover:!bg-red-800 dark:hover:!text-red-100" + > + + Delete Project + + )} + + +
{onClick && ( -
+
)} -
-
+
+
{HighlightText ? ( ) : ( project.name )}
-
+
{lastUpdated} ago
From 8d004cfd44dc42685ab3f0e96cd7b73f0fbf245f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 6 Nov 2025 01:27:31 +0000 Subject: [PATCH 2/2] Fix Chromatic build by replacing crypto.randomUUID with uuid package - Replaced crypto.randomUUID() with uuidv4() from uuid package - Fixes Chromatic CI failure due to crypto not being available in Node environment Co-Authored-By: Satya Patel --- apps/web/client/src/stories/ProjectsPage.stories.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/client/src/stories/ProjectsPage.stories.tsx b/apps/web/client/src/stories/ProjectsPage.stories.tsx index 016d4f95f1..1f78c62484 100644 --- a/apps/web/client/src/stories/ProjectsPage.stories.tsx +++ b/apps/web/client/src/stories/ProjectsPage.stories.tsx @@ -4,6 +4,7 @@ import { SelectProjectPresentation } from '@/app/projects/_components/select-pre import type { Project, User } from '@onlook/models'; import { fn } from '@storybook/test'; import { useState } from 'react'; +import { v4 as uuidv4 } from 'uuid'; /** * ProjectsPageComposed - Full projects page combining TopBar and SelectProject. @@ -80,7 +81,7 @@ type Story = StoryObj; // Helper to create mock projects const createMockProject = (overrides?: Partial): Project => ({ - id: crypto.randomUUID(), + id: uuidv4(), name: 'Project Name', metadata: { createdAt: new Date('2024-01-01'),