feat: add contacted gig status reminders#387
Conversation
Bugbot couldn't run - usage limit reachedBugbot 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) |
📝 WalkthroughWalkthroughAdds a ChangesContacted status and configuration
Status-aware reminder engine
Discord status reminders
Dashboard contacted-state UI
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 winPreserve
CONTACTEDacross Discord thread archival. Discord forum posts can auto-archive; archival must not silently persistOUTDATEDfor an explicitly contacted gig.
apps/discord_bot/src/five08/discord_bot/cogs/jobs.py#L2379-L2385: removeEngagementStatus.CONTACTEDfrom the statuses converted toOUTDATED.apps/discord_bot/src/five08/discord_bot/cogs/jobs.py#L2948-L2955: do not callupdate_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_daysis fetched but never consumed.The response type adds
contacted_reminder_days, and the backend now returns it (perapps/api/src/five08/backend/api.py'sdashboard_notifications_handler), butloadNotificationsonly storesstale_daysintostaleRecruitingDays; the new field is dropped. As a result, the gig list/detail "Nd stale" badge computation (which only evaluatesstatus === "recruiting"againststaleRecruitingDays) has no equivalent path for contacted gigs, so contacted gigs never show an aging indicator outside the notification drawer.Consider storing
contacted_reminder_daysin state and extending the staleness helper (and itsstaleDaysprop wiring intoGigListItem/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
📒 Files selected for processing (18)
.env.exampleapps/admin_dashboard/src/main.tsxapps/api/src/five08/backend/api.pyapps/api/src/five08/backend/static/dashboard/.vite/manifest.jsonapps/api/src/five08/backend/static/dashboard/assets/index-Brz9t9lI.jsapps/api/src/five08/backend/static/dashboard/index.htmlapps/discord_bot/src/five08/discord_bot/cogs/jobs.pyapps/worker/src/five08/worker/migrations/versions/20260711_0100_add_contacted_engagement_status.pydocs/configuration.mddocs/discord-gig-dashboard.mdpackages/shared/src/five08/engagements.pypackages/shared/src/five08/runtime_config.pypackages/shared/src/five08/settings.pytests/integration/test_dashboard_playwright.pytests/unit/test_backend_api.pytests/unit/test_engagements.pytests/unit/test_jobs.pytests/unit/test_runtime_config.py
Bugbot couldn't run - usage limit reachedBugbot 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) |
|
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: |
Summary
CONTACTEDas a first-class gig status across the database, API, dashboard, and Discord status command.GIG_CONTACTED_REMINDER_DAYSruntime setting (default5) and a migration that safely generalizes the reminder timestamp.Migration
Apply
20260711_0100_add_contacted_engagement_status. It renameslast_recruiting_reminder_attolast_status_reminder_atand expands the engagements status constraint.Verification
./scripts/test.sh./scripts/lint.shpassedbun run typecheckpassedReview
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 surfacescontacted_reminder_daysfrom/dashboard/api/notifications, wired through to gig list, detail, and summary metrics.The dashboard now treats
contactedas an active gig status alongsiderecruiting. Stale/needs-update logic is generalized viastaleGigAge: recruiting still uses latest activity; contacted uses time sincelast_status_changed_at. The summary metric label changes from Stale recruiting to Needs update, andcontacted_gignotifications 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
Documentation