Skip to content

Flipper for card grant popovers #10649

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

manuthecoder
Copy link
Contributor

This pull request introduces a feature flag to conditionally enable card popovers on the home page

Feature flag implementation:

  • app/views/static_pages/index.html.erb: Added a line to check if the :hcb_code_popovers_2023_06_16 feature flag is enabled for the current user and set @show_card_popovers accordingly.

image

@manuthecoder manuthecoder requested review from a team as code owners June 17, 2025 14:59
@Luke-Oldenburg Luke-Oldenburg changed the title Card grant popovers Flipper for card grant popovers Jun 17, 2025
@@ -1,6 +1,6 @@
<% title "Home" %>
<% page_md %>

<% @show_card_popovers = Flipper.enabled?(:hcb_code_popovers_2023_06_16, current_user) %>
Copy link
Member

@davidcornu davidcornu Jun 18, 2025

Choose a reason for hiding this comment

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

  • concern (non-blocking): This threw me for a loop until I realized we reference this instance variable in a couple of partials and already have similar lines of code in other places. In general I don't expect templates to be setting instance variables as by convention that's usually done in the controller. There might be an opportunity to make this a bit less surprising by
    1. Moving the logic that sets @show_card_popovers into the appropriate controllers (or to a shared helper if it's the same everywhere)
    2. Using locals (https://guides.rubyonrails.org/layouts_and_rendering.html#passing-local-variables) to pass @show_card_popovers to partials rather than having partials reference it directly
  • question: In other cases we've restricted this further by checking organizer_signed_in? as well (e.g. 624af3f). Do we not need that here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@davidcornu long term goal is to replace instance variables in partials with locals. I've started work on this. I agree that it should be set in the controller.

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