Bulk Operations
Perform bulk actions on multiple content items at once for efficient content management
Status: ✅ MVP Complete (Phase 1-4) Requirements: REQ-1, REQ-2, REQ-6, REQ-8, REQ-9
Overview
Bulk Operations allow you to perform actions on multiple content items simultaneously, saving time when managing large libraries of NPCs, encounters, plots, and other D&D content.
Available in MVP:
- ✅ Multi-select interface with keyboard shortcuts
- ✅ Batch tagging (add/remove tags)
- ✅ Bulk soft delete
- ✅ Operation undo
- ✅ Progress tracking and error handling
Deferred to Future Releases:
- ⏳ Mass PDF export
- ⏳ Encounter difficulty scaling
- ⏳ Find & replace
- ⏳ Treasure scaling
Quick Start
Basic Workflow
- Select Items: Click checkboxes to select content items
- Choose Action: Click "Actions" button to see available operations
- Execute: Perform tagging, deletion, or other bulk actions
- Undo (if needed): Use Operation History to revert changes
Features
1. Multi-Select Interface
Individual Selection
- Click checkbox in any row to select that item
- Selected items are highlighted
- Selection count badge shows how many items selected
Range Selection (Shift+Click)
- Click first item checkbox
- Hold Shift
- Click last item checkbox
- All items in range are selected
Select All (Cmd/Ctrl+A)
- Press
Cmd+A(Mac) orCtrl+A(Windows/Linux) - Selects all items on current page
- Works when focus is on the content list
Clear Selection
- Click "Clear Selection" or deselect all checkboxes
- Selection auto-clears after successful operation
2. Batch Tagging
Add Tags to Multiple Items
- Select items (minimum 1, maximum 500)
- Click "Actions" → "Add Tags"
- In the dialog:
- Use Existing Tags: Check boxes for tags already in your library
- Create New Tags: Type tag name and press Enter
- Suggested Tags: Click suggested tags based on content type
- Click "Add Tags"
- Monitor progress bar
- See success toast notification
Tag Suggestions by Content Type:
- NPCs: combat, friendly, boss, merchant, quest-giver
- Encounters: deadly, easy, trap, puzzle, social
- Plots: main-quest, side-quest, one-shot, mystery, dungeon-crawl
Limits:
- Max 500 items per batch
- Max 20 tags per operation
- Tag names: 1-50 characters
Remove Tags from Multiple Items
- Select items
- Click "Actions" → "Remove Tags"
- Check tags to remove (only shows tags present on selected items)
- Click "Remove Tags"
- Monitor progress
Note: Removing a tag only affects items that have it. Items without the tag are skipped gracefully.
3. Bulk Delete
Soft Delete Multiple Items
- Select items (minimum 1, maximum 500)
- Click "Actions" → "Delete"
- Review confirmation dialog:
- Item count
- List of items being deleted
- Warning about potential broken references
- Click "Delete X items" to confirm (or Cancel to abort)
- Monitor progress
- Items are soft deleted (archived)
Important:
- Items are soft deleted (status set to 'archived')
- Items can be restored via Undo
- Deleting items may break references in active campaigns, quests, or encounters
- Hard delete is not available in MVP (prevents accidental data loss)
4. Operation Undo
View Operation History
- Click "Operation History" button
- Panel shows recent bulk operations:
- Operation summary (e.g., "Added tags to 5 items")
- Timestamp (relative, e.g., "2 hours ago")
- Status badges (Undone, X failed)
- Undo button (for reversible operations)
Pagination:
- 10 operations per page
- Previous/Next buttons to navigate
- Total count displayed
Undo an Operation
- Open Operation History panel
- Find operation to undo
- Click "Undo" button
- Confirm in dialog:
- Shows item count to restore
- Special note for delete operations
- Click "Confirm Undo"
- Monitor progress
- See success notification
What Can Be Undone:
- ✅ Tag additions (removes tags that were added)
- ✅ Tag removals (re-adds tags that were removed)
- ✅ Soft deletes (restores items to active status)
What Cannot Be Undone:
- ❌ Operations that have already been undone
- ❌ Operations without version snapshots (rare edge case)
5. Progress Tracking
During Operations
- Progress Bar: Shows percentage completion
- Item Count: Displays current/total (e.g., "25/50")
- Estimated Time: Appears for operations > 5 seconds
- Phase Indicator: Shows current operation phase
After Operations
Success:
- Green checkmark icon
- Success toast: "Successfully tagged 5 items!"
- Auto-clears selection
- Refreshes content library
Partial Success:
- Amber warning icon
- Toast shows: "5 succeeded, 2 failed"
- Error summary with failed items
- Retry button for failed items
Total Failure:
- Red error icon
- Error toast with details
- No changes applied
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Cmd+A / Ctrl+A | Select all items on page |
Shift+Click | Select range of items |
Escape | Close dialogs/panels |
Limits & Constraints
| Limit | Value | Reason |
|---|---|---|
| Max items per batch | 500 | Performance & timeout prevention |
| Max tags per operation | 20 | UI/UX clarity |
| Tag name length | 1-50 chars | Database constraint |
| Batch processing size | 50 items | Atomic transaction size |
| History page size | 10 operations | Pagination performance |
Best Practices
For Game Masters
Organizing Content:
- Tag by campaign:
waterdeep-campaign,curse-of-strahd - Tag by theme:
undead,fey,urban,dungeon - Tag by status:
ready,draft,needs-review - Tag by difficulty:
tier-1,tier-2,deadly
Managing Large Libraries:
- Use multi-select for batch tagging new content
- Leverage tag suggestions for consistency
- Use Operation History to track changes
- Undo if you make a mistake—it's safe!
Before Deleting:
- Review the item list carefully
- Consider tagging as
archivedinstead of deleting - Remember deletion breaks campaign references
- You can always undo if needed
Performance Tips
For Best Performance:
- Batch operations in groups of 25-50 items
- Use specific tags (avoid vague tags like "misc")
- Close Operation History panel when not needed
- Avoid selecting 100+ items at once
Troubleshooting
"Some items failed to tag/delete"
Causes:
- Items you don't own (shared content)
- Network connectivity issues
- Database timeout
Solutions:
- Check error summary for specific items
- Click "Retry Failed Items"
- Reduce batch size if timeout occurs
"Operation cannot be undone"
Causes:
- Operation already undone
- Missing version snapshots
- Non-reversible operation type
Solutions:
- Check if operation shows "Undone" badge
- Manual restoration may be needed for missing snapshots
Selection not working
Causes:
- Browser JavaScript disabled
- Conflicting browser extension
- Focus not on content list
Solutions:
- Reload page
- Disable conflicting extensions
- Click on content list before using Cmd/Ctrl+A
API Endpoints
For developers integrating with bulk operations:
| Endpoint | Method | Purpose |
|---|---|---|
/api/bulk/tag | POST | Add or remove tags |
/api/bulk/delete | POST | Soft delete items |
/api/bulk/history | GET | Get operation history |
/api/bulk/undo/[operationId] | POST | Undo an operation |
See API Documentation for detailed schemas and examples.
Technical Details
Database Schema
bulk_operations table:
- Audit trail for all bulk operations
- Tracks operation type, status, items affected
- Stores version snapshot IDs for undo
- Includes error details for failed items
content_versions table:
- Snapshots of content before modification
- Enables undo functionality
- Tracks who made changes and when
content.tags column:
- PostgreSQL TEXT[] array
- GIN index for fast tag searches
- Supports array operations (add, remove, contains)
Performance
Benchmarks (50 items):
- Batch tagging: ~700ms (p95)
- Batch delete: ~1.5s (p95)
- Undo operation: ~2s (p95)
See Performance Testing Guide for detailed metrics.
Future Enhancements
Phase 2: Batch Export & Scaling (future release)
- Mass PDF export with custom templates
- Encounter difficulty scaling with CR calculator
- Treasure scaling based on DMG tables
Phase 3: Advanced Operations (future release)
- Find & replace across content
- Dependency analysis before delete
- Full treasure tables (levels 11-20)
Support
Found a bug? Report at github.com/your-repo/issues Feature request? Create discussion at github.com/your-repo/discussions Need help? Check Documentation or contact support
Last Updated: 2026-02-03 Version: MVP (Phases 1-4 Complete)