From 2a06af4a89ededda59b303ed2140b7a5bda6e761 Mon Sep 17 00:00:00 2001 From: Malik Alleyne-Jones Date: Tue, 12 May 2026 10:42:45 -0400 Subject: [PATCH 1/3] fix: drop nested
wrapper from comments composer (#77) The composer's outer `` produced invalid HTML when `CommentsEntry` was rendered inside a Filament action modal (which renders its own ``), causing the modal footer and any `extraModalFooterActions()` buttons to disappear or render outside the modal. The submit/cancel buttons already used `wire:click`, so the form wrapper was load-bearing only for the invalid HTML it created. Replacing it with a plain `
` keeps the same Livewire behavior without nesting forms. --- resources/views/comments.blade.php | 4 ++-- tests/Livewire/CommentsTest.php | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/resources/views/comments.blade.php b/resources/views/comments.blade.php index d151a6f..61268fd 100644 --- a/resources/views/comments.blade.php +++ b/resources/views/comments.blade.php @@ -4,7 +4,7 @@ {{-- Main Comments Area --}}
@if (Config::resolveAuthenticatedUser()?->can('create', Config::getCommentModel())) - +
{{-- tiptap editor --}}
{{ __('commentions::comments.cancel') }}
- +
@endif create(); + actingAs($user); + + $post = Post::factory()->create(); + + livewire(Comments::class, [ + 'record' => $post, + ]) + ->assertDontSeeHtml('assertSeeHtml('wire:click="save"'); +}); + test('comments editor includes prefixed component alias', function () { /** @var User $user */ $user = User::factory()->create(); From 034e56f485ee02d8904d5be845bb2ae1ad7e72f2 Mon Sep 17 00:00:00 2001 From: Malik Alleyne-Jones Date: Sat, 16 May 2026 14:47:19 -0400 Subject: [PATCH 2/3] Add add_comment translation and improve form accessibility Add the 'add_comment' translation string across all supported languages (en, ar, es, fr, nl, ro) and add semantic HTML role and aria-label to the comment form for better accessibility. --- resources/lang/ar/comments.php | 1 + resources/lang/en/comments.php | 1 + resources/lang/es/comments.php | 1 + resources/lang/fr/comments.php | 1 + resources/lang/nl/comments.php | 1 + resources/lang/ro/comments.php | 1 + resources/views/comments.blade.php | 2 +- tests/Livewire/CommentsTest.php | 1 + 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/lang/ar/comments.php b/resources/lang/ar/comments.php index ddf3e4e..90074ec 100644 --- a/resources/lang/ar/comments.php +++ b/resources/lang/ar/comments.php @@ -3,6 +3,7 @@ return [ 'label' => 'التعليقات', 'placeholder' => 'اكتب تعليقك…', + 'add_comment' => 'أضف تعليقًا', 'no_comments_yet' => 'لا توجد تعليقات .', 'user_avatar_alt' => 'صورة المستخدم ', diff --git a/resources/lang/en/comments.php b/resources/lang/en/comments.php index 77dc525..87f740d 100644 --- a/resources/lang/en/comments.php +++ b/resources/lang/en/comments.php @@ -3,6 +3,7 @@ return [ 'label' => 'Comments', 'placeholder' => 'Type your comment…', + 'add_comment' => 'Add a comment', 'no_comments_yet' => 'No comments yet.', 'user_avatar_alt' => 'User Avatar', diff --git a/resources/lang/es/comments.php b/resources/lang/es/comments.php index 99d02de..130fa0d 100644 --- a/resources/lang/es/comments.php +++ b/resources/lang/es/comments.php @@ -3,6 +3,7 @@ return [ 'label' => 'Comentarios', 'placeholder' => 'Escribe tu comentario...', + 'add_comment' => 'Añadir un comentario', 'no_comments_yet' => 'Aún no hay comentarios.', 'user_avatar_alt' => 'Avatar de usuario', diff --git a/resources/lang/fr/comments.php b/resources/lang/fr/comments.php index ea38080..3dfe0c5 100644 --- a/resources/lang/fr/comments.php +++ b/resources/lang/fr/comments.php @@ -3,6 +3,7 @@ return [ 'label' => 'Commentaires', 'placeholder' => 'Rédiger votre commentaire...', + 'add_comment' => 'Ajouter un commentaire', 'no_comments_yet' => 'Aucun commentaire pour le moment.', 'user_avatar_alt' => 'Avatar de l\'utilisateur', diff --git a/resources/lang/nl/comments.php b/resources/lang/nl/comments.php index 187446a..a647188 100644 --- a/resources/lang/nl/comments.php +++ b/resources/lang/nl/comments.php @@ -2,6 +2,7 @@ return [ 'label' => 'Opmerkingen', + 'add_comment' => 'Een opmerking toevoegen', 'no_comments_yet' => 'Nog geen opmerkingen.', 'user_avatar_alt' => 'Profielfoto', diff --git a/resources/lang/ro/comments.php b/resources/lang/ro/comments.php index a3c0ff4..1a9de19 100644 --- a/resources/lang/ro/comments.php +++ b/resources/lang/ro/comments.php @@ -3,6 +3,7 @@ return [ 'label' => 'Comentarii', 'placeholder' => 'Scrie comentariul tău...', + 'add_comment' => 'Adaugă un comentariu', 'no_comments_yet' => 'Niciun comentariu încă.', 'user_avatar_alt' => 'Avatar', diff --git a/resources/views/comments.blade.php b/resources/views/comments.blade.php index 61268fd..1be459b 100644 --- a/resources/views/comments.blade.php +++ b/resources/views/comments.blade.php @@ -4,7 +4,7 @@ {{-- Main Comments Area --}}
@if (Config::resolveAuthenticatedUser()?->can('create', Config::getCommentModel())) -
+
{{-- tiptap editor --}}
$post, ]) ->assertDontSeeHtml('assertSeeHtml('role="form"') ->assertSeeHtml('wire:click="save"'); }); From f0670d06586bf518f1e282142fbba487d5654262 Mon Sep 17 00:00:00 2001 From: Malik Alleyne-Jones Date: Sat, 16 May 2026 19:20:34 -0400 Subject: [PATCH 3/3] Update phpstan.neon --- phpstan.neon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 8eacab5..1a74fff 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -47,7 +47,7 @@ parameters: path: src/RenderableComment.php - - message: '#^Call to an undefined method PHPUnit\\Framework\\TestCase::[a-zA-Z0-9_]+\(\)\.$#' + message: '#^Call to an undefined method Pest\\PendingCalls\\TestCall::[a-zA-Z0-9_]+\(\)\.$#' identifier: method.notFound count: 3 path: tests/**/*.php @@ -58,13 +58,13 @@ parameters: path: tests/Pest.php - - message: '#^Call to an undefined method PHPUnit\\Framework\\TestCase\:\:assertDatabaseHas\(\)\.$#' + message: '#^Call to an undefined method Pest\\PendingCalls\\TestCall\:\:assertDatabaseHas\(\)\.$#' identifier: method.notFound count: 2 path: tests/Livewire/CommentReactionTest.php - - message: '#^Call to an undefined method PHPUnit\\Framework\\TestCase\:\:assertDatabaseMissing\(\)\.$#' + message: '#^Call to an undefined method Pest\\PendingCalls\\TestCall\:\:assertDatabaseMissing\(\)\.$#' identifier: method.notFound count: 3 path: tests/Livewire/CommentReactionTest.php