-
Notifications
You must be signed in to change notification settings - Fork 0
Add owner badge to highlight machine owners in issue details #767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: timothyfroehlich <[email protected]>
…ock.json from gitignore Co-authored-by: timothyfroehlich <[email protected]>
|
@copilot merge conflicts |
There was a problem hiding this 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
OwnerBadgecomponent 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]>
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, supportssmanddefaultsizesisUserMachineOwner()/getMachineOwnerName()- Utility functions for ownership checks (handles both registered and invited owners)UI Placement (3 locations)
Query & Type Updates
machine.ownerandmachine.invitedOwnerrelationsIssueWithAllRelationstype to include nested owner fieldsauthor.idto timeline events for ownership comparisonImplementation
The badge uses
Crownicon from Lucide and shadcn/uiBadgeprimitive with uppercase "OWNER" label.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.