BUG: external tox > Sub-Component

If you load a Sub-Component “sub” from an library.tox and then save your component again to the library.tox, it does NOT save it to “sub” inside library.tox , but overwrites the whole library.tox

I lost quite a bit of work due to this behavior.

Hey @Achim

I had a look and I’m not quite sure it’s a “bug”. Maybe not the UX you expect.

I’ve logged this to be discussed internally with devs.

Best,
Michel

@Achim

Any chance you could elaborate on your workflow here? What are you trying to achieve?

Why not having library.tox and within library.tox another COMP pointing to a sub.tox rather than using the sub-comp load in that case ?

Any details would be appreciated :slight_smile:

Thanks,
Michel

Yeah, maybe its just an UX bug . Seems like I run l into the same issue every couple of years

The whole point is to have a single tox file. Let me give you another example.

Imagine we have 5 moviePlayer[1-5] components. Each can load a set of movie components from player[1-5]_show1.tox. The operator can play as well as add/delete movies and then save the player[1-5]_show1.tox back to disc . No problem

Now I would like to enable the operator to just load/save a single show1.tox and have each moviePlayer extract its movies from show1.tox/player[1-5] sub-component.

In addition I want to support that e.g. moviePlayer2 can load its movies from show2.tox/player2 while all others still load from show1.tox

The only solution (besides subcomponents) seems to be to load the complete show1.tox and the complete show2.tox and just reference the needed subcomponents from the players. But that will load/create lot of movies that aren’t needed (as from show2.tox I might only need the movies for player2)

The sub-component workflow seems perfect for these requirements, if it would respect the sub-component path on Tox save

Hope that made sense

Thanks for the explanation. I think I understand the loading side, but I wanted to confirm what you’re looking for when saving the sub-component again.

Are you looking for it to merge the new revised sub-component back into the library with the other sub-components that were not loaded?

I can definitely see improving the UX to warn users that saving the sub-component on top of the full library tox will erase the unloaded toxes, but I’m not sure of a good method to just revise the one sub-component without affecting the other unloaded components in the tox.

However, we are working on some improvements to external toxs that would allow this using multiple files where each of the sub-components in the library tox is actually an external tox of its own. In that framework it would be possible to save the sub-component back to its own file.

Exactly. At least if I save it to the same tox file as it was loaded from. In this situation I can’t think of any use case where I would want to overwrite the whole „library“ with just the sub-component

Sounds like the new tox framework you mentioned would save the sub components to separate files, which makes sense for a library style setup. But for something as outlined in the moviePlayer example I need to maintain everything in one file

I think I can work around it by storing my sub-components as a bytearray into a dict and pickle.dump() → save it to a “custom file format”

2 Likes