feat: ama close submissions - #317
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAMA sessions now support reversible closure of question submissions. Closed sessions remain editable and support moderation, answering, configuration, and export workflows. The dashboard lists all sessions by default, while the bot uses ChangesAMA closure and reopening
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Manager
participant AMADetails
participant AMAAPI
participant AMAState
Manager->>AMADetails: Confirm close or reopen
AMADetails->>AMAAPI: Update ended state
AMAAPI->>AMAState: Save session state
AMAAPI-->>AMADetails: Return update result
AMADetails-->>Manager: Show status and feedback
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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: 1
🤖 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 `@services/ama-bot/src/components/submitQuestion.ts`:
- Around line 35-37: Update handleModalCollected to re-read the AMA session from
ama_sessions and enforce ended = false in the database insert condition before
creating a question. If the guarded insert affects no rows because submissions
were closed, edit the deferred reply with the existing closed-submissions
message and do not proceed as a successful submission.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 11affd12-8573-45e8-a8d9-324e5f879379
📒 Files selected for processing (18)
apps/website/src/app/dashboard/[id]/ama/amas/[amaId]/_components/AMADetails.tsxapps/website/src/app/dashboard/[id]/ama/amas/_components/AMASessionCard.tsxapps/website/src/app/dashboard/[id]/ama/amas/_components/AMASessionsList.tsxapps/website/src/app/dashboard/[id]/ama/amas/_components/IncludeEndedToggle.tsxapps/website/src/app/dashboard/[id]/ama/amas/_components/OpenOnlyToggle.tsxapps/website/src/app/dashboard/[id]/ama/amas/new/_components/CreateAMAForm.tsxapps/website/src/app/dashboard/[id]/ama/amas/page.tsxapps/website/src/hooks/useURLParam.tsdocs/roadmap/01-architecture.mdservices/ama-bot/src/commands/ama.tsservices/ama-bot/src/components/amaCloseSelect.tsservices/ama-bot/src/components/amaRepostSelect.tsservices/ama-bot/src/components/modApprove.tsservices/ama-bot/src/components/modDeny.tsservices/ama-bot/src/components/submitQuestion.tsservices/ama-bot/src/lib/scheduledCloseSweep.tsservices/api/src/routes/ama/schemas.tsservices/api/src/routes/ama/updateAMA.ts
💤 Files with no reviewable changes (1)
- apps/website/src/app/dashboard/[id]/ama/amas/_components/IncludeEndedToggle.tsx
Closes #299