Add a UI for users to view, edit, reorder, and delete entry types in their changelogs. This solves the issue where users can't manage duplicate or unwanted entry types after they're created.
- Import logic was creating duplicate entry types (e.g., 'Added' and 'added') due to case mismatches (now fixed)
- Users need a way to clean up existing duplicates and manage custom types
- Currently no UI to edit, delete, or reorder entry types after creation
Route: /dashboard/[id]/settings/types
Access:
- Accessible from changelog settings page
- Link/button: "Manage Entry Types"
Display:
- Show all entry types (defaults + custom) in a list/grid
- Each entry type card shows:
- Icon/emoji
- Name
- Color indicator
- Usage count (number of items using this type)
- Badge: "Default" or "Custom"
- Actions: Edit, Delete, Move Up/Down
Ordering:
- Display types in current database order
- Allow reordering via up/down arrows or drag-and-drop
Modal/Form:
- Edit name (text input)
- Edit icon (emoji picker or text input)
- Edit color (color picker or preset swatches)
- Can't edit default types (grayed out/disabled)
Validation:
- Name required, 1-50 chars
- No duplicate names (case-insensitive check)
API: PATCH /api/changelogs/[id]/types/[typeId]
Behavior:
- Show usage count
- If type is in use (has items):
- Option A: Block deletion with error message
- Option B: Allow deletion but require converting items to another type first
- Can't delete default types
- Show confirmation dialog
API: DELETE /api/changelogs/[id]/types/[typeId]
Options:
- Option A: Up/Down buttons (simpler)
- Option B: Drag-and-drop (better UX, more complex)
API: PATCH /api/changelogs/[id]/types/reorder
- Body:
{ typeIds: [id1, id2, id3, ...] }(array in new order)
- Verify changelog ownership
- Require authentication
- Check user owns the changelog before allowing edits
ALTER TABLE entry_types ADD COLUMN "order" INTEGER DEFAULT 0;Backfill:
- Update existing types to set order based on current ID or created date
- Defaults (id where changelogId is null) get order 0-5
- Custom types get sequential order starting from 100
export const entryTypes = pgTable('entry_types', {
// ... existing fields
order: integer('order').notNull().default(0),
});Request:
{
"name": "New Name",
"icon": "🎉",
"color": "#ff6b6b"
}Response:
{
"success": true,
"type": { ... }
}Errors:
- 401: Not authenticated
- 403: Not owner of changelog
- 404: Type not found
- 400: Can't edit default type
- 400: Duplicate name
Response:
{
"success": true
}Errors:
- 401: Not authenticated
- 403: Not owner of changelog
- 404: Type not found
- 400: Can't delete default type
- 400: Type is in use (if blocking deletion)
Request:
{
"typeIds": ["uuid1", "uuid2", "uuid3"]
}Response:
{
"success": true
}Errors:
- 401: Not authenticated
- 403: Not owner of changelog
- 400: Invalid type IDs
Location: app/dashboard/[id]/settings/types/page.tsx
- Server component
- Verify auth and ownership
- Fetch entry types with usage counts
- Render EntryTypesManager client component
Location: app/dashboard/[id]/settings/types/EntryTypesManager.tsx
- Client component
- Display entry types list
- Handle edit/delete/reorder actions
- Show modals/dialogs
Location: app/dashboard/[id]/settings/types/EntryTypeCard.tsx
- Display single entry type
- Show icon, name, color, badge
- Usage count
- Action buttons
Location: app/dashboard/[id]/settings/types/EditEntryTypeModal.tsx
- Edit form
- Color picker
- Icon picker
- Validation
Location: app/dashboard/[id]/settings/types/DeleteConfirmDialog.tsx
- Confirmation dialog
- Show usage warning
- Confirm/cancel buttons
- Add
ordercolumn migration - Backfill order values for existing types
- Create PATCH endpoint for updating types
- Create DELETE endpoint (with validation)
- Create PATCH endpoint for reordering
- Create entry types management page route
- Build EntryTypesManager component
- Add entry type cards with edit/delete buttons
- Create EditEntryTypeModal
- Create DeleteConfirmDialog
- Add link from settings page
- Add up/down buttons (simple approach)
- OR implement drag-and-drop (better UX)
- Update API to handle reorder requests
- Update release form to respect order
- Add loading states
- Add error handling
- Add success toasts
- Responsive design
- Accessibility (keyboard nav, screen readers)
Decision: Block deletion with clear error
- Show usage count: "Cannot delete. 12 items use this type."
- Future: Add "Convert items to another type" feature
Decision: Disable edit/delete for defaults
- Mark as "Default" badge
- Gray out edit button
- Show tooltip: "Default types can't be modified"
Decision: Check case-insensitively
- Show error: "A type named 'Added' already exists"
- Don't allow save until name is unique
Decision: Allow reordering defaults within changelog context
- Each changelog can have custom order
- Doesn't affect other changelogs
- Can view all entry types (defaults + custom)
- Can edit custom type name
- Can edit custom type icon
- Can edit custom type color
- Cannot edit default types
- Can delete custom type (if not in use)
- Cannot delete default types
- Cannot delete type in use (shows error)
- Can reorder types
- Order persists after page refresh
- Release form uses new order
- Public changelog uses new order
- Embed widget uses new order
- Duplicate name validation works
- Unauthorized users can't access
- Loading states work
- Error messages are clear
- Success toasts appear
- Responsive on mobile
Total: 6-8 hours
- Database migration: 30 min
- API endpoints: 2 hours
- UI components: 3 hours
- Reordering feature: 1.5 hours
- Polish + testing: 1.5 hours
Medium-High
- Users have requested this
- Import bug created duplicates that need cleanup
- Quality-of-life improvement for custom types
- Not blocking launch, but valuable post-launch feature
- None (can implement immediately)
- Import/export already working
- Database schema supports custom types
- Convert items from one type to another before deletion
- Bulk operations (delete multiple types)
- Type templates/presets
- Per-type custom styling in public pages
- Analytics on type usage