TagStudio icon indicating copy to clipboard operation
TagStudio copied to clipboard

Refactoring

Open Loran425 opened this issue 9 months ago • 3 comments

the ts_qt.py file contains most if not all of the code for running TagStudio at this point, as new features are added this is causing this file to continue to grow and make things harder to find, edit and maintain.

I think breaking out the widgets and modals would be a good start on this

a barebones example would be the Preview Panel https://github.com/TagStudioDev/TagStudio/blob/31f402289565b55d3a84d11f0eb6055e9bf42374/tagstudio/src/qt/ts_qt.py#L2012-L2753

This widget is almost 700 lines long and has only been edited about 6 times with minor changes but the ts_qt.py file appears in almost half of the commits to the project so far.

Happy to start working on a PR for this but want there to be a little more feedback than my own thoughts.

Loran425 avatar Apr 27 '24 17:04 Loran425

Yeah, ts_qt.py needs to be modularized quickly. I think our first goal should be some type of diagram showing everything in it and all the dependencies. From there we can separate it into files (tags, file grid view, preview panel etc)

cirillom avatar Apr 27 '24 17:04 cirillom

Absolutely agree. I'll be working on closing out new feature PRs for 9.2.x today and then we can use that as a base for splitting out ts_qt.py into individual classes or related class groups

CyanVoxel avatar Apr 27 '24 18:04 CyanVoxel

with #80 merged this item seems resolved to me, I'll probably close it Friday May 3rd if there aren't any concerns or additional refactor ideas we see.

Loran425 avatar Apr 29 '24 19:04 Loran425