-
Notifications
You must be signed in to change notification settings - Fork 75
Initial commit with basic features. #13
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @saravatpt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the application's image manipulation capabilities by integrating comprehensive photo editing and image composition features. It introduces intuitive control panels for users to fine-tune their images and manage their creative output through an organized history system. The addition of a full-screen image preview modal also improves the overall user experience when interacting with visual content. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces several new features, including image history with folder organization, an image preview modal, and dedicated controls for photo editing and image composition. The code is well-structured, particularly with the addition of new components and the use of a React context for the image preview. I've identified a few areas for improvement, mainly in app/page.tsx:
- Replacing the
window.prompt()for a better user experience. - Using a more robust method for generating unique IDs.
- Refactoring duplicated code into a helper function.
- Moving type definitions out of the component body.
These changes will enhance the code's maintainability, robustness, and user experience. Overall, this is a great addition of features.
app/page.tsx
Outdated
| onContextMenu={(e) => { | ||
| e.preventDefault(); | ||
| // Show folder assignment menu | ||
| const targetFolder = prompt('Move to folder (enter folder name):'); | ||
| if (targetFolder) { | ||
| const folder = folders.find(f => f.name.toLowerCase() === targetFolder.toLowerCase()); | ||
| if (folder) { | ||
| setHistory(prev => prev.map(h => | ||
| h.id === item.id ? { ...h, folderId: folder.id === 'default' ? null : folder.id } : h | ||
| )); | ||
| } | ||
| } | ||
| }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of window.prompt() for assigning an image to a folder is not recommended. It provides a poor user experience, is a blocking synchronous call, and can be disabled by users or blocked by browsers. A better approach would be to implement a custom context menu that appears at the cursor's position, listing the available folders for the user to choose from. This would provide a much smoother and more reliable user interaction.
app/page.tsx
Outdated
| type HistoryItem = { | ||
| id: string; | ||
| imageUrl: string; | ||
| timestamp: number; | ||
| folderId: string | null; | ||
| }; | ||
|
|
||
| type Folder = { | ||
| id: string; | ||
| name: string; | ||
| color: string; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HistoryItem and Folder types are defined inside the VeoStudioContent component. This causes them to be re-declared on every render, which is inefficient. It's best practice to define types at the module's top level, outside of the component body (for example, after the StudioMode type definition).
| setHistory((prev) => [{ | ||
| id: Date.now().toString(), | ||
| imageUrl: dataUrl, | ||
| timestamp: Date.now(), | ||
| folderId: selectedFolder === 'default' ? null : selectedFolder | ||
| }, ...prev]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for adding a new item to the history is duplicated across four different functions (generateWithImagen, generateWithGemini, editWithGemini, composeWithGemini). This violates the DRY (Don't Repeat Yourself) principle and makes the code harder to maintain.
Consider extracting this logic into a useCallback'd helper function like this:
const addImageToHistory = useCallback((imageUrl: string) => {
setHistory((prev) => [{
id: crypto.randomUUID(), // More robust than Date.now()
imageUrl,
timestamp: Date.now(),
folderId: selectedFolder === 'default' ? null : selectedFolder,
}, ...prev]);
}, [selectedFolder]);You can then replace the duplicated blocks in all four generation functions with a simple call: addImageToHistory(dataUrl);
app/page.tsx
Outdated
| setFolders(prev => [...prev, { | ||
| id: Date.now().toString(), | ||
| name: newFolderName, | ||
| color: 'blue' | ||
| }]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Date.now().toString() to generate unique IDs for folders (and for history items elsewhere) is not robust. It's possible for this to generate duplicate IDs if actions occur in the same millisecond, which can lead to bugs in React. Please use a more reliable method for generating unique IDs, such as crypto.randomUUID().
| setFolders(prev => [...prev, { | |
| id: Date.now().toString(), | |
| name: newFolderName, | |
| color: 'blue' | |
| }]); | |
| setFolders(prev => [...prev, { | |
| id: crypto.randomUUID(), | |
| name: newFolderName, | |
| color: 'blue' | |
| }]); |
…into dev-nov-2025
added voice input, grouping in compose image, face cleanp, alias prompt.
…oject structure for a professional AI creative studio.
…ov-2025 Feature adding payment system nov 2025
…into feature-ui-optimization-nov-2025
…u, modals, and dedicated pages.
Feature UI optimization nov 2025
…ptimization-nov-2025 fixed build errors
No description provided.