Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor/ad config UI role based #85

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

Merged
fulleni merged 13 commits into main from refactor/ad-config-ui-role-based
Sep 23, 2025
Merged

Conversation

@fulleni
Copy link
Member

@fulleni fulleni commented Sep 23, 2025
edited
Loading

Status

READY

Description

This pull request introduces a substantial refactoring of the ad configuration user interface, shifting from a generalized approach to a more explicit and granular role-based system. The primary goal is to provide administrators with finer control over ad display settings for different user segments, including guest, standard, and premium users. This change enhances flexibility by allowing specific ad frequencies and placements to be defined for each role, and notably, removes the hardcoded ad-free experience for premium users, making their ad settings fully configurable.

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

- Update resolved-ref in pubspec.lock from b6a3fb4 to d7d9afa3
- Remove TabBar and role-based conditional rendering
- Update widget documentation
- Simplify state management by removing controllers and related methods
...bility
- Add TabBar for selecting user roles
- Implement role-specific configuration fields for in-article ad slots
- Use CheckboxListTile to enable/disable ad slots per role
- Update state management with TabController
- Refactor UI layout for better readability
- Replace separate frequency and placement interval fields with a single enabled toggle for each role
- Restructure ad configuration model to use a map for role-specific settings
- Update controller initialization and value updating logic to reflect new model
- Modify tab change listener to enforce business rules for premium users
- Update ad frequency and placement interval retrieval methods
- Remove unnecessary switch statements and simplify configuration updates
- Replace single config object with map for better role-based frequency control
- Add checkbox to toggle ad visibility for each user role
- Update controllers initialization and updates logic
- Simplify transitions retrieval and update methods
- Enhance comments and code structure for better readability
- Add Arabic and English translations for new checkbox label related to in-article ads
- Introduce placeholder for user role in both Arabic and English versions
...tency
- Replace CheckboxListTile with SwitchListTile for better alignment with existing design
- Restructure the widget layout to improve usability
- Enhance the logic for enabling/disabling in-article ads for different user roles
- Increase TabBarView height for better spacing
- Replace CheckboxListTile with SwitchListTile for consistency
- Update role visibility toggle label and logic
...ial ad settings
- Replace CheckboxListTile with SwitchListTile for better consistency with other screens
- Update checkbox labels to follow a more consistent pattern
- Adjust code formatting and indentation for improved readability
- Revert SwitchListTile back to CheckboxListTile for in-article ad slot types
- Remove premiuim user role special handling
- Simplify role slot toggle logic
- Remove _tabController listener for enforcing premium user ad rules
- Remove 'isEnabled' check in role-specific fields
- Update widget descriptions and switch labels
- Remove unnecessary comments
- Remove _tabController.addListener(_onTabChanged) and related logic
- Remove automatic setting of transitions to 0 for premium users
- Remove isEnabled check from _buildInterstitialRoleSpecificFields
- Update switch label to "Visible to [Role]"
- Remove.enabled parameter from TextFormField
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 introduces a substantial refactoring of the ad configuration user interface, shifting from a generalized approach to a more explicit and granular role-based system. The primary goal is to provide administrators with finer control over ad display settings for different user segments, including guest, standard, and premium users. This change enhances flexibility by allowing specific ad frequencies and placements to be defined for each role, and notably, removes the hardcoded ad-free experience for premium users, making their ad settings fully configurable.

Highlights

  • Role-Based Ad Configuration: Ad settings for feed and interstitial ads are now explicitly configurable per user role (Guest, Standard, Premium) using dedicated UI sections.
  • Granular In-Article Ad Control: In-article ad slots can now be enabled/disabled and configured per user role, offering more precise control over ad visibility.
  • Premium User Ad Configurability: Premium users' ad settings are no longer automatically set to zero; their ad experience can now be manually configured, allowing for more flexible ad strategies.
  • UI Simplification: The main AdConfigForm has been simplified, delegating role-specific ad configuration to specialized sub-forms.
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

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 refactors the ad configuration UI to be role-based, moving logic out of a general form into more specific, tabbed widgets for feed, article, and interstitial ads. The changes improve the structure and separation of concerns. My feedback focuses on reducing code duplication within the new onChanged callbacks by extracting the state update logic into helper methods, which will enhance maintainability.

@fulleni fulleni merged commit 439b81f into main Sep 23, 2025
1 check failed
@fulleni fulleni deleted the refactor/ad-config-ui-role-based branch September 23, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /