Skip to content

Comments

Fix #2887: Sponsor logo collides with section header text#2930

Open
iampujan wants to merge 3 commits intopython:mainfrom
iampujan:feature/issue-2887-fix-sponsor-logo-overlap
Open

Fix #2887: Sponsor logo collides with section header text#2930
iampujan wants to merge 3 commits intopython:mainfrom
iampujan:feature/issue-2887-fix-sponsor-logo-overlap

Conversation

@iampujan
Copy link
Contributor

Fixes #2887. Replaces invalid 0fr column grid properties with 1fr, and removes hardcoded 1 row rule to correctly let sponsor items naturally wrap to multiple rows without overflowing into the next section. Also fixes a 500 error triggered by missing image file paths in the 'ideal_size' filter.

- Replaced 0fr with 1fr in the CSS Grid template for the sponsor listings to prevent overflow on wrapping.
- Removed hardcoded 'grid-template-rows' logic that caused implicit rows to overlap.
- Handled missing image logo metadata by resolving 'ValueError' in the 'ideal_size' sponsor templatetag.
Copilot AI review requested due to automatic review settings February 21, 2026 11:40
Copy link

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 pull request fixes issue #2887 where sponsor logos were colliding with section header text on the sponsors page. The fix addresses two related problems: incorrect CSS grid properties causing layout overflow, and a server error from missing image handling.

Changes:

  • Fixed CSS grid layout by replacing invalid 0fr values with 1fr and removing the hardcoded single row constraint to allow proper wrapping
  • Added ValueError exception handling in the ideal_size template filter to handle corrupted or invalid image files
  • Added bottom margin spacing between sponsor sections

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/sponsors/templates/sponsors/partials/sponsors-list.html Updated CSS grid properties from 0fr to 1fr, removed single-row constraint, and added section spacing to fix logo overflow issue
apps/sponsors/templatetags/sponsors.py Added ValueError to exception handling in ideal_size filter to prevent 500 errors from invalid image files

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

try:
w, h = image.width, image.height
except FileNotFoundError:
except (FileNotFoundError, ValueError):
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The ideal_size filter now catches ValueError in addition to FileNotFoundError, but there's no test coverage for this filter. Consider adding tests to verify the error handling behavior, especially for cases where the image file is missing or has invalid dimensions that could raise ValueError.

Copilot uses AI. Check for mistakes.
Covers FileNotFoundError and ValueError exception handling for missing image files.
Copilot AI review requested due to automatic review settings February 21, 2026 11:57
Copy link

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.


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

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.

Bug: Sponsor logo collides with section header text

1 participant