Skip to content

Sponsor CRM: Add user notes/comments to activity timeline #323

@Starefossen

Description

@Starefossen

Summary

Allow organizers to add freeform notes/comments directly to a sponsor's activity timeline, replacing the current static notes text field on the sponsorForConference document.

Problem

The current notes field on sponsorForConference is a single freeform textarea that gets overwritten with each edit. There's no history of what was noted, when, or by whom. Meanwhile, the activity timeline already supports a note activity type (sponsorActivity document with activity_type: 'note'), but there's no UI to create one manually.

Proposed Changes

1. Add "Add Note" UI to the activity timeline

  • Add an input/textarea at the top of the Activity History tab (or an inline compose area) that lets organizers type a note and submit it.
  • The note should be saved as a sponsorActivity document with activity_type: 'note', linked to the current sponsorForConference record.
  • The created_by should be set to the current authenticated organizer.
  • Notes should appear in the timeline alongside other activity events (status changes, emails, etc.).

2. Remove the static notes field

  • Remove the notes field from the sponsorForConference Sanity schema.
  • Remove the corresponding <textarea> from SponsorCRMForm.tsx.
  • Create a migration to convert any existing notes content into a sponsorActivity document of type note (to preserve historical data).
  • Update the SponsorForConference and SponsorForConferenceExpanded TypeScript types.

3. Consider supporting call and meeting activity types

The Sanity schema already defines call and meeting as activity types. The "Add Note" UI could optionally allow selecting the activity type (note, call, meeting) to log different kinds of interactions.

Files to modify

  • sanity/schemaTypes/sponsorForConference.ts — remove notes field
  • src/lib/sponsor-crm/types.ts — remove notes from types
  • src/lib/sponsor-crm/activity.ts — add logNote() helper
  • src/components/admin/sponsor-crm/SponsorCRMForm.tsx — remove notes textarea
  • src/components/admin/sponsor/SponsorActivityTimeline.tsx — add note compose UI
  • src/server/routers/sponsor.ts — add tRPC mutation for creating notes
  • Migration script for existing notes data

Additional context

  • The sponsorActivity schema already supports the note activity type, description field, and created_by reference — the data model is ready.
  • contract_status_change exists in the TypeScript ActivityType union but is missing from the Sanity schema's options list — this should be fixed as part of this work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions