Skip to content

Conversation

@Luke-Oldenburg
Copy link
Contributor

Summary of the problem

Describe your changes

@Luke-Oldenburg Luke-Oldenburg requested a review from a team December 12, 2025 05:41
@Luke-Oldenburg Luke-Oldenburg marked this pull request as draft December 12, 2025 05:41
Comment on lines 40 to 50
</div>
<% end %>
<div data-tabs-target="tab" id="user">
<% @organizers.each do |position| %>
<% @grant_recipients.each do |user| %>
<div class="flex items-center">
<%= link_to(event_ledger_path(@event, upsert_query_params(user: position.user.friendly_id)), class: "flex-auto flex items-center menu__action #{"menu__action--active" if @user&.friendly_id == position.user.friendly_id}", data: { turbo_prefetch: "false" }) do %>
<%= link_to(event_ledger_path(@event, upsert_query_params(user: user.friendly_id)), class: "flex-auto flex items-center menu__action #{"menu__action--active" if @user&.friendly_id == user.friendly_id}", data: { turbo_prefetch: "false" }) do %>
<div class="avatar-grow line-height-0 mr1">
<%= avatar_for position.user, size: 18 %>
<%= avatar_for user, size: 18 %>
</div>
<%= position.user.name %>
<% end %>
</div>
<% end %>
</div>
<div data-tabs-target="tab" id="type">
<% ["ach_transfer", "card_charge", "check_deposit", "donation", "fiscal_sponsorship_fee", "hcb_transfer", "invoice", "mailed_check", "paypal_transfer", "refund", "reimbursement", "wire"].each do |type| %>
<div class="flex items-center">
<%= link_to(event_ledger_path(@event, upsert_query_params(type:)), class: "flex-auto menu__action #{"menu__action--active" if @type == type}", data: { turbo_prefetch: "false" }) do %>
<%= type.humanize.gsub("Ach", "ACH").gsub("Paypal", "PayPal").gsub("Hcb", "HCB") %>
<%= user.name %>
<% end %>
Copy link

Choose a reason for hiding this comment

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

Bug: The user filter on the regular transaction page incorrectly displays card grant recipients instead of event organizers by unconditionally iterating over @grant_recipients.
Severity: HIGH | Confidence: High

🔍 Detailed Analysis

On the regular event transaction page, the filter for users incorrectly displays a list of card grant recipients instead of the event organizers. This is caused by a change in app/views/events/_filter_menu.html.erb which now unconditionally iterates over the @grant_recipients collection. The controller populates both @organizers and @grant_recipients, but the view no longer distinguishes between the regular transaction context and the card grant transaction context (which is determined by the @subledger variable). This results in a functionally incorrect filter for regular event transactions.

💡 Suggested Fix

In _filter_menu.html.erb, add a conditional check for @subledger. If @subledger is true, iterate over @grant_recipients. Otherwise, iterate over @organizers to display the correct list of users based on the context.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: app/views/events/_filter_menu.html.erb#L40-L50

Potential issue: On the regular event transaction page, the filter for users incorrectly
displays a list of card grant recipients instead of the event organizers. This is caused
by a change in `app/views/events/_filter_menu.html.erb` which now unconditionally
iterates over the `@grant_recipients` collection. The controller populates both
`@organizers` and `@grant_recipients`, but the view no longer distinguishes between the
regular transaction context and the card grant transaction context (which is determined
by the `@subledger` variable). This results in a functionally incorrect filter for
regular event transactions.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 7321999

@Luke-Oldenburg Luke-Oldenburg changed the title [Card Grants] Final sweep of UI improvements on index page [Card Grants] More UI improvements on index page Dec 15, 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.

2 participants