Skip to content

Expand PlanCollaborator roles: add approver and highlighted#98

Merged
HamptonMakes merged 1 commit intomainfrom
hampton/phase2-collaborator-roles
Apr 28, 2026
Merged

Expand PlanCollaborator roles: add approver and highlighted#98
HamptonMakes merged 1 commit intomainfrom
hampton/phase2-collaborator-roles

Conversation

@HamptonMakes
Copy link
Copy Markdown
Collaborator

Phase 2 Item 6: Collaborator Roles Expansion

Adds approver and highlighted roles to PlanCollaborator::ROLES, laying the groundwork for reviewer assignment UI (item 7) and homepage queue (item 10).

Changes

  • Model: New roles in ROLES constant, scopes (.authors, .reviewers, .approvers, .highlighted), approve!/approved? helpers, highlighted_reason presence validation, before_validation callback to clear stale role-specific data on role change
  • Migration: approved_at (datetime) and highlighted_reason (text) columns on coplan_plan_collaborators
  • API: collaborator_json conditionally includes approved_at for approvers and highlighted_reason for highlighted collaborators
  • Factory: :approver and :highlighted traits
  • Specs: 13 examples covering all roles, validations, scopes, approval flow, and data cleanup

Notification behavior

Only authors get new_comment notifications (unchanged). Approvers/reviewers are notified only when they're direct thread participants.

Phase 2 Item 6: Collaborator Roles Expansion

- Add 'approver' and 'highlighted' to PlanCollaborator::ROLES
- Migration: add approved_at (datetime) and highlighted_reason (text) columns
- Model: scopes (.authors, .reviewers, .approvers, .highlighted),
  approve!/approved? helpers, highlighted_reason validation,
  before_validation callback to clear stale role-specific data on role change
- API: collaborator_json conditionally includes approved_at and highlighted_reason
- Factory: add :approver and :highlighted traits
- Spec: 13 examples covering roles, validations, scopes, approval flow, cleanup

Amp-Thread-ID: https://ampcode.com/threads/T-019db6dc-e2ac-72de-a66f-e7f513adadf9
Co-authored-by: Amp <amp@ampcode.com>
@HamptonMakes HamptonMakes merged commit 9260e51 into main Apr 28, 2026
5 checks passed
@HamptonMakes HamptonMakes deleted the hampton/phase2-collaborator-roles branch April 28, 2026 16:30
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.

1 participant