From 6b8237ea316048ec642b1104a13c3b1c93129df5 Mon Sep 17 00:00:00 2001 From: Jim Ciallella <1777776+allella@users.noreply.github.com> Date: Sat, 23 May 2026 15:41:06 -0400 Subject: [PATCH 1/5] Change the scope of future events so it uses the beginning of the current date and compares it to the eventexpire_at, and not the start time. This allows sets future events, and multi-day events, to remain on the events page through the end of the last day of the event. --- app/Models/Event.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/Event.php b/app/Models/Event.php index 329b3bbd..462efc2a 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -60,7 +60,8 @@ public function scopeFilterByDateRange(Builder $query, ?Carbon $startDate, ?Carb public function scopeFuture(Builder $query): void { - $query->where('active_at', '>=', now()); +// $query->where('expire_at', '>=', now()_); + $query->where('expire_at', '>=', now()->startOfDay()); } public function url(): string From 8fc2ee6cfcbb7446cdf6a308059b9f1e5f8e233d Mon Sep 17 00:00:00 2001 From: allella <1777776+allella@users.noreply.github.com> Date: Sat, 23 May 2026 19:41:40 +0000 Subject: [PATCH 2/5] Fix styling --- app/Models/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Event.php b/app/Models/Event.php index 462efc2a..911a3138 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -60,7 +60,7 @@ public function scopeFilterByDateRange(Builder $query, ?Carbon $startDate, ?Carb public function scopeFuture(Builder $query): void { -// $query->where('expire_at', '>=', now()_); + // $query->where('expire_at', '>=', now()_); $query->where('expire_at', '>=', now()->startOfDay()); } From f4de3fc12eb40098d96d8eb4244738ee01a5c614 Mon Sep 17 00:00:00 2001 From: Jim Ciallella <1777776+allella@users.noreply.github.com> Date: Sat, 23 May 2026 15:54:25 -0400 Subject: [PATCH 3/5] Remove commented out old code --- app/Models/Event.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Models/Event.php b/app/Models/Event.php index 462efc2a..f5905b9d 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -60,7 +60,6 @@ public function scopeFilterByDateRange(Builder $query, ?Carbon $startDate, ?Carb public function scopeFuture(Builder $query): void { -// $query->where('expire_at', '>=', now()_); $query->where('expire_at', '>=', now()->startOfDay()); } From 8b569c15b608f599262375915506e88d2487e5a6 Mon Sep 17 00:00:00 2001 From: Jim Ciallella <1777776+allella@users.noreply.github.com> Date: Sat, 23 May 2026 21:19:08 -0400 Subject: [PATCH 4/5] Update Events model to include both ongoingAndFuture() and future(). Update Tests to include expire_at in events to avoid failing tests due to the change to Events->ongoingAndFuture(). Update the NoIndexNonProductionTest.php to pass in both testing and local environments. --- app/Http/Controllers/CalendarFeedController.php | 2 +- app/Http/Controllers/EventsController.php | 2 +- app/Http/Controllers/HomeController.php | 2 +- app/Http/Controllers/OrgsController.php | 2 +- app/Models/Event.php | 5 +++++ resources/css/app.css | 8 +++++--- resources/js/labs-hero.js | 10 +++++++--- tests/Feature/Http/Controllers/CalendarFeedTest.php | 5 ++--- tests/Feature/Http/Controllers/HomeControllerTest.php | 6 +++++- tests/Feature/NoIndexNonProductionTest.php | 3 +-- 10 files changed, 29 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/CalendarFeedController.php b/app/Http/Controllers/CalendarFeedController.php index c813596d..f3af05e4 100644 --- a/app/Http/Controllers/CalendarFeedController.php +++ b/app/Http/Controllers/CalendarFeedController.php @@ -41,7 +41,7 @@ public function show(CalendarFeedRequest $request) { $events = Event::query() ->with('organization', 'venue') - ->future() + ->ongoingAndFuture() ->oldest('active_at') ->when($request->validOrganizations()->isNotEmpty(), fn ($query) => $query->whereIn('organization_id', $request->validOrganizations()->pluck('id'))) ->get() diff --git a/app/Http/Controllers/EventsController.php b/app/Http/Controllers/EventsController.php index a3c5e121..6a36791f 100644 --- a/app/Http/Controllers/EventsController.php +++ b/app/Http/Controllers/EventsController.php @@ -8,7 +8,7 @@ class EventsController extends Controller { public function index() { - $months = Event::future() + $months = Event::ongoingAndFuture() ->published() ->with('organization', 'venue') ->orderBy('active_at') diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 258d32ad..89473c22 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -9,7 +9,7 @@ class HomeController extends Controller public function index() { return view('index', [ - 'upcoming_events' => Event::future() + 'upcoming_events' => Event::ongoingAndFuture() ->published() ->with('organization', 'venue') ->oldest('active_at') diff --git a/app/Http/Controllers/OrgsController.php b/app/Http/Controllers/OrgsController.php index 9c9778ba..8a9b0f33 100644 --- a/app/Http/Controllers/OrgsController.php +++ b/app/Http/Controllers/OrgsController.php @@ -27,7 +27,7 @@ public function show(Org $org) 'events' => function (Builder $query) { $query ->with('organization', 'venue') - ->future() + ->ongoingAndFuture() ->published() ->orderBy('active_at') ->limit(25); diff --git a/app/Models/Event.php b/app/Models/Event.php index f5905b9d..878c7be7 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -59,6 +59,11 @@ public function scopeFilterByDateRange(Builder $query, ?Carbon $startDate, ?Carb } public function scopeFuture(Builder $query): void + { + $query->where('active_at', '>=', now()); + } + + public function scopeOngoingAndFuture(Builder $query): void { $query->where('expire_at', '>=', now()->startOfDay()); } diff --git a/resources/css/app.css b/resources/css/app.css index 8d4be8b4..20162453 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,4 +1,4 @@ -@import "tailwindcss"; +@import 'tailwindcss'; /* Migrate from tailwind.config.js theme.extend */ @theme { @@ -7,7 +7,9 @@ --color-warning: #de9d35; --color-danger: #f44336; - --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif; + --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, + BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', + sans-serif; --breakpoint-nav-break: 1220px; } @@ -15,7 +17,7 @@ /* Preserve v3 button cursor behavior */ @layer base { button:not(:disabled), - [role="button"]:not(:disabled) { + [role='button']:not(:disabled) { cursor: pointer; } } diff --git a/resources/js/labs-hero.js b/resources/js/labs-hero.js index d12ca9c3..35c0da64 100644 --- a/resources/js/labs-hero.js +++ b/resources/js/labs-hero.js @@ -5,7 +5,9 @@ */ export function initHeroCanvas(canvas) { const ctx = canvas.getContext('2d'); - const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; + const prefersReducedMotion = window.matchMedia( + '(prefers-reduced-motion: reduce)', + ).matches; const PARTICLE_COUNT = 60; const CONNECT_DISTANCE = 120; @@ -55,7 +57,7 @@ export function initHeroCanvas(canvas) { const dy = p.y - mouse.y; const dist = Math.sqrt(dx * dx + dy * dy); if (dist < MOUSE_RADIUS && dist > 0) { - const force = (MOUSE_RADIUS - dist) / MOUSE_RADIUS * MOUSE_FORCE; + const force = ((MOUSE_RADIUS - dist) / MOUSE_RADIUS) * MOUSE_FORCE; p.vx += (dx / dist) * force; p.vy += (dy / dist) * force; } @@ -91,7 +93,9 @@ export function initHeroCanvas(canvas) { ctx.beginPath(); ctx.moveTo(p.x, p.y); ctx.lineTo(q.x, q.y); - ctx.strokeStyle = `rgba(255, 255, 255, ${0.15 * (1 - dist / CONNECT_DISTANCE)})`; + ctx.strokeStyle = `rgba(255, 255, 255, ${ + 0.15 * (1 - dist / CONNECT_DISTANCE) + })`; ctx.lineWidth = 0.5; ctx.stroke(); } diff --git a/tests/Feature/Http/Controllers/CalendarFeedTest.php b/tests/Feature/Http/Controllers/CalendarFeedTest.php index 42b790ed..1052552f 100644 --- a/tests/Feature/Http/Controllers/CalendarFeedTest.php +++ b/tests/Feature/Http/Controllers/CalendarFeedTest.php @@ -226,12 +226,11 @@ public function test_older_events_never_show_up_on_calendar_feed(): void $event = Event::factory()->create([ 'organization_id' => $organization->id, 'cancelled_at' => null, - 'active_at' => now()->subMinute(), - 'expire_at' => now()->subMinute(), + 'active_at' => now()->subWeek()->subMinute(), + 'expire_at' => now()->subWeek(), ]); $first_response = $this->get(route('calendar-feed.show', ['orgs' => $organization->id])); - preg_match('/UID:(.+)/', $first_response->getContent(), $first_match); $this->assertFalse(isset($first_match[1])); diff --git a/tests/Feature/Http/Controllers/HomeControllerTest.php b/tests/Feature/Http/Controllers/HomeControllerTest.php index e14a9cda..7059371d 100644 --- a/tests/Feature/Http/Controllers/HomeControllerTest.php +++ b/tests/Feature/Http/Controllers/HomeControllerTest.php @@ -20,14 +20,17 @@ public function test_upcoming_events_sorts_unordered_events() Event::factory()->create([ 'event_name' => 'Event 2', 'active_at' => '2020-01-01 19:00:00', + 'expire_at' => '2020-01-02 21:00:00', ]); Event::factory()->create([ 'event_name' => 'Event 1', 'active_at' => '2020-01-01 18:00:00', + 'expire_at' => '2020-01-02 20:00:00', ]); Event::factory()->create([ 'event_name' => 'Event 3', 'active_at' => '2020-01-02 12:00:00', + 'expire_at' => '2020-01-02 14:00:00', ]); $response = $this->get(route('home')); @@ -40,7 +43,8 @@ public function test_upcoming_events_does_not_show_old_events() { Event::factory()->create([ 'event_name' => 'Event 1', - 'active_at' => '2019-12-31 23:59:59', + 'active_at' => '2019-12-31 22:00:00', + 'expire_at' => '2019-12-31 23:00:00', ]); $response = $this->get(route('home')); diff --git a/tests/Feature/NoIndexNonProductionTest.php b/tests/Feature/NoIndexNonProductionTest.php index c51e191c..afcbc98e 100644 --- a/tests/Feature/NoIndexNonProductionTest.php +++ b/tests/Feature/NoIndexNonProductionTest.php @@ -8,8 +8,7 @@ class NoIndexNonProductionTest extends TestCase { public function test_robots_txt_disallows_all_in_non_production(): void { - $this->assertEquals('testing', app()->environment()); - + $this->assertContains(app()->environment(), ['testing', 'local']); $response = $this->get('/robots.txt'); $response->assertOk(); From 4e4b808f50ca19c473392d9a5a38c0ef477e4fc4 Mon Sep 17 00:00:00 2001 From: Jim Ciallella <1777776+allella@users.noreply.github.com> Date: Mon, 25 May 2026 01:17:00 -0400 Subject: [PATCH 5/5] Change the test_robots_txt_disallows_all_in_non_production test to check that the environment is not production instead of checking against a hardcoded list of non-production, since those could always change --- tests/Feature/NoIndexNonProductionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/NoIndexNonProductionTest.php b/tests/Feature/NoIndexNonProductionTest.php index afcbc98e..7b5a14c5 100644 --- a/tests/Feature/NoIndexNonProductionTest.php +++ b/tests/Feature/NoIndexNonProductionTest.php @@ -8,7 +8,7 @@ class NoIndexNonProductionTest extends TestCase { public function test_robots_txt_disallows_all_in_non_production(): void { - $this->assertContains(app()->environment(), ['testing', 'local']); + $this->assertFalse(app()->isProduction()); $response = $this->get('/robots.txt'); $response->assertOk();