Repository navigation
Add common module management interface for labelers (add/rename/remove/duplicate subprojects) - #114
Merged
Merged
Conversation
Add a `moduleManagement` field to LabelerConf (serialVersion 3) that lets labelers define add/rename/remove/duplicate operations for modules (subprojects), surfaced as menu items under File > Manage Subprojects. Operations run in the Project-scope macro environment with labeler-declared parameters; there is no default implementation, so labelers must opt in explicitly. - Fix ProjectHistory.contentEquals and withCurrentIndexesKept, which assumed the module count never changes - Adopt the interface in the bundled nnsvs/diffsinger/utau labelers (add/rename/remove), replacing the need for labeler-specific plugins such as utau-add-folder - Docs, strings (en/zh/ja/ko), READMEs, and integration tests running the real labeler scripts Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sdercolin
commented
Jul 14, 2026
… matching - Clear moduleOperationShownInDialog in closeAllDialogs, and add a synchronous openModuleOperationDialog overload for testability - Rework withCurrentIndexesKept to match modules by name, pairing the names that exist on only one side by order, so undo/redo tracks the current module across renames that reorder the list (e.g. the TextGrid labeler sorts modules by name after renaming) - Tests for the new dialog state in AppDialogStateTest and the rename-with-reordering undo/redo path in ProjectStoreTest Co-Authored-By: Claude Fable 5 <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.
Closes the Trello ticket Commonized module management (design discussion recorded as a comment on the card).
What
Adds a common, labeler-driven interface for managing modules (subprojects) from the main menu, replacing the need for labeler-specific macro plugins (e.g.
utau-add-folder,textgrid-manage-module).Interface (
LabelerConf.moduleManagement, serialVersion 2 → 3)vlabeler-textgridencodes the tier index/name inside the module name and its writer parses it), so an operation that is not declared is not available, and the wholeFile > Manage Subprojectssubmenu is hidden when nothing is declared. Existing labelers are unaffected.displayedName,description, and plugin-styleparameters, rendered by the existing plugin dialog machinery (BasePlugin/BasePluginDialogState).modules,currentModuleIndex,params,labelerParams,resources,projectRootDirectory,error(),report()), targeting the current module. Results go throughvalidate()and the undo/redo history like macro plugins.Core fixes required by variable module counts
ProjectHistory.contentEqualszipped module lists under the assumption// modules size will not change— removing trailing modules was treated as an index-only change and never recorded. Now a size change is never squashed.ProjectStoreImpl.withCurrentIndexesKeptmatched modules by position across history snapshots; when the module count differs it now matches by name (behavior unchanged for the normal fixed-count path).Bundled labeler adoption
nnsvs-singer-labeler,diffsinger-labeler, andutau-singer-labelernow declareadd/rename/remove(duplicateintentionally omitted — duplicating a module sharing the same raw file is unsafe with Entry-scope writers). The UTAUaddscript is a port of theutau-add-folderplugin, which is kept for users on older app versions.vlabeler-textgridwill adopt the interface (including scripted rename validation and duplicate) in a separate PR in its own repo.UI
File > Manage Subprojectssubmenu with one item per declared operation (hidden otherwise), with key actions available for keymap customization.Docs
docs/labeler-development.md: new "Module Management" definition section and "Managing Modules" scripting section.docs/labeler-structure-updates.md: serialVersion 3.Tests
ModuleOperationTest: runs the real nnsvs scripts — rename (incl. collision/empty errors), remove (incl. last-module guard, index adjustment), add (lab parsed / default entry / outside-folder and duplicate errors), plus serialization round trip.UtauSingerProjectFixtureTest: add-folder operation end to end.ProjectHistoryTest/ProjectStoreTest: history recording and undo/redo across module-count changes.Compatibility notes
moduleManagementkey (ignoreUnknownKeys), so serialVersion-3 labelers and projects saved by this version load fine there (without the feature). Nothing rejects a higherserialVersionon load.🤖 Generated with Claude Code