Skip to content

feat: ama close submissions - #317

Merged
didinele merged 1 commit into
mainfrom
feat/ama-close-submissions
Aug 8, 2026
Merged

feat: ama close submissions#317
didinele merged 1 commit into
mainfrom
feat/ama-close-submissions

Conversation

@didinele

@didinele didinele commented Aug 8, 2026

Copy link
Copy Markdown
Member

Closes #299

@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chatsift-website Ready Ready Preview Aug 8, 2026 3:54pm

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

AMA 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 /ama close.

Changes

AMA closure and reopening

Layer / File(s) Summary
Reversible AMA update contract
services/api/src/routes/ama/schemas.ts, services/api/src/routes/ama/updateAMA.ts
The API accepts ended: true and ended: false. Reopening clears expired scheduled close dates. Closed sessions remain editable.
Dashboard closure controls
apps/website/src/app/dashboard/[id]/ama/amas/[amaId]/_components/AMADetails.tsx, apps/website/src/app/dashboard/[id]/ama/amas/new/_components/CreateAMAForm.tsx
The dashboard adds confirmation, loading, error, success, close, and reopen handling. Management and prompt editing remain available after closure.
Open-only session filtering
apps/website/src/app/dashboard/[id]/ama/amas/_components/*, apps/website/src/app/dashboard/[id]/ama/amas/page.tsx, apps/website/src/hooks/useURLParam.ts
The list shows all sessions by default and supports the open_only filter. Status labels use “Open” and “Closed”.
Bot and scheduled-close behavior
services/ama-bot/src/commands/ama.ts, services/ama-bot/src/components/*, services/ama-bot/src/lib/scheduledCloseSweep.ts, docs/roadmap/01-architecture.md
The bot renames /ama end to /ama close. Closed sessions reject new questions but continue moderation and answering workflows. Scheduled closure terminology and documentation are updated.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% 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
Title check ✅ Passed The title clearly summarizes the main change: closing AMA question submissions.
Description check ✅ Passed The description references the linked issue that defines the AMA submission-closing changes.
Linked Issues check ✅ Passed The changes rename closing behavior, keep users on the dashboard, show all AMAs by default, and add an open-only filter [#299].
Out of Scope Changes check ✅ Passed The dashboard, API, bot, moderation, and documentation changes support the requested reversible closure behavior.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ama-close-submissions

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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2a6f653 and 83b7fb2.

📒 Files selected for processing (18)
  • apps/website/src/app/dashboard/[id]/ama/amas/[amaId]/_components/AMADetails.tsx
  • apps/website/src/app/dashboard/[id]/ama/amas/_components/AMASessionCard.tsx
  • apps/website/src/app/dashboard/[id]/ama/amas/_components/AMASessionsList.tsx
  • apps/website/src/app/dashboard/[id]/ama/amas/_components/IncludeEndedToggle.tsx
  • apps/website/src/app/dashboard/[id]/ama/amas/_components/OpenOnlyToggle.tsx
  • apps/website/src/app/dashboard/[id]/ama/amas/new/_components/CreateAMAForm.tsx
  • apps/website/src/app/dashboard/[id]/ama/amas/page.tsx
  • apps/website/src/hooks/useURLParam.ts
  • docs/roadmap/01-architecture.md
  • services/ama-bot/src/commands/ama.ts
  • services/ama-bot/src/components/amaCloseSelect.ts
  • services/ama-bot/src/components/amaRepostSelect.ts
  • services/ama-bot/src/components/modApprove.ts
  • services/ama-bot/src/components/modDeny.ts
  • services/ama-bot/src/components/submitQuestion.ts
  • services/ama-bot/src/lib/scheduledCloseSweep.ts
  • services/api/src/routes/ama/schemas.ts
  • services/api/src/routes/ama/updateAMA.ts
💤 Files with no reviewable changes (1)
  • apps/website/src/app/dashboard/[id]/ama/amas/_components/IncludeEndedToggle.tsx

Comment thread services/ama-bot/src/components/submitQuestion.ts
@didinele
didinele merged commit 11444f8 into main Aug 8, 2026
13 checks passed
@didinele
didinele deleted the feat/ama-close-submissions branch August 8, 2026 16:00
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.

Reword "End AMA" to signify it's just closing question submission

1 participant