Skip to content

Conversation

@YoungHypo
Copy link
Contributor

@YoungHypo YoungHypo commented Nov 17, 2025

Problem

Broken preview flow: Current attachment preview card in MultimodalScreen did not show the custom card UI.
Simulator Screenshot - iPhone 16e - 2025-11-17 at 01 24 15

Fix

implemented extension View for MultimodalAttachment so each attachment supplies its own card (AttachmentPreview). This aligns with ConversationKit’s expectations. peterfriese/ConversationKit#20

MIME conformance: I synced supportedFileExtensions and getMimeType with the official Firebase AI multimodal doc (image/video/audio/doc types now match the published list exactly). https://firebase.google.com/docs/ai-logic/input-file-requirements?api=dev

@gemini-code-assist
Copy link
Contributor

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 addresses a critical issue where multimodal attachment previews were not rendering correctly. It introduces a more robust and flexible preview mechanism by allowing each MultimodalAttachment to define its own preview UI using a ViewBuilder. Concurrently, it updates the application's file type and MIME type mappings to ensure full compliance with the latest Firebase AI multimodal input requirements, enhancing compatibility and data integrity for various media and document attachments.

Highlights

  • Attachment Preview Fix: The pull request resolves a broken attachment preview flow in the MultimodalScreen by implementing a @ViewBuilder public function previewView() within MultimodalAttachment. This allows each attachment to provide its own AttachmentPreviewCard, aligning with ConversationKit's expectations for custom card UI.
  • MIME Type Conformance: The supportedFileExtensions and getMimeType definitions have been updated to strictly conform with the official Firebase AI multimodal documentation. This ensures accurate handling and validation of image, video, audio, and document types based on the published list of input file requirements.
  • Simplified Preview Components: The AttachmentPreviewCard and AttachmentPreviewScrollView components have been simplified by removing the onRemove closure. The responsibility for preview logic and potential removal actions is now managed at a higher level, streamlining these UI elements.
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.

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 fixes the multimodal attachment preview by implementing a custom previewView. Additionally, it updates the supported file extensions and MIME types to align with the Firebase AI documentation. While the UI fix is solid, the updates to file type handling have introduced a few issues. Specifically, support for the common .jpg extension has been dropped, there's an inconsistency in handling .pcm files, and a potentially incorrect mapping for .mpa files. I've provided detailed comments and suggestions to address these points.

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.

LGTM, approved

@peterfriese peterfriese merged commit 7daaa08 into firebase:peterfriese/firebase-ai-quickstart-refresh-main Nov 18, 2025
2 of 4 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