Skip to content

Conversation

@parlough
Copy link
Member

Switch from defining the banner in src/data/banner.yml to the bannerHtml field in the src/data/site.yml banner alongside showBanner.

I'm not sure this is the solution I want to use long term, but it works for now.

@parlough parlough requested review from a team and sfshaza2 as code owners November 12, 2025 18:26
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @parlough, 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 refactors the site banner mechanism to allow for more flexible content definition. Instead of a structured YAML file, the banner content is now directly provided as HTML within the main site configuration, simplifying how complex banner messages with custom formatting can be displayed. This change aims to provide immediate functionality while acknowledging potential future iterations.

Highlights

  • Banner Content Source Relocation: The source for the site banner content has been moved from the dedicated src/data/banner.yml file to a new bannerHtml field within the main site configuration file, src/data/site.yml.
  • Flexible HTML Input for Banner: The DashBanner component now directly accepts a raw HTML string (inlineHtmlContent) for display, replacing the previous structured BannerContent object, which allows for more flexible formatting.
  • Code Simplification: The BannerContent class and its associated parsing logic have been removed from site/lib/src/components/layout/banner.dart, simplifying the banner component's implementation.
  • YAML File Removal: The src/data/banner.yml file, which previously defined the banner's content, has been deleted as its functionality is now integrated into src/data/site.yml.
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 refactors the site banner to use a more flexible HTML-based format defined in site.yml, instead of the previous structured format in a separate file. This change simplifies the DashBanner component by removing the parsing logic.

While this approach offers more flexibility, it introduces security concerns. My review includes two main points:

  1. A high-severity issue regarding the use of raw() to render HTML, which creates a potential Cross-Site Scripting (XSS) vulnerability.
  2. A medium-severity issue related to a missing rel attribute on a link with target="_blank", which could lead to tabnabbing.

I've provided recommendations to mitigate these security risks.

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

lgtm. THANKS!

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Nov 12, 2025

Visit the preview URL for this PR (updated for commit c9df52c):

https://flutter-docs-prod--pr12676-feat-flexible-banner-5x88vvs2.web.app

@parlough parlough merged commit 6821910 into main Nov 12, 2025
9 checks passed
@parlough parlough deleted the feat/flexible-banner branch November 12, 2025 18:50
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.

3 participants