Skip to content

[FirebaseAI] Move ProgressOverlay to GenerativeAIUIComponents #1736

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

YoungHypo
Copy link
Contributor

@YoungHypo YoungHypo commented Jul 29, 2025

Although ProgressOverlay is currently only used in ImageScreen, placed it in GenerativeAIUIComponents to support unified progress indication for future development of image, video, and audio generation features.

Related PR. #1719

Copy link

@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.

Summary of Changes

Hello @YoungHypo, 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 focuses on improving the modularity and reusability of UI components within the FirebaseAI project. I've extracted a common loading overlay component into a shared UI module, which will streamline future development by providing a unified progress indication mechanism.

Highlights

  • Component Relocation: I've moved the ProgressOverlay SwiftUI view from firebaseai/ImagenScreen/ImagenScreen.swift to a new, dedicated file within the GenerativeAIUIComponents module: firebaseai/GenerativeAIUIComponents/Sources/GenerativeAIUIComponents/ProgressOverlay.swift.
  • Enhanced Reusability: This relocation centralizes the ProgressOverlay component, making it available for reuse across future generative AI features (e.g., image, video, audio generation) and ensuring a consistent loading UI experience.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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.

Copy link

@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

The code changes introduce a new ProgressOverlay view to the GenerativeAIUIComponents library and removes it from ImagenScreen. The review suggests making the text customizable and extracting styling values into constants for better reusability and maintainability.

Comment on lines +22 to +29
Color.black.opacity(0.3)
.ignoresSafeArea()

ZStack {
RoundedRectangle(cornerRadius: 16)
.fill(Material.ultraThinMaterial)
.frame(width: 120, height: 100)
.shadow(radius: 8)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The view uses several hardcoded numbers for styling (e.g., 0.3, 16, 120, 100, 8). Extracting these into private static constants will improve readability and make future UI tweaks easier.

private enum Style {
    static let backgroundOpacity: CGFloat = 0.3
    static let cornerRadius: CGFloat = 16
    static let frameWidth: CGFloat = 120
    static let frameHeight: CGFloat = 100
    static let shadowRadius: CGFloat = 8
    static let stackSpacing: CGFloat = 12
    static let progressScale: CGFloat = 1.5
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to extract these styling values into constants, or is it fine to keep them for now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant