Skip to content

fix: honor disableSidebar() and hideSubscribers() on CommentsEntry - #101

Merged
lisa-fehr merged 2 commits into
mainfrom
fix/84-sidebar-not-hiding
Jul 23, 2026
Merged

lisa-fehr merged 2 commits into
mainfrom
fix/84-sidebar-not-hiding

Conversation

@ItsMalikJones

Copy link
Copy Markdown
Contributor

Summary

Fixes #84.

The notification sidebar kept rendering on the infolist CommentsEntry even when ->disableSidebar(true) or ->hideSubscribers(true) was set. This PR fixes the two wiring bugs behind that and adds end-to-end test coverage.

Problem

Two independent bugs caused the toggles to be silently ignored:

  1. Mount-hook parameter mismatch. The Comments Livewire component's mountHasSidebar() hook expected a parameter named $enableSidebar, but every Blade view passes the prop as :sidebar-enabled — which Livewire camelCases to sidebarEnabled. The names never matched, so the hook always fell back to the commentions.subscriptions.show_sidebar config default, clobbering disableSidebar(). This affected both the infolist entry and the action modal.

  2. Missing prop on the entry view. comments-entry.blade.php never passed :show-subscribers down to the Comments component, so hideSubscribers() was dropped entirely on the infolist entry. (comments-modal.blade.php already passed it correctly.)

Changes

  • Rename the mountHasSidebar() parameter $enableSidebar → $sidebarEnabled in HasSidebar so it matches the prop name every Blade view actually passes.
  • Thread :show-subscribers="$showSubscribers()" through comments-entry.blade.php, mirroring comments-modal.blade.php.
  • Add tests:
    • tests/Filament/CommentsEntryTest.php — renders the real CommentsEntry inside a Filament schema and asserts both toggles take effect end-to-end.
    • tests/Livewire/CommentsSubscriptionTest.php — adds coverage for showSubscribers resolution and corrects a stale comment that described the bug as expected behavior.
  • Register Filament's ActionsServiceProvider, SchemasServiceProvider, and InfolistsServiceProvider in tests/TestCase.php, required to render the infolist entry under test.

@ItsMalikJones ItsMalikJones self-assigned this May 17, 2026
Comment thread src/Livewire/Concerns/HasSidebar.php
The notification sidebar kept showing despite ->disableSidebar(true) and
->hideSubscribers(true) because of two wiring bugs:

- The Comments Livewire mountHasSidebar() hook expected a parameter named
  $enableSidebar, but every blade view passes the prop as `sidebar-enabled`
  (camelCased to `sidebarEnabled`). The mismatch meant the hook always fell
  back to the config default, clobbering disableSidebar().
- comments-entry.blade.php never passed :show-subscribers to the Comments
  component, so hideSubscribers() was dropped entirely on the infolist entry.

Renames the hook parameter to $sidebarEnabled and threads :show-subscribers
through the entry view (mirroring comments-modal.blade.php).

Adds end-to-end coverage rendering the real CommentsEntry; this required
registering Filament's Actions/Schemas/Infolists service providers in the
test suite.
@lisa-fehr
lisa-fehr force-pushed the fix/84-sidebar-not-hiding branch 2 times, most recently from e47ac33 to ed29a80 Compare July 23, 2026 08:00
…stent

Co-authored-by: DL-Works <161949151+DL-Works@users.noreply.github.com>
@lisa-fehr
lisa-fehr force-pushed the fix/84-sidebar-not-hiding branch from ed29a80 to 9708179 Compare July 23, 2026 08:08
@lisa-fehr
lisa-fehr merged commit a2fb9f6 into main Jul 23, 2026
20 checks passed
@lisa-fehr
lisa-fehr deleted the fix/84-sidebar-not-hiding branch July 23, 2026 08:22
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.

Commentions Sidebar Still Appearing

2 participants