From 52fb47c8544fd4055195e1ad4dbdbea8b4710b8c Mon Sep 17 00:00:00 2001 From: roble Date: Wed, 4 Nov 2026 10:10:56 +0000 Subject: [PATCH 1/3] fix: update toast visibility checks for voting feedback in roadmap tests --- tests/e2e/tests/roadmap.spec.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/e2e/tests/roadmap.spec.ts b/tests/e2e/tests/roadmap.spec.ts index a7267e4..6da3b4b 100644 --- a/tests/e2e/tests/roadmap.spec.ts +++ b/tests/e2e/tests/roadmap.spec.ts @@ -178,18 +178,19 @@ test.describe('Roadmap', () => { await expect(panel.getByTestId(`vote-count-${item.id}`)).toHaveText( '1', ); - await expect(page.locator('[data-sonner-toast]')).toContainText( - 'Upvoted!', - ); + // Toasts stack (sign-in, then each vote): look a toast up by its text. + await expect( + page.locator('[data-sonner-toast]', { hasText: 'Upvoted!' }), + ).toBeVisible(); await expect(panel).toBeVisible(); await expect(page).toHaveURL(new RegExp(`/roadmap/${item.slug}$`)); const card = page.getByTestId(`roadmap-item-${item.id}`); await expect(card.getByTestId(`vote-count-${item.id}`)).toHaveText('1'); await panel.getByTestId(`vote-btn-${item.id}`).click(); - await expect(page.locator('[data-sonner-toast]').last()).toContainText( - 'Vote removed', - ); + await expect( + page.locator('[data-sonner-toast]', { hasText: 'Vote removed' }), + ).toBeVisible(); await expect(panel).toBeVisible(); await expect(page).toHaveURL(new RegExp(`/roadmap/${item.slug}$`)); await expect(panel.getByTestId(`vote-count-${item.id}`)).toHaveText( From 9723a5c43f90a374f3b33622ab3869f317d6cb05 Mon Sep 17 00:00:00 2001 From: roble Date: Fri, 6 Nov 2026 19:57:10 +0000 Subject: [PATCH 2/3] feat: suggestions to review on the admin dashboard (sc-1113) Co-Authored-By: Claude Opus 5.5 --- .../saucebase-roadmap-development/SKILL.md | 2 +- .../Widgets/RoadmapAttentionWidget.php | 45 +++++++++++++++++++ tests/Feature/RoadmapAttentionWidgetTest.php | 45 +++++++++++++++++++ 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 src/Filament/Widgets/RoadmapAttentionWidget.php create mode 100644 tests/Feature/RoadmapAttentionWidgetTest.php diff --git a/resources/boost/skills/saucebase-roadmap-development/SKILL.md b/resources/boost/skills/saucebase-roadmap-development/SKILL.md index dec165b..d87bd61 100644 --- a/resources/boost/skills/saucebase-roadmap-development/SKILL.md +++ b/resources/boost/skills/saucebase-roadmap-development/SKILL.md @@ -9,7 +9,7 @@ Paths are relative to `modules/roadmap/` unless they say otherwise. Commands run ## Overview -Public roadmap board with feature requests, upvotes, comments, team replies, and duplicate merging. Filament admin at `/admin` → Roadmap. +Public roadmap board with feature requests, upvotes, comments, team replies, and duplicate merging. Filament admin at `/admin` → Roadmap. `Filament\Widgets\RoadmapAttentionWidget` puts "Suggestions to review" (status Under Review) on the dashboard, sort 21, only while there are any. --- diff --git a/src/Filament/Widgets/RoadmapAttentionWidget.php b/src/Filament/Widgets/RoadmapAttentionWidget.php new file mode 100644 index 0000000..ab13797 --- /dev/null +++ b/src/Filament/Widgets/RoadmapAttentionWidget.php @@ -0,0 +1,45 @@ +user()?->can('manage roadmap') ?? false) && self::underReview() > 0; + } + + protected function getStats(): array + { + return [ + Stat::make(__('Suggestions to review'), self::underReview()) + ->description(__('Waiting for a status')) + ->descriptionIcon('heroicon-m-light-bulb') + ->color('warning') + ->url(RoadmapItemResource::getUrl('index')), + ]; + } + + private static function underReview(): int + { + return RoadmapItem::where('status', RoadmapStatus::UnderReview)->count(); + } +} diff --git a/tests/Feature/RoadmapAttentionWidgetTest.php b/tests/Feature/RoadmapAttentionWidgetTest.php new file mode 100644 index 0000000..eb5af99 --- /dev/null +++ b/tests/Feature/RoadmapAttentionWidgetTest.php @@ -0,0 +1,45 @@ +actingAs(User::factory()->create()->givePermissionTo('manage roadmap')); + } + + /** Attention band (20–29): roadmap is 21, after billing. */ + public function test_shown_only_with_suggestions_to_review(): void + { + $this->assertSame(21, RoadmapAttentionWidget::getSort()); + RoadmapItem::factory()->create(['status' => RoadmapStatus::Planned]); + $this->assertFalse(RoadmapAttentionWidget::canView()); + + RoadmapItem::factory()->count(2)->create(['status' => RoadmapStatus::UnderReview]); + $this->assertTrue(RoadmapAttentionWidget::canView()); + Livewire::test(RoadmapAttentionWidget::class)->assertSee(['Suggestions to review', '2']); + } + + public function test_needs_the_roadmap_permission(): void + { + RoadmapItem::factory()->create(['status' => RoadmapStatus::UnderReview]); + $this->actingAs(User::factory()->create()); + + $this->assertFalse(RoadmapAttentionWidget::canView()); + } +} From 36b25968b7c80679a938371f99db05473943d017 Mon Sep 17 00:00:00 2001 From: roble Date: Fri, 6 Nov 2026 20:49:43 +0000 Subject: [PATCH 3/3] docs: name the attention widget by its full class Co-Authored-By: Claude Opus 5.5 --- resources/boost/skills/saucebase-roadmap-development/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/boost/skills/saucebase-roadmap-development/SKILL.md b/resources/boost/skills/saucebase-roadmap-development/SKILL.md index d87bd61..8c22acc 100644 --- a/resources/boost/skills/saucebase-roadmap-development/SKILL.md +++ b/resources/boost/skills/saucebase-roadmap-development/SKILL.md @@ -9,7 +9,7 @@ Paths are relative to `modules/roadmap/` unless they say otherwise. Commands run ## Overview -Public roadmap board with feature requests, upvotes, comments, team replies, and duplicate merging. Filament admin at `/admin` → Roadmap. `Filament\Widgets\RoadmapAttentionWidget` puts "Suggestions to review" (status Under Review) on the dashboard, sort 21, only while there are any. +Public roadmap board with feature requests, upvotes, comments, team replies, and duplicate merging. Filament admin at `/admin` → Roadmap. `Modules\Roadmap\Filament\Widgets\RoadmapAttentionWidget` puts "Suggestions to review" (status Under Review) on the dashboard, sort 21, only while there are any. ---