Skip to content

Prevent duplicate announcements and improve seeder consistency - #8

Merged
roble merged 4 commits into
mainfrom
dev
Apr 14, 2026
Merged

Prevent duplicate announcements and improve seeder consistency#8
roble merged 4 commits into
mainfrom
dev

Conversation

@roble

@roble roble commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces the Announcements module to the application, focusing on displaying a global announcement banner and updating the database seeder logic to prevent duplicate announcements. The main changes are grouped below:

Frontend Integration

  • Registered the AnnouncementBanner component globally at the top of the app using the new registerGlobalComponent utility in app.ts, ensuring the banner is available across all pages.
  • Added the AnnouncementBanner component to the root App.vue template so that announcements are always visible to users.

Backend/Data Seeding

  • Updated the AnnouncementsDatabaseSeeder so that it only creates the default announcement if none exist, preventing duplicate records on repeated seed runs.

Copilot AI review requested due to automatic review settings April 14, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces frontend wiring for an Announcements banner and adjusts the database seeder to avoid creating duplicate default announcements on repeated seed runs.

Changes:

  • Registers AnnouncementBanner globally during module setup via registerGlobalComponent.
  • Removes the prior App.vue patch mechanism intended to inject the banner into the root template.
  • Updates AnnouncementsDatabaseSeeder to only create the default announcement when the table is empty.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
resources/js/app.ts Registers the announcement banner globally during module setup.
patches/app-vue.patch Removes the patch that previously injected AnnouncementBanner into the host App.vue.
database/seeders/AnnouncementsDatabaseSeeder.php Prevents duplicate default announcements by creating only when no announcements exist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/js/app.ts
*/
export function setup() {
console.debug('Announcements module loaded');
registerGlobalComponent('top', AnnouncementBanner);

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description mentions adding to the root App.vue template, but this PR removes the App.vue patch and only registers the component via registerGlobalComponent('top', ...). Unless the host app actually renders the registered top slot/region, the banner may no longer appear. Please either (a) update the PR description to match the new integration approach, or (b) ensure there is a concrete render point in the host/root layout for this global component registration path.

Copilot uses AI. Check for mistakes.
Comment thread database/seeders/AnnouncementsDatabaseSeeder.php
@roble
roble merged commit 34209b1 into main Apr 14, 2026
5 of 6 checks passed
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.

2 participants