Skip to content

Conversation

@fulleni
Copy link
Member

@fulleni fulleni commented Oct 22, 2025

Status

READY

Description

This pull request streamlines ad management by shifting the responsibility for in-article ad lifecycle from a global cache to individual widgets, ensuring more robust resource handling. It also removes the user-facing dismissal option for feed decorators, simplifies the project's VS Code configuration, and includes general code cleanup and formatting improvements.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

- Deleted the entire .vscode/launch.json file
- This file contained configuration settings for different app environments
- Update .gitignore to exclude .vscode/ directory instead of .vscode/*
- Remove .vscode/extensions.json file to avoid specific editor recommendations
- Removed mention of pre-configured VS Code launch.json profiles
- This change reflects the migration from Flutter to Dart, focusing on
  making the framework adaptable to various editor environments
…ifecycle management

- Remove InlineAdCacheService dependency and cache inline ads within the widget
- Simplify ad loading logic by always fetching a new ad when needed
- Ensure proper disposal of ad resources when the widget is disposed
- Remove contextKey parameter as it's no longer needed
- Update widget documentation to reflect new implementation details
- Applied dart fix to the entire file
- Adjusted indentation and line breaks
- Removed unnecessary whitespace and blank lines
- Updated some variable assignments to use shorthand syntax
…testing

- Reduce adMaxAge in FeedAdLoaderWidget from 5 minutes to 1 minute
- Change interstitial ad countdown in LocalInterstitialAdDialog from 5 seconds to 1 second
- These changes allow for more frequent ad refreshes and faster testing of interstitial ad functionality
- Remove PopupMenuButton for dismissal option
- Simplify widget structure by removing related callback and logic
- Update documentation to reflect changes
…ion decorator

- Remove PopupMenuButton for dismiss option
- Update widget documentation to reflect removal of dismiss functionality
- Remove onDismiss parameter from ContentCollectionDecoratorWidget class
- Remove FeedDecoratorDismissed event from headlines_feed_event.dart
- Remove _onFeedDecoratorDismissed handler from headlines_feed_bloc.dart
- Remove onDismiss callbacks from headlines_feed_page.dart
- Update imports and dependencies related to decorator dismissal
@fulleni fulleni linked an issue Oct 22, 2025 that may be closed by this pull request
@gemini-code-assist
Copy link

Summary of Changes

Hello @fulleni, 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 streamlines ad management by shifting the responsibility for in-article ad lifecycle from a global cache to individual widgets, ensuring more robust resource handling. It also removes the user-facing dismissal option for feed decorators, simplifies the project's VS Code configuration, and includes general code cleanup and formatting improvements.

Highlights

  • In-Article Ad Lifecycle Management: The InArticleAdLoaderWidget has been refactored to manage its own ad lifecycle directly, fetching ads from AdService and disposing of them when the widget is removed. This eliminates the reliance on InlineAdCacheService for in-article ads, preventing cache collisions and ensuring proper resource cleanup.
  • Feed Ad Staleness Adjustment: The maximum age for cached feed ads in FeedAdLoaderWidget has been reduced from 5 minutes to 1 minute, which may lead to more frequent ad refreshes in the feed.
  • Removal of VS Code Configuration: The .vscode/extensions.json and .vscode/launch.json files have been removed, simplifying the project's VS Code setup. Corresponding documentation in README.md has also been updated.
  • Removal of Feed Decorator Dismissal: The functionality for users to dismiss feed decorators (like Call-to-Action or Content Collection decorators) has been removed. This includes the FeedDecoratorDismissed event and associated UI elements.
  • Code Formatting and Minor Fixes: Several files have received minor formatting adjustments to align with Dart's formatting standards, and a small typo in a TODO comment within local_interstitial_ad_dialog.dart has been corrected.
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

@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 introduces a significant and beneficial refactoring of the in-article ad loading mechanism, moving from a shared cache to a self-contained widget state. This improves lifecycle management and prevents potential state conflicts. Additionally, it removes the ability for users to dismiss feed decorators, which appears to be a deliberate product change. The code is cleaner and more robust as a result. I've identified a few minor areas for improvement, including a potential UI regression in one of the decorator widgets and some code simplification opportunities.

@fulleni fulleni merged commit 48d1fec into main Oct 22, 2025
0 of 2 checks passed
@fulleni fulleni deleted the fix/ads-article-pa-pb-pa-and-feed-decorator-dismiss branch October 22, 2025 11:01
@fulleni fulleni added this to the Foundation Edition milestone Nov 1, 2025
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.

fix: ads article A>B>A and feed decorator dismiss

2 participants