Skip to content

Push notifications: finalize client implementation and document server requirements#40

Open
Copilot wants to merge 10 commits intomainfrom
copilot/enable-push-notifications
Open

Push notifications: finalize client implementation and document server requirements#40
Copilot wants to merge 10 commits intomainfrom
copilot/enable-push-notifications

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Client-side push notification implementation had incomplete server integration points, debugging logs in production, and missing testing capability. Server requirements were undocumented.

Changes

Client Polish

  • Icon positioning: Bell icon moved to last position in platforms list
  • Dev-only logging: Wrapped all console statements in isDev checks (client uses import.meta.env.DEV, service worker checks hostname)
  • Test hotkey: Ctrl+Shift+P / Cmd+Shift+P triggers test notification with realistic episode content and artwork
  • Image verification: Confirmed all notification image paths (/android-chrome-192x192.png, /favicon-32x32.png, /android-chrome-384x384.png) exist

Server Integration (TODOs → Implementation)

Replaced placeholder TODOs with environment variable support and API integration:

// VAPID key from env or fallback
const vapidKey = import.meta.env.PUBLIC_VAPID_KEY || 
  'BEl62iUYgUivxIkv69yViEuiBIa-Ib37J8xQmrPcBKKk6qzqsXBBEDdHDz_D8LViZvZOGSIcjKPi0xhS3IkmJnw';

// API integration with graceful fallback
if (import.meta.env.PUBLIC_API_URL) {
  await fetch(`${import.meta.env.PUBLIC_API_URL}/api/subscribe`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(subscription)
  });
}

Environment variables: PUBLIC_VAPID_KEY, VAPID_PRIVATE_KEY, PUBLIC_API_URL

Documentation (PUSH_NOTIFICATIONS.md)

  • 12 notification opportunities: Episode pre-announcements, highlights/quotes, guest announcements, live recordings, milestones, personalization, time optimization, interactive actions, promotions, recommendations, engagement polls
  • Server implementation guide: VAPID key generation, database schemas (SQL), API endpoint specs, RSS monitor, notification sender with web-push, error handling, rate limiting
  • Code examples: Complete Node.js implementation patterns
  • Production checklist: Security considerations, performance optimization (batching, queuing), compliance requirements

Environment Configuration

PUBLIC_VAPID_KEY=your-public-key      # Generate: npx web-push generate-vapid-keys
VAPID_PRIVATE_KEY=your-private-key
PUBLIC_API_URL=https://api.example.com
Original prompt

Enable push notifications for when new episodes are published, using native html push notifications. Put a stateful bell icon button at the bottom left of the main sidebar, if the browser supports it, when pressed and not active, go through the user flow to enable push notifications on that device. If enabled and pushed, verify with the user they want to disable push notifications and then remove them and reset the button. Create a minimal solution that uses astro in all the best ways for this use case.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
starpod Error Error Feb 9, 2026 6:56am

Request Review

Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
…worker URL construction

Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
Copilot AI changed the title [WIP] Add push notifications for new episodes with bell icon Add native push notification support for new episodes Feb 8, 2026
Copilot AI requested a review from argyleink February 8, 2026 16:38
- Send welcome notification when user subscribes with brand logo
- Enhance service worker to support episode art and detailed info
- Move bell icon from standalone to first position in platforms list
- Remove padding to match platform icon styling

Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
…y undefined

- Use show title prop instead of hardcoded podcast name
- Remove unnecessary 'image: undefined' from defaults
- Pass show title from Platforms component to button

Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
- Document welcome notification feature
- Describe episode artwork support
- Update bell icon location description
- Add example notification payload
- Clarify production integration

Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
Copilot AI changed the title Add native push notification support for new episodes Add welcome notification and relocate bell to platform icons Feb 8, 2026
@argyleink argyleink marked this pull request as ready for review February 8, 2026 21:00
- Create new bell.svg with simpler, cleaner design
- Switch from inline SVG to mask-image technique
- Apply gradient-icon class for consistent colors with other platform icons
- Use opacity to differentiate subscribed/unsubscribed states
- Maintain hover effects consistent with other icons

Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
Copilot AI changed the title Add welcome notification and relocate bell to platform icons Replace bell icon with cleaner SVG and fix color mismatch Feb 8, 2026
- Move bell icon to last position in platforms list
- Remove console logs except in dev mode (both client and service worker)
- Add keyboard hotkey (Ctrl+Shift+P) for test notifications
- Complete all TODOs with environment variable support
- Add comprehensive PUSH_NOTIFICATIONS.md documentation
- Verify all image paths are valid
- Document 12 push notification opportunities
- List all remaining server-side tasks

Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com>
Copilot AI changed the title Replace bell icon with cleaner SVG and fix color mismatch Push notifications: finalize client implementation and document server requirements Feb 9, 2026
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