Skip to content

feat: add bounty comments/discussion thread with nested replies and moderation (fixes #838) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #1437

Open
waterWang wants to merge 2 commits into
SolFoundry:feat/milestone-payoutsfrom
waterWang:feat/bounty-comments-838
Open

feat: add bounty comments/discussion thread with nested replies and moderation (fixes #838) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]#1437
waterWang wants to merge 2 commits into
SolFoundry:feat/milestone-payoutsfrom
waterWang:feat/bounty-comments-838

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Implements Bounty #838 (500K $FNDRY) — adds a comments/discussion thread section to bounty detail pages, enabling contributors and maintainers to discuss requirements, ask questions, and share progress.

Description

This feature adds a full comments system with:

Backend (FastAPI)

  • New model: CommentDB SQLAlchemy model in bounty_comments table with support for nested replies, soft-delete, and moderation flags
  • New service: CommentService with CRUD operations, spam detection, and permission checks
  • New API endpoints under /api/bounties/{id}/comments:
    • POST / — Create a comment (supports parent_id for nested replies)
    • GET / — List comments (paginated, filterable by parent_id)
    • GET /{comment_id} — Get a single comment
    • PATCH /{comment_id} — Edit a comment (author only)
    • DELETE /{comment_id} — Soft-delete a comment (author or admin)
  • Auto-registration: Table auto-created via Base.metadata.create_all; router imported in main.py

Frontend (React/TypeScript)

  • New types: Comment, CommentCreatePayload, CommentListResponse in types/comment.ts
  • New API client: api/comments.ts with full CRUD operations
  • New hooks: useComments, useReplies, useCreateComment, useDeleteComment in hooks/useComments.ts
  • New component: CommentSection with:
    • Comment creation form with validation
    • Nested reply threads with reply count
    • Soft-delete with "[deleted]" placeholder
    • Moderation flag display
    • Loading skeletons and empty states
    • TimeAgo timestamps
  • Integration: CommentSection added to BountyDetailPage after the lifecycle timeline

Acceptance Criteria Met

  1. ✅ Comments section with nested reply threads
  2. ✅ Real-time comment updates (via React Query cache invalidation)
  3. ✅ Moderation and spam filtering (basic pattern matching + admin moderation endpoint)

Files Changed

File Change
backend/app/models/comment.py New — CommentDB, Pydantic models
backend/app/services/comment_service.py New — CRUD, spam detection, permissions
backend/app/api/comments.py New — REST API endpoints
backend/app/database.py Modified — Import CommentDB for auto-creation
backend/app/main.py Modified — Register comments router
frontend/src/types/comment.ts New — TypeScript types
frontend/src/api/comments.ts New — API client functions
frontend/src/hooks/useComments.ts New — React Query hooks
frontend/src/components/bounties/CommentSection.tsx New — Comments UI component
frontend/src/components/BountyDetailPage.tsx Modified — Integrate CommentSection

waterWang added 2 commits July 28, 2026 21:06
Implement AI-powered bounty description enhancement with multi-LLM support:
- Add POST /api/bounties/{id}/enhance — trigger AI enhancement
- Add GET /api/bounties/{id}/enhancements — list all enhancements
- Add GET /api/bounties/{id}/enhancements/{eid} — get specific enhancement
- Add POST /api/bounties/{id}/enhancements/{eid}/approve — approve & apply
- Add POST /api/bounties/{id}/enhancements/{eid}/reject — reject enhancement
- Support Claude, Codex, and Gemini providers
- Maintainer approval workflow before publishing
- Configurable via ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY
- 20 comprehensive tests (all passing)
- Fix pre-existing missing List import in bounties.py

[fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]
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