feat(modtools): bulk versionTitle rename#3197
Open
dcschreiber wants to merge 2 commits intofeature/sc-36475/modtools-pr1-backendfrom
Open
feat(modtools): bulk versionTitle rename#3197dcschreiber wants to merge 2 commits intofeature/sc-36475/modtools-pr1-backendfrom
dcschreiber wants to merge 2 commits intofeature/sc-36475/modtools-pr1-backendfrom
Conversation
Add the ability to rename versionTitle across multiple indices in the bulk version editor. This was previously blocked because versionTitle is part of the Version model's composite primary key, but the model layer already supports renaming via track_pkeys + dependency handlers. Backend: - Extend version_bulk_edit_api to accept optional newVersionTitle - Pre-check for duplicates across all indices before any modification - Apply metadata updates first, then rename (two-phase per version) - Version.save() fires existing attributeChange handlers automatically New cascade handlers for versionTitle changes: - marked_up_text_chunks + linker_output (versionTitle is a pkey) - links.charLevelData + links.versions (essay-type) - topic_links.charLevelData - user_history.versions - profiles.version_preferences_by_corpus Frontend: - Add "New Version Title" input in Version Identification section - Confirmation dialog listing side effects before rename - Auto-refresh search with new title after successful rename - Partial success messaging for rename operations - Changes preview shows rename operation Tests: - Rename succeeds across multiple indices - Duplicate detection rejects conflicting renames - Combined rename + field updates - Empty/same title validation - Cascade to marked_up_text_chunks and links.charLevelData Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add explicit CSRF token check before sending the upload request, and handle 403 responses with a user-friendly message suggesting a page refresh. Complements the server-side @ensure_csrf_cookie fix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
How it works
The API accepts an optional newVersionTitle param. It pre-checks all indices for duplicate conflicts, applies metadata updates first, then renames. Version.save() fires attributeChange handlers via track_pkeys, cascading to all registered collections automatically. After a successful rename, the frontend auto-refreshes the search with the new title.
Test plan