Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Users can now watch specific machines to receive notifications for all new issues created on those machines, complementing existing per-issue and global watch capabilities.

Implementation

Schema

  • Added machine_watchers junction table (machine_id, user_id) with cascade deletes and user_id index

Service & Actions

  • toggleMachineWatcher() in src/services/machines.ts follows existing issue watcher pattern
  • Server action toggleMachineWatcherAction() handles auth and revalidation

UI

  • WatchMachineButton component on machine detail page matches existing issue watch button styling
  • Displays watcher count with eye icon in sidebar

Notifications

  • Modified createNotification() to query machine watchers for new_issue events
  • Machine watchers receive both in-app and email notifications based on preferences

Example Usage

// Machine detail page now includes watchers in query
const machine = await db.query.machines.findFirst({
  where: eq(machines.initials, initials),
  with: {
    watchers: { columns: { userId: true } }
  }
});

const isWatching = machine.watchers.some(w => w.userId === user.id);

<WatchMachineButton 
  machineId={machine.id} 
  initialIsWatching={isWatching} 
/>

Machine watching operates independently from ownership notifications and global watch preferences. The notification system deduplicates recipients automatically.

Migration: drizzle/0003_real_wendell_rand.sql

Original prompt

This section details on the original issue you should resolve

<issue_title>Add ability for any person to watch all issues on any game</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ 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 Jan 20, 2026

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

Project Deployment Review Updated (UTC)
pin-point Ready Ready Preview, Comment Jan 20, 2026 2:36am

Copilot AI and others added 2 commits January 20, 2026 02:30
Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com>
Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com>
Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ability for any person to watch all issues on any game Add machine-level watching for issue notifications Jan 20, 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.

Add ability for any person to watch all issues on any game

2 participants