feat: Show actor on pinned/status change events (gt-1ydd9)
- Add Actor field to MutationEvent struct - Use new assignee from update args instead of old issue state - Include actor (who performed the action) in mutation events - Display actor in bd activity output, falling back to assignee When pinning/updating status, the activity feed now shows who performed the action (e.g., "@gastown/crew/jack") instead of showing nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,7 @@ type MutationEvent struct {
|
||||
IssueID string // e.g., "bd-42"
|
||||
Title string // Issue title for display context (may be empty for some operations)
|
||||
Assignee string // Issue assignee for display context (may be empty)
|
||||
Actor string // Who performed the action (may differ from assignee)
|
||||
Timestamp time.Time
|
||||
// Optional metadata for richer events (used by status, bonded, etc.)
|
||||
OldStatus string `json:"old_status,omitempty"` // Previous status (for status events)
|
||||
|
||||
@@ -613,18 +613,31 @@ func (s *Server) handleUpdate(req *Request) Response {
|
||||
|
||||
// Emit mutation event for event-driven daemon (only if any updates or label/parent operations were performed)
|
||||
if len(updates) > 0 || len(updateArgs.SetLabels) > 0 || len(updateArgs.AddLabels) > 0 || len(updateArgs.RemoveLabels) > 0 || updateArgs.Parent != nil {
|
||||
// Determine effective assignee: use new assignee from update if provided, otherwise use existing
|
||||
effectiveAssignee := issue.Assignee
|
||||
if updateArgs.Assignee != nil && *updateArgs.Assignee != "" {
|
||||
effectiveAssignee = *updateArgs.Assignee
|
||||
}
|
||||
|
||||
// Check if this was a status change - emit rich MutationStatus event
|
||||
if updateArgs.Status != nil && *updateArgs.Status != string(issue.Status) {
|
||||
s.emitRichMutation(MutationEvent{
|
||||
Type: MutationStatus,
|
||||
IssueID: updateArgs.ID,
|
||||
Title: issue.Title,
|
||||
Assignee: issue.Assignee,
|
||||
Assignee: effectiveAssignee,
|
||||
Actor: actor,
|
||||
OldStatus: string(issue.Status),
|
||||
NewStatus: *updateArgs.Status,
|
||||
})
|
||||
} else {
|
||||
s.emitMutation(MutationUpdate, updateArgs.ID, issue.Title, issue.Assignee)
|
||||
s.emitRichMutation(MutationEvent{
|
||||
Type: MutationUpdate,
|
||||
IssueID: updateArgs.ID,
|
||||
Title: issue.Title,
|
||||
Assignee: effectiveAssignee,
|
||||
Actor: actor,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user