Skip to content

feat: add contacted gig status reminders#387

Merged
michaelmwu merged 2 commits into
mainfrom
michaelmwu/add-contacted-reminders
Jul 11, 2026
Merged

feat: add contacted gig status reminders#387
michaelmwu merged 2 commits into
mainfrom
michaelmwu/add-contacted-reminders

Conversation

@michaelmwu

@michaelmwu michaelmwu commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Add CONTACTED as a first-class gig status across the database, API, dashboard, and Discord status command.
  • Send dashboard and Discord follow-up reminders after a configurable five-day contacted interval, measured from the status transition rather than thread activity.
  • Add the GIG_CONTACTED_REMINDER_DAYS runtime setting (default 5) and a migration that safely generalizes the reminder timestamp.
  • Keep contacted gigs in the default dashboard list and make contacted notifications open the corresponding gig detail.

Migration

Apply 20260711_0100_add_contacted_engagement_status. It renames last_recruiting_reminder_at to last_status_reminder_at and expands the engagements status constraint.

Verification

  • ./scripts/test.sh
    • 1,922 passed, 20 skipped
    • 14 dashboard Vitest tests passed
    • Playwright covers opening a contacted reminder in the built dashboard bundle
  • ./scripts/lint.sh passed
  • bun run typecheck passed
  • Alembic upgrade-to-head SQL rendered successfully offline

Review

  • Independent maintainability, security/API/performance, migration, and frontend reviews completed.
  • The two discovered integration gaps, default list visibility and contacted notification navigation, were fixed and covered before this PR was opened.

Note

Low Risk
Dashboard and notifications API changes only in this diff slice; behavior is additive with configurable thresholds and no auth or data-model edits shown here.

Overview
Adds GIG_CONTACTED_REMINDER_DAYS (default 5) and surfaces contacted_reminder_days from /dashboard/api/notifications, wired through to gig list, detail, and summary metrics.

The dashboard now treats contacted as an active gig status alongside recruiting. Stale/needs-update logic is generalized via staleGigAge: recruiting still uses latest activity; contacted uses time since last_status_changed_at. The summary metric label changes from Stale recruiting to Needs update, and contacted_gig notifications open the gig detail or filter by contacted status (mirroring stale recruiting behavior).

Reviewed by Cursor Bugbot for commit edf498e. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added a new Contacted gig status across the dashboard and Discord workflows.
    • Added configurable reminders for gigs that have been contacted but need follow-up.
    • Dashboard notifications now identify contacted gigs and open the relevant gig or filtered list.
    • Active gig styling and status indicators now include both Recruiting and Contacted gigs.
  • Documentation

    • Documented the new status and contacted reminder configuration.

@cursor

cursor Bot commented Jul 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_bb191bfc-1742-4682-8b18-b107e3a96af7)

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a contacted gig status, configurable contacted reminders, shared status-aware notification and reminder APIs, Discord reminder handling, dashboard UI support, migration updates, documentation, and tests.

Changes

Contacted status and configuration

