Firefox on MacOS "flickering" when browsing between pages when sidebar is collapsible
Package
filament/filament
Package Version
v2.17.46
Laravel Version
10
Livewire Version
v2.11
PHP Version
PHP 8.2.5
Problem description
When navigating between Filament admin pages using Firefox on MacOS (not able to test on other OSes), the page flickers as it looks to be doing a full re-render. Although this is expected behaviour on a full page load, it usually appears smoothed over and less jerky as you don't see all content being redrawn. When doing the same in another browser (Chrome or Safari), or setting 'sidebar' => [ 'is_collapsible_on_desktop' => false] (instead of true), the behaviour reverts to normal.
This can be seen on this screen recording (taken from @Stanley on Discord): https://cdn.discordapp.com/attachments/1083743705892134963/1083743706345128027/Screen_Recording_2023-03-10_at_14.24.39.mov
I'm guessing there's some rendering process for the sidebar that's making Firefox redraw the elements slower, forcing the "flicker".
Expected behavior
Flickering shouldn't occur, like the normal behaviour in Safari and Chrome, or when 'sidebar' => [ 'is_collapsible_on_desktop' => true]
Steps to reproduce
Create a new Filament app, set 'sidebar' => [ 'is_collapsible_on_desktop' => true ] Browse between pages/resources from the sidebar in Firefox (MacOS).
Reproduction repository
https://github.com/benshawuk/filament
Relevant log output
none
This happens for me in all browsers.
The reason it is happening is because when the sidebar is set to be collapsible on desktop the sidebar has to be hidden initially since it can exist in either collapsed or open state and can only be shown when Alpine initializes and can set / read the store value to determine which way to show it.
So this will always be limited by the browser's ability to load and run the main JS thread in a timely manner.
I'm not sure there is much we can do about it.
Yeah, I think fixing it would introduce other issues with the sidebar sometimes briefly appearing when it is collapsed, right?
I think so.
I think it would be better to look like a page reload than a janky sidebar.
I think it's less annoying if it disappears instead of expands, so closing
Agreed.