Suggest Category feature in the corpus client app
Description
Add a "Suggest Category" feature in the corpus client app that allows authenticated users to propose new categories. These suggestions enter a moderation pipeline where admins can review and approve/reject them.
Context
The backend already has a complete suggestion workflow:
| Endpoint | Purpose |
|---|---|
POST /api/v1/categories/suggest |
Submit a new category suggestion |
GET /api/v1/categories/my-suggestions |
View the current user's own suggestions |
These endpoints have no frontend consumer — this issue adds the user-facing UI.
Requirements
1. "Suggest Category" Button/Access
- Accessible from within a category-related context (e.g., during upload, editing media, or from the profile/dashboard)
- Could be positioned near the existing category selector or media type wheel
- Opens a modal/dialog for submitting the suggestion
2. Suggestion Form (Modal/Dialog)
-
Fields:
-
name(required) — Slug/identifier, auto-generated from title or manually entered -
title(required) — Display name of the category -
description(optional) — Short explanation of the category's purpose
-
-
Validation:
- All required fields must be filled
- Show character limits if applicable
- Handle backend validation errors (e.g., duplicate name, duplicate pending suggestion)
-
Submission:
- Calls
POST /api/v1/categories/suggest - Shows loading spinner during submission
- Success → close modal, show toast "Suggestion submitted for review"
- Error → show inline error message
- Calls
3. My Suggestions View
- Accessible from the user's profile page or a dedicated section
- Lists all categories the current user has submitted, showing:
- Category name / title
- Submission date
- Current status (pending / approved / rejected)
- Approval/rejection date if applicable
- Uses
GET /api/v1/categories/my-suggestionsendpoint - Show empty state if no suggestions yet: "You haven't suggested any categories yet"
4. Status Indicators
- Pending: Yellow/orange badge — "Awaiting Review"
- Approved: Green badge — "Approved"
- Rejected: Red badge — "Not Approved"
- Use existing Badge component from shadcn
Technical Notes
- The backend endpoint
POST /api/v1/categories/suggestexpects:{ "name": "string", "title": "string", "description": "string (optional)" }