Skip to content

[FirebaseAI] sync with quickstart-android #1741

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

Conversation

YoungHypo
Copy link
Contributor

@YoungHypo YoungHypo commented Jul 31, 2025

PR description

This PR refactors the UI of quickstart-ios to align with quickstart-android.

The interface now adopts a modular design, divided into three functional areas:

  • Backend configuration area
  • Use case filter
  • Sample display area

And a new Sample.swift encapsulates predefined examples, including Gemini-related parameters, preset conversation history, and system prompts.

Use cases

Text

  • Travel tips
  • Chatbot recommendations for courses
  • Grounding with Google Search

Image

  • Imagen 3 - image generation
  • Blog post creator
  • Gemini 2.0 Flash - image generation

Video

  • Hashtags for a video
  • Summarize video

Audio

  • Audio Summarization
  • Translation from audio

Document

  • Document comparison

Function Calling

  • Weather Chat

Demo

simulator_screenshot_1B964772-979A-4F9D-B14F-EF21E061D526 simulator_screenshot_4259C4EE-326D-47E0-B2E9-D30F9A7837FE simulator_screenshot_CD22E9AD-C889-4647-9816-E6F01B6271F9 simulator_screenshot_6474EFF4-29DA-4C25-BECC-3F8DE2F8C64E

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 delivers a significant overhaul of the iOS quickstart application's user interface, bringing it into alignment with its Android counterpart. The changes introduce a more structured and modular design, powered by a new Sample data model that centralizes the configuration and presentation of various generative AI examples. This refactoring enhances the discoverability and organization of the different AI capabilities within the app.

Highlights

  • UI Refactoring and Alignment: The primary user interface of the quickstart-ios application has been completely refactored to align with the quickstart-android design. This introduces a modular layout with distinct sections for backend configuration, use case filtering, and sample display.
  • New Sample Data Model: A new Sample.swift file has been introduced within GenerativeAIUIComponents to encapsulate predefined examples. Each Sample includes details such as title, description, associated use cases, optional preset conversation history, initial prompts, system instructions, and tools, making it easier to manage and display various AI capabilities.
  • Sample-Driven Screens: The ConversationScreen and ImagenScreen have been updated to be driven by the new Sample data model. Their respective ViewModels (ConversationViewModel and ImagenViewModel) now accept a sampleId to dynamically configure the generative model with specific tools, system instructions, and initial chat history or prompts based on the selected sample.
  • New UI Components: Two new SwiftUI views, FilterChipView and SampleCardView, have been added to support the new modular UI. FilterChipView allows users to filter samples by UseCase, while SampleCardView provides a structured display for each AI sample.
  • FirebaseAI Integration in UI Components: The GenerativeAIUIComponents Swift package now explicitly depends on FirebaseAI, ensuring that the new UI components can directly leverage Firebase AI functionalities and models.
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 pull request refactors the app's UI and structure to be data-driven by the new Sample model, aligning the iOS quickstart with the Android version. I've identified a critical issue with navigation logic and some medium-severity issues related to state management and potential data loss in samples.

case .video, .audio, .document:
PhotoReasoningScreen(firebaseService: firebaseService)
case .functionCalling:
FunctionCallingScreen(firebaseService: firebaseService)

Choose a reason for hiding this comment

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

medium

For consistency with other screens and to support samples with pre-defined data, FunctionCallingScreen should also be initialized with a sampleId. The "Weather Chat" sample, for instance, has a chatHistory. Without passing the sampleId, this history will not be loaded, and the sample won't be presented as intended.

Suggested change
FunctionCallingScreen(firebaseService: firebaseService)
FunctionCallingScreen(firebaseService: firebaseService, sampleId: sample.id)

Copy link
Contributor Author

@YoungHypo YoungHypo Jul 31, 2025

Choose a reason for hiding this comment

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

Need to wait for function calling to change from currency converter to weather query before adding sampleId to it.

Copy link
Contributor

@peterfriese peterfriese left a comment

Choose a reason for hiding this comment

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

Thanks for sending this PR, @YoungHypo!

I left a few comments - most importantly about using system colors to ensure this looks good in light and dark mode.

@YoungHypo
Copy link
Contributor Author

YoungHypo commented Aug 2, 2025

Thanks for sending this PR, @YoungHypo!

I left a few comments - most importantly about using system colors to ensure this looks good in light and dark mode.

Thank you for your valuable review, @peterfriese. I’ve made these changes, and the rendering now works for both iOS 26 and iOS 18 in light and dark modes with a consistent style.

@YoungHypo YoungHypo requested a review from peterfriese August 2, 2025 19:40
Copy link
Contributor

@peterfriese peterfriese left a comment

Choose a reason for hiding this comment

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

Looking good, just a few nits.

@peterfriese peterfriese changed the base branch from main to peterfriese/firebase-ai-quickstart-refresh August 4, 2025 20:38
@peterfriese
Copy link
Contributor

Updating the target branch, as the current version of the code isn't ready for merging into main yet.

@peterfriese peterfriese self-assigned this Aug 4, 2025
@peterfriese peterfriese self-requested a review August 4, 2025 20:45
Copy link
Contributor

@peterfriese peterfriese left a comment

Choose a reason for hiding this comment

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

See my individual comments. Also, since the PR has some open tasks (see the initial comment), I would recommend either continuing working on the PR, or merging into peterfriese/firebase-ai-quickstart-refresh.

@YoungHypo
Copy link
Contributor Author

See my individual comments. Also, since the PR has some open tasks (see the initial comment), I would recommend either continuing working on the PR, or merging into peterfriese/firebase-ai-quickstart-refresh.

Thanks for the suggestion @peterfriese! Since this PR has already diverged a lot from the main branch, I prefer merging it into the peterfriese/firebase-ai-quickstart-refresh branch. The next steps of integrating ConversationKit and the multimodal analysis demo involve even larger changes — perhaps it would be better to review them directly in that branch?

@peterfriese peterfriese merged commit 3c692b9 into firebase:peterfriese/firebase-ai-quickstart-refresh Aug 5, 2025
3 checks passed
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.

2 participants