Skip to content

Conversation

@pixelsama
Copy link
Contributor

Important

  1. Read CONTRIBUTING.md
  2. Ensure issue exists and you're assigned
  3. Link correctly: Fixes #<issue number>

What & Why

What: Add "Upload Image" button to image component src field in content editor
Why: Provides convenient UI for uploading local images directly from the editor, completing the image upload feature implementation

Closes #250

Pre-PR Checklist

Run these:

  • pnpm type-check
  • pnpm format:check
  • pnpm lint
  • pnpm build
  • pnpm i18n:check (if applicable)

Type

  • 🐛 Bug fix
  • ✨ Feature
  • 💥 Breaking change
  • 📚 Docs
  • ♻️ Refactor
  • ⚡ Performance

Screenshots (if UI changes)

N/A - Will be visible when testing the content editor with image components

- Add 'Upload' button to image component src field
- Open ImageUploadDialog when clicked
- Auto-fill uploaded image URL to src field
- Keep existing URL input functionality intact
- Fetch userId from Supabase auth on component mount

Closes ifLabX#250
@vercel
Copy link

vercel bot commented Oct 4, 2025

@pixelsama is attempting to deploy a commit to the zhang's projects Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 4, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @pixelsama, 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 enhances the content editor by introducing a streamlined process for adding images. It provides a convenient user interface that allows content creators to upload local images directly from the editor, eliminating the need for manual URL management and completing the image upload feature implementation.

Highlights

  • Image Upload Integration: Integrated direct image upload functionality into the content editor, specifically for the 'src' field of image components.
  • Enhanced User Interface: Added an 'Upload' button next to the image source input field, which triggers a dedicated image upload dialog for local files.
  • Supabase User Authentication: Implemented Supabase client integration to fetch the current user's ID, likely for associating uploaded images or managing access control.
  • Automatic URL Population: Configured the system to automatically populate the image component's 'src' field with the URL of a successfully uploaded image.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot bot added area:ui UI components, layouts, styling, accessibility. type:feature Request for a brand-new capability. labels Oct 4, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 successfully integrates an image upload dialog into the content editor's context menu, providing a much-needed UI for uploading images directly. The implementation is solid. My feedback includes a few suggestions to improve robustness and code clarity, such as handling asynchronous state updates more safely, improving the user experience by disabling the upload button when not ready, and removing a redundant state update call.

- Add isMounted flag to prevent memory leaks in async useEffect
- Disable Upload button when userId is not yet loaded
- Remove redundant dialog close call in onUploadSuccess handler
@dosubot dosubot bot added the lgtm Looks good to me; approved by a reviewer. label Oct 4, 2025
@lyzno1 lyzno1 merged commit cb4b994 into ifLabX:main Oct 4, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui UI components, layouts, styling, accessibility. lgtm Looks good to me; approved by a reviewer. size:M This PR changes 30-99 lines, ignoring generated files. type:feature Request for a brand-new capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Admin content editor images component should support local image upload

2 participants