Talent Activity System
Overview
The talent activity system provides an audit trail of all talent lifecycle events. Activities are logged automatically via backend domain events and can also be created manually (e.g., recruiter notes).
Activity Types (22)
| Type | Category | Description |
|---|---|---|
| TALENT_CREATED | Talent | New talent profile created |
| TALENT_UPDATED | Talent | Profile fields modified |
| TALENT_DELETED | Talent | Talent removed |
| TALENT_VIEWED | Talent | Profile viewed by a user |
| CV_UPLOADED | CV | CV file uploaded |
| CV_UPDATED | CV | CV replaced or edited |
| CV_DELETED | CV | CV removed |
| CV_PARSED | CV | AI parsing completed |
| ADDED_TO_POOL | Pool | Talent added to a pool |
| REMOVED_FROM_POOL | Pool | Talent removed from a pool |
| POOL_CHANGED | Pool | Talent moved between pools |
| TALENT_SHARED | Sharing | Shared with user or company |
| TALENT_SHARE_REVOKED | Sharing | Share access revoked |
| CANDIDATE_CREATED | Candidate | Added as job candidate |
| CANDIDATE_STATUS_CHANGED | Candidate | Candidate status updated |
| CANDIDATE_STAGE_CHANGED | Candidate | Moved to different pipeline stage |
| NOTE_ADDED | Manual | Recruiter note added |
| SKILL_ADDED | Skill | Skill added to talent |
| SKILL_REMOVED | Skill | Skill removed from talent |
| EXTERNAL_SHARE_CREATED | Sharing | External share link generated |
| EXTERNAL_SHARE_ACCESSED | Sharing | External share link viewed |
| HIGH_MATCH_DETECTED | Matching | High job match score detected |
Frontend Architecture
Files
| File | Purpose |
|---|---|
graphql/operations/schema/talent/fragments.ts | TALENT_ACTIVITY_FIELDS fragment |
graphql/operations/talents/queries.ts | GET_TALENT_ACTIVITY_HISTORY query |
graphql/operations/talents/mutations.ts | CREATE_TALENT_ACTIVITY, DELETE_TALENT_ACTIVITY mutations |
lib/types/talent.ts | TalentActivity, TalentActivityType, TalentActivityHistory, CreateTalentActivityInput types |
app/company/resume/talents/_components/TalentActivityTab.tsx | Main UI component |
Component: TalentActivityTab
Props: { talentId: string }
Features:
- Timeline view with date grouping (Today, Yesterday, specific dates)
- 22 color-coded activity type indicators with icons
- Client-side multi-select filter by activity type
- Manual note creation via modal (NOTE_ADDED type)
- Activity deletion with confirmation dialog (NOTE_ADDED only)
- "Load More" pagination (20 items per page, offset-based)
- Empty state for talents with no activities
Data Flow:
useQuery(GET_TALENT_ACTIVITY_HISTORY)fetches paginated activities- Client-side filter applied via
selectedActivityTypesstate - Activities grouped by date using
groupActivitiesByDate() fetchMore()loads additional pages, merged into existing listCREATE_TALENT_ACTIVITYmutation refetches first page on successDELETE_TALENT_ACTIVITYmutation updates Apollo cache directly
GraphQL Operations
Query - talentActivityHistory:
query GetTalentActivityHistory($talentId: ID!, $skip: Int, $take: Int) {
talentActivityHistory(talentId: $talentId, pagination: { skip: $skip, take: $take }) {
activities { ...TalentActivityFields }
totalCount
hasMore
}
}
Mutation - createTalentActivity:
mutation CreateTalentActivity($input: CreateTalentActivityInput!) {
createTalentActivity(input: $input) { ...TalentActivityFields }
}
Mutation - deleteTalentActivity:
mutation DeleteTalentActivity($id: ID!) {
deleteTalentActivity(id: $id)
}
Activity Type Color/Icon Mapping
Each activity type has a background color, icon color, and icon component:
- Green: Created, Added, Applied (UserIcon, PlusIcon, BriefcaseIcon)
- Blue: Updated, Changed (EditIcon, StatusIcon)
- Red: Deleted (TrashIcon)
- Purple: CV operations, Stage changes (UploadIcon, EditIcon, FlowIcon)
- Orange: Removed, Revoked (MinusIcon, BlockIcon)
- Yellow: Notes (NoteIcon)
- Teal: Skills (PlusIcon, MinusIcon)
- Emerald: High match (StarIcon)
- Cyan: Shared (ShareIcon)
- Pink: External share (LinkIcon)
Design Decisions
- Primary query: Uses
talentActivityHistory(simpler, talent-scoped) instead oftalentActivities(company-scoped with filters) - Filtering: Client-side for instant response (22 types is small enough)
- Pagination: "Load More" pattern suits chronological timeline UX better than page-based navigation
- Manual creation: Only NOTE_ADDED type supported (other types are system-generated)
- Delete scope: Only NOTE_ADDED activities are deletable (system events are immutable)