Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

Machine owners were not visually distinguished in issue details, making it unclear who owns the machine when viewing issues, comments, and activity.

Changes

New Components

  • OwnerBadge - Reusable badge component with crown icon, secondary variant, supports sm and default sizes
  • isUserMachineOwner() / getMachineOwnerName() - Utility functions for ownership checks (handles both registered and invited owners)

UI Placement (3 locations)

  • Issue header: Shows owner name next to machine name
  • Sidebar reporter field: Badge when reporter owns the machine
  • Timeline events: Badge next to comment authors who own the machine

Query & Type Updates

  • Extended issue query to include machine.owner and machine.invitedOwner relations
  • Updated IssueWithAllRelations type to include nested owner fields
  • Added author.id to timeline events for ownership comparison

Implementation

// Badge appears inline with user names
<span>{userName}</span>
{isUserMachineOwner(issue, userId) && <OwnerBadge size="sm" />}

// Header shows owner prominently
{ownerName && (
  <div>
    Owner: <span>{ownerName}</span>
    <OwnerBadge size="sm" />
  </div>
)}

The badge uses Crown icon from Lucide and shadcn/ui Badge primitive with uppercase "OWNER" label.

Original prompt

This section details on the original issue you should resolve

<issue_title>Highlight machine owner in issue details with badge</issue_title>
<issue_description>## Feature Request

When viewing issue details, it's not immediately clear who owns the machine. We should make the owner more prominent and add visual indication when the owner interacts with the issue.

Proposed Changes

  1. Owner Badge: Add a badge/label next to a user's name anywhere it appears in the issue context that says "Owner" when that user is the machine owner

    • In issue reporter field (if owner reported the issue)
    • In comments section (if owner comments)
    • In activity timeline (if owner performs actions)
  2. Visual Prominence: Consider highlighting the owner in the issue detail box

    • Show owner name prominently (e.g., in a dedicated "Machine Owner" field)
    • Or add owner badge to the machine name/link

Example UI

Issue timothyfroehlich/PinPoint#42: Left flipper weak

Machine: Judge Dredd (Owner: Ted Gaunt 👑)

Reported by: Chris Engberg
Severity: Major

Comments:
  Ted Gaunt [OWNER] - "Working on this, ordered new coils"
  Chris Engberg - "Thanks Ted```</issue_description>

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

<comments>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Jan 12, 2026
@vercel
Copy link

vercel bot commented Jan 12, 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 12, 2026 3:55am

Copilot AI and others added 2 commits January 12, 2026 02:57
Copilot AI changed the title [WIP] Add badge to highlight machine owner in issue details Add owner badge to highlight machine owners in issue details Jan 12, 2026
@timothyfroehlich timothyfroehlich marked this pull request as ready for review January 12, 2026 03:45
Copilot AI review requested due to automatic review settings January 12, 2026 03:45
@timothyfroehlich
Copy link
Owner

@copilot merge conflicts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds visual indication of machine owners throughout the issue details page by introducing a new OwnerBadge component and utility functions to identify ownership. The feature makes it immediately clear who owns the machine when viewing issues, comments, and activity timelines.

Changes:

  • Added OwnerBadge component with crown icon, using shadcn/ui Badge primitive and Material Design 3 styling
  • Created utility functions (isUserMachineOwner, getMachineOwnerName) with comprehensive unit test coverage
  • Extended database queries and types to include machine owner relations (registered and invited owners)

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/types/issue.ts Extended IssueWithAllRelations type to include machine owner and invitedOwner relations
src/lib/issues/owner.ts Added utility functions for owner identification and name retrieval
src/lib/issues/owner.test.ts Comprehensive unit tests covering all edge cases for owner utilities
src/components/issues/OwnerBadge.tsx New reusable Server Component displaying owner badge with crown icon
src/components/issues/OwnerBadge.test.tsx Component tests for badge rendering, sizing, and styling
src/components/issues/IssueTimeline.tsx Integrated owner badge in timeline events for comment authors and issue reporters
src/components/issues/IssueSidebar.tsx Added owner badge to reporter field when reporter owns the machine
src/app/(app)/m/[initials]/i/[issueNumber]/page.tsx Extended query to fetch owner relations and displayed owner name with badge in issue header

Co-authored-by: timothyfroehlich <[email protected]>
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.

Highlight machine owner in issue details with badge

2 participants