Layer / File(s) Summary
Status, configuration, and schema contracts
.env.example, packages/shared/src/five08/{settings.py,runtime_config.py,engagements.py}, apps/worker/.../migrations/*, docs/*, tests/unit/*
Adds the contacted status, validates GIG_CONTACTED_REMINDER_DAYS, updates engagement filtering and ordering, and expands the database constraint and documentation.

Status-aware reminder engine

Layer / File(s) Summary
Status-aware reminder engine
packages/shared/src/five08/engagements.py, apps/api/src/five08/backend/api.py, tests/unit/test_engagements.py, tests/unit/test_backend_api.py
Generalizes notification queries, reminder claiming, reminder event recording, watermark handling, and API responses for recruiting and contacted statuses.

Discord status reminders

Layer / File(s) Summary
Discord status commands and dispatch
apps/discord_bot/src/five08/discord_bot/cogs/jobs.py, tests/unit/test_jobs.py
Accepts contacted status commands, preserves contacted thread state, runs the generalized reminder loop, sends status-specific messages, and records success or failure.

Dashboard contacted-state UI

Layer / File(s) Summary
Dashboard notification and gig-state UI
apps/admin_dashboard/src/main.tsx, apps/api/src/five08/backend/static/dashboard/*, tests/integration/test_dashboard_playwright.py
Routes contacted notifications, adds contacted filtering, treats recruiting and contacted gigs as active, and updates the compiled dashboard asset references.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AdminDashboard
  participant DashboardAPI
  participant SharedEngagements
  participant DiscordBot
  AdminDashboard->>DashboardAPI: Request dashboard notifications
  DashboardAPI->>SharedEngagements: Query recruiting and contacted notifications
  SharedEngagements-->>DashboardAPI: Return status-aware notifications
  DashboardAPI-->>AdminDashboard: Return notifications and reminder settings
  DiscordBot->>SharedEngagements: Claim due status reminders
  SharedEngagements-->>DiscordBot: Return contacted or recruiting reminders
  DiscordBot->>SharedEngagements: Record sent or failed reminder
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding contacted gig status reminders.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch michaelmwu/add-contacted-reminders

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/discord_bot/src/five08/discord_bot/cogs/jobs.py (1)

2379-2385: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve CONTACTED across Discord thread archival. Discord forum posts can auto-archive; archival must not silently persist OUTDATED for an explicitly contacted gig.

  • apps/discord_bot/src/five08/discord_bot/cogs/jobs.py#L2379-L2385: remove EngagementStatus.CONTACTED from the statuses converted to OUTDATED.
  • apps/discord_bot/src/five08/discord_bot/cogs/jobs.py#L2948-L2955: do not call update_engagement_status(... OUTDATED) for a due contacted row merely because its thread is archived; add an archived-contacted regression test.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/discord_bot/src/five08/discord_bot/cogs/jobs.py` around lines 2379 -
2385, Preserve CONTACTED during archived-thread handling: in _thread_looks_done
status conversion, remove EngagementStatus.CONTACTED from the statuses mapped to
OUTDATED. In apps/discord_bot/src/five08/discord_bot/cogs/jobs.py lines
2948-2955, prevent update_engagement_status from setting a due contacted row to
OUTDATED solely because its thread is archived, and add a regression test
covering this case.
🧹 Nitpick comments (1)
apps/admin_dashboard/src/main.tsx (1)

284-288: 🎯 Functional Correctness | 🔵 Trivial

contacted_reminder_days is fetched but never consumed.

The response type adds contacted_reminder_days, and the backend now returns it (per apps/api/src/five08/backend/api.py's dashboard_notifications_handler), but loadNotifications only stores stale_days into staleRecruitingDays; the new field is dropped. As a result, the gig list/detail "Nd stale" badge computation (which only evaluates status === "recruiting" against staleRecruitingDays) has no equivalent path for contacted gigs, so contacted gigs never show an aging indicator outside the notification drawer.

Consider storing contacted_reminder_days in state and extending the staleness helper (and its staleDays prop wiring into GigListItem/GigDetailPage) to also flag stale contacted gigs.
[medium_effort_and_high_reward]

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/admin_dashboard/src/main.tsx` around lines 284 - 288, Update
loadNotifications and the related dashboard state to retain
contacted_reminder_days alongside stale_days. Extend the staleness helper and
staleDays prop wiring used by GigListItem and GigDetailPage so contacted gigs
are flagged using the stored contacted reminder threshold, while preserving the
existing recruiting-gig behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/discord-gig-dashboard.md`:
- Around line 105-107: Update the documentation for list_dashboard_engagements
to state that DUPLICATE gigs, alongside LOST and OUTDATED gigs, are hidden by
default, while preserving the existing steering/admin opt-in behavior.

In `@packages/shared/src/five08/engagements.py`:
- Around line 1219-1222: Use max_age_days directly as the notification cutoff in
the reminder query parameter setup near recruiting_days, contacted_days, and
max_age, rather than replacing it with max(recruiting_days, contacted_days,
max_age_days). Apply the same direct max_age_days cutoff in the Discord reminder
claiming path near lines 1309-1311 so both notification and claiming flows honor
the configured maximum reminder age.

---

Outside diff comments:
In `@apps/discord_bot/src/five08/discord_bot/cogs/jobs.py`:
- Around line 2379-2385: Preserve CONTACTED during archived-thread handling: in
_thread_looks_done status conversion, remove EngagementStatus.CONTACTED from the
statuses mapped to OUTDATED. In
apps/discord_bot/src/five08/discord_bot/cogs/jobs.py lines 2948-2955, prevent
update_engagement_status from setting a due contacted row to OUTDATED solely
because its thread is archived, and add a regression test covering this case.

---

Nitpick comments:
In `@apps/admin_dashboard/src/main.tsx`:
- Around line 284-288: Update loadNotifications and the related dashboard state
to retain contacted_reminder_days alongside stale_days. Extend the staleness
helper and staleDays prop wiring used by GigListItem and GigDetailPage so
contacted gigs are flagged using the stored contacted reminder threshold, while
preserving the existing recruiting-gig behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4fa37a4b-2bac-45f3-8688-e18404272988

📥 Commits

Reviewing files that changed from the base of the PR and between 9eb540f and 165964a.

📒 Files selected for processing (18)
  • .env.example
  • apps/admin_dashboard/src/main.tsx
  • apps/api/src/five08/backend/api.py
  • apps/api/src/five08/backend/static/dashboard/.vite/manifest.json
  • apps/api/src/five08/backend/static/dashboard/assets/index-Brz9t9lI.js
  • apps/api/src/five08/backend/static/dashboard/index.html
  • apps/discord_bot/src/five08/discord_bot/cogs/jobs.py
  • apps/worker/src/five08/worker/migrations/versions/20260711_0100_add_contacted_engagement_status.py
  • docs/configuration.md
  • docs/discord-gig-dashboard.md
  • packages/shared/src/five08/engagements.py
  • packages/shared/src/five08/runtime_config.py
  • packages/shared/src/five08/settings.py
  • tests/integration/test_dashboard_playwright.py
  • tests/unit/test_backend_api.py
  • tests/unit/test_engagements.py
  • tests/unit/test_jobs.py
  • tests/unit/test_runtime_config.py

Comment thread docs/discord-gig-dashboard.md Outdated
Comment thread packages/shared/src/five08/engagements.py
@cursor

cursor Bot commented Jul 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_f93f8c35-ad5d-4629-9203-b52f430cc240)

@michaelmwu

Copy link
Copy Markdown
Member Author

Addressed all CodeRabbit feedback in edf498e: archived/locked CONTACTED threads preserve their status; the dashboard flags contacted gigs by status age; reminder maximum-age caps are honored; and the default-history docs now include DUPLICATE. Local checks passed: ./scripts/test.sh, ./scripts/lint.sh, dashboard build/typecheck/test, and offline migration SQL rendering.

@michaelmwu
michaelmwu added this pull request to the merge queue Jul 11, 2026
Merged via the queue into main with commit 8951a74 Jul 11, 2026
13 checks passed
@michaelmwu
michaelmwu deleted the michaelmwu/add-contacted-reminders branch July 11, 2026 16:44
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