Skip to content

Conversation

@Pfannkuchensack
Copy link
Contributor

Summary

This PR implements a comprehensive bulk deletion feature for the Model Manager, allowing users to select and delete multiple models, LoRAs, and embeddings at once.

Key Features:

  • Multi-selection with Ctrl/Cmd+Click and checkboxes on model items
  • Sticky selection header showing count of selected models
  • Bulk delete button with confirmation modal
  • Detailed error handling for partial failures
  • Backend API endpoint for bulk operations

Backend Changes:

  • Added POST /api/v2/models/i/bulk_delete endpoint
  • BulkDeleteModelsRequest and BulkDeleteModelsResponse schemas
  • Returns detailed results: successfully deleted and failed models

Frontend Changes:

  • Redux state management for multi-selection
  • ModelListHeader component with selection count and bulk actions
  • BulkDeleteModelsModal for confirmation dialog
  • Sticky header positioning (remains visible when scrolling)
  • Toast notifications for success/failure/partial completion

This significantly improves UX when managing large model libraries, especially when restructuring storage locations.

Related Issues / Discussions

Addresses the pain point where users had to delete models individually after moving model files to new storage locations.
#6240
#6749

QA Instructions

  1. Navigate to Model Manager
  2. Click on multiple models while holding Ctrl (Windows/Linux) or Cmd (Mac)
    • Checkboxes should appear and models should be selected
  3. Observe the sticky header at the top showing selection count
  4. Scroll down the model list
    • Selection header should remain visible at the top
  5. Click "Delete Models" button
  6. Confirm deletion in the modal
  7. Verify toast notification shows success/failure
  8. Test partial failure scenario by selecting models with different permissions

Merge Plan

No special considerations needed. Can be merged after review.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable) - Manual QA testing recommended
  • ❗Changes to a redux slice have a corresponding migration - State changes are additive
  • Documentation added / updated (if applicable) - Self-explanatory UI feature
  • Updated 'What's New' copy (if doing a release after this PR)

Screenshot:
image

claude and others added 2 commits November 12, 2025 01:33
Implements a comprehensive bulk deletion feature for the model manager that allows users to select and delete multiple models, LoRAs, and embeddings at once.

Key changes:

Frontend:
- Add multi-selection state management to modelManagerV2 slice
- Update ModelListItem to support Ctrl/Cmd+Click multi-selection with checkboxes
- Create ModelListHeader component showing selection count and bulk actions
- Create BulkDeleteModelsModal for confirming bulk deletions
- Integrate bulk delete UI into ModelList with proper error handling
- Add API mutation for bulk delete operations

Backend:
- Add POST /api/v2/models/i/bulk_delete endpoint
- Implement BulkDeleteModelsRequest and BulkDeleteModelsResponse schemas
- Handle partial failures with detailed error reporting
- Return lists of successfully deleted and failed models

This feature significantly improves user experience when managing large model libraries, especially when restructuring model storage locations.

Fixes issue where users had to delete models individually after moving model files to new storage locations.
@github-actions github-actions bot added api python PRs that change python files frontend PRs that change frontend files labels Nov 12, 2025
- Added proper error serialization using serialize-error for better error logging
- Explicitly defined BulkDeleteModelsResponse type instead of relying on generated schema reference
- Reordered imports to follow conventional grouping (external, internal, then third-party utilities)
- Added type assertion for error serialization to satisfy TypeScript
- Extracted inline event handler into named callback function for better readability
@Pfannkuchensack Pfannkuchensack marked this pull request as draft November 12, 2025 23:03
@lstein
Copy link
Collaborator

lstein commented Nov 16, 2025

I did some quick testing of this and it works as advertised. Certainly makes it much easier to do bulk deletions. I have a couple of suggestions for the UI:

  1. Unless the user knows to ctrl-click on the model name, they'll never discover this feature. A more familiar interface would be to have the selection checkboxes shown by default, with a master checkbox at the top of the column to select/unselect all the displayed models.
  2. In the future I can see it being attractive to provide other actions that can applied to multiple models in bulk. For example, we might want to provide an archiving feature, or generate a table of installed model metadata. Consider whether after selecting the models you would provide an Action... popup menu that has the delete operation and room for other operations we might add in the future.

Two frontend checks are failing, but look easily fixed. Could you look into this?

@WolffM
Copy link

WolffM commented Nov 16, 2025

Love this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api frontend PRs that change frontend files python PRs that change python files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants