Skip to content

Conversation

@StanBarrows
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 23, 2025 20:49
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 PR refactors two Blade components to make their CSS class props optional by moving default values into inline fallbacks.

  • Changed imageContainerClassAttributes and classAttributes prop defaults to null
  • Added inline ?? fallbacks for default Tailwind CSS classes in the templates

Reviewed Changes

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

File Description
resources/views/components/list-image-card.blade.php Made image container classes optional with a null coalesce fallback
resources/views/components/list-grid.blade.php Made grid wrapper classes optional with a null coalesce fallback
Comments suppressed due to low confidence (2)

resources/views/components/list-image-card.blade.php:10

  • Add component tests to verify both custom and default class scenarios for imageContainerClassAttributes, ensuring the fallback behaves as expected.
    <div class="{{ $imageContainerClassAttributes ?? 'h-32 h-32 flex-shrink-0 overflow-hidden' }}">

resources/views/components/list-grid.blade.php:3

  • Include tests to cover cases where classAttributes is provided and when it falls back to the default, ensuring both render paths are validated.
<div class="{{ $classAttributes ?? 'mt-2 grid grid-cols-1 lg:grid-cols-2 gap-4'}}">

Comment on lines +3 to +10
'imageContainerClassAttributes' => null,
'name',
'role' => null,
'icons' => [],
])

<div class="flex flex-row rounded-xl overflow-hidden transition group">
<div class="{{ $imageContainerClassAttributes }}">
<img src="{{ $image }}" alt="{{ $name }}"
class="w-full h-full object-cover transition-transform duration-300 ease-in-out group-hover:scale-105"/>
<div class="{{ $imageContainerClassAttributes ?? 'h-32 h-32 flex-shrink-0 overflow-hidden' }}">
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

Consider defining the default container classes directly in the @props declaration (e.g., 'imageContainerClassAttributes' => 'h-32 h-32 flex-shrink-0 overflow-hidden') and removing the inline fallback to simplify the template logic.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
@props(['classAttributes' => null])

<div class="{{ $classAttributes }}">
<div class="{{ $classAttributes ?? 'mt-2 grid grid-cols-1 lg:grid-cols-2 gap-4'}}">
Copy link

Copilot AI Jun 23, 2025

Choose a reason for hiding this comment

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

Similarly, consider setting the default grid classes in the @props declaration (e.g., 'classAttributes' => 'mt-2 grid grid-cols-1 lg:grid-cols-2 gap-4') and remove the inline fallback for cleaner code.

Copilot uses AI. Check for mistakes.
@StanBarrows StanBarrows merged commit ca0d24d into production Jun 23, 2025
5 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