Skip to content

Conversation

@scooterthedev
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 8, 2025 04:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new navigation item for "Account Deletions" in the sidebar, visible only to superadmins. The feature displays a badge showing the count of pending deletion requests when there are any pending.

Key Changes:

  • Added "Account Deletions" navigation link that routes to admin_deletion_requests_path
  • Displays a badge with the count of pending deletion requests when count > 0
  • Uses the existing superadmin_tool wrapper to restrict visibility to superadmins

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +148 to +149
<% pending_count = DeletionRequest.pending.count %>
<% if pending_count > 0 %>
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

This database query executes on every page load for all superadmins. Since the navigation partial is rendered on every page, this could create unnecessary database load. Consider moving this count to the controller (e.g., ApplicationController) and caching it with a short TTL (e.g., 5 minutes), or use a counter cache strategy to avoid repeated COUNT queries.

Suggested change
<% pending_count = DeletionRequest.pending.count %>
<% if pending_count > 0 %>
<% pending_count = @pending_deletion_request_count %>
<% if pending_count.to_i > 0 %>

Copilot uses AI. Check for mistakes.
Copy link
Member

@3kh0 3kh0 left a comment

Choose a reason for hiding this comment

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

In the future we will have a actual dashboard and not a long ass sidebar, but this will do for now

@3kh0 3kh0 merged commit 8a04c68 into hackclub:main Dec 8, 2025
12 checks passed
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