material-foundation / material-theme-builder

Visualize dynamic color and create a custom Material Theme.
https://material-foundation.github.io/material-theme-builder/
Apache License 2.0
397 stars 27 forks source link

Make Swap action work on hidden layers too #167

Closed AnneKok closed 8 months ago

AnneKok commented 1 year ago

Is your feature request related to a problem? Please describe.

'Swap' does not work on hidden layers.

When I have e.g. an instance of a List component from the Design Kit, and I have hidden some list items within that list, I Swap the theme for the instance and it seems to work. But when I unhide the hidden list items it turns out that those layers were not swapped to the new theme. So every time I want to unhide something, I have to re-swap. This is quite time-consuming for components like lists.

Just copying the full component and Swapping immediately without first hiding frames does not solve the issue, because in the Design Kit components many layers are hidden by default (e.g. trailing/leading icons, divider lines...).

Describe the solution you'd like

Apply Swap action also to hidden layers within the selected frame(s). I imagine the current behavior is intentional so maybe make it a setting?

Describe alternatives you've considered

Workaround is to manually unhide everything and then Swap, then hide the layers again. But this is a lot of overhead especially since I cannot Ctrl+Z to undo all the unhides, since that will first undo the Swap.

Additional context

Since the Design Kit update it has become way easier to use the Theme Builder, this is the only issue I am still struggling with! Thanks for the good work.