1994/promo-bar-statamic
A lightweight Statamic add-on for adding a customizable promotional bar to your site. Manage announcement text, links, and display settings from the control panel to highlight sales, notices, or campaigns.
This is a small patch release (v1.1.1) with three bug fixes: no-JS phone rendering, stacked-bar view counting, and keyboard-focus retention across responsive resizes. There are no breaking changes, no new config keys, and no migrations implied. Upgrading is a composer update away, but the fixes change observable behavior on phones, so re-check your mobile rendering and analytics after upgrading.
Minimal steps:
composer update vendor/package — Laravel auto-discovery handles the service provider.php artisan vendor:publish --tag=package-config (and --tag=package-views / --tag=package-migrations if you have not already). Run php artisan migrate if the views table is new to your app.<x-bars />) or an include placed just before </body>.Where to look first:
Single render point. Render the bars component exactly once, in your base layout. Duplicating it across layouts (e.g. a separate auth layout and app layout) double-counts views and can stack the same bar twice.
Ordering is the no-JS contract. With JavaScript off on a phone, only the first eligible bar is shown. Treat config order as the fallback priority: the bar you most want phone users to see goes first. If you use rotation, remember there is no rotation without JS, so a rotating set must still make sense when only its first member is visible.
Stacked vs. rotating. Stacked bars now count a view only for the bar actually shown, not the ones collapsed below it. That means your impressions report is finally comparable between mobile and desktop. If you were compensating for the old over-counting in dashboards or exports, remove that fudge factor.
Targeting and segments. Scope bars by device, audience, route, or date window. Because the phone fallback picks the first eligible bar, an expired or out-of-scope first bar correctly yields to the next one — worth a test if your bars are heavily scheduled.
Layout integration. Place the component outside any v-if/@auth block that would re-mount it on navigation; in Inertia or Livewire apps the component can re-render on every visit, inflating counts. Mount it on a persistent layout element, or gate the view beacon to full page loads.
Testing. A feature test asserting the rendered markup and the resulting row in the views table covers the counting regression. For the focus fix, a browser test (Dusk/Pest browser) that focuses a control inside a bar, resizes past the phone breakpoint, and asserts document.activeElement moves to the still-visible bar — or to the first focusable element after the bars — is the direct check for v1.1.1.
document.activeElement (fix 3).How can I help you explore Laravel packages today?