ruler icon indicating copy to clipboard operation
ruler copied to clipboard

Granular resource file categorization

Open MrHadiSatrio opened this issue 2 years ago • 4 comments

Feature description

Hi! First off, thank you for open-sourcing such an amazing tool. The ease of integration and the amount of insight Ruler provides is just chef's kiss. Kudos!

That said, I feel like FileType.RESOURCE is too broad of a category. Would it be feasible to make it more granular? So instead of having one umbrella type that is FileType.RESOURCE, we'd have FileType.DRAWABLE, FileType.LAYOUT, FileType.FONT, etc.

Reasoning

In a setup where size is being periodically tracked through Ruler, having granular resource types could help addressing regression faster.

MrHadiSatrio avatar Aug 09 '22 11:08 MrHadiSatrio

Hey, @MrHadiSatrio Thanks for the great suggestion! We are going to take a look at this and get back to you!

ViktorPetrovski avatar Aug 09 '22 11:08 ViktorPetrovski

Definitely! And you're most welcome. 😄

To illustrate this request better, I thought of making a small change to highlight a Drawable I've added to :sample.

Output HTML post the change; showing a new file category "Drawable" being added to the charts under the "Insights" tab.

MrHadiSatrio avatar Aug 09 '22 11:08 MrHadiSatrio

Great idea! One thought I had - should they be differentiated at the same level as all other files (like you showed in your example)? Or should there be another graph inside the insights tab that only shows resources and their distribution? I'm thinking that the second option might be easier to use, since the first option could potentially overload the graphs (if you have a lot of different resource types) and make them harder to read. What do you think?

simonschiller avatar Aug 09 '22 17:08 simonschiller

Now that you mentioned it, I guess the approach of having "sub-types" makes more sense when we're talking about visualization. Otherwise, there could only be so much we're adding to these graphs before it becomes too cluttered to glance at.

Though I think it can be made as an implementation detail on the front-end. The model hierarchy can stay as is to keep the type structure flat and downstream processing easy.

MrHadiSatrio avatar Aug 10 '22 04:08 MrHadiSatrio

Hey @MrHadiSatrio @simonschiller I picked up this ticket yesterday.

I've added a few resource types: Drawable, Layout, Raw, Values, Font & Other. Do you think we should add something more to the list or this is good, to begin with?

I'm also sharing the example of the front end: image

What do you think?

ViktorPetrovski avatar Aug 30 '22 11:08 ViktorPetrovski

Fixed in #97, feel free to open another issue if there are resource types that are missing 😄

botronic avatar Sep 01 '22 07:09 botronic

Wow, thanks a lot guys! This is amazing. ❤️

MrHadiSatrio avatar Sep 01 '22 11:09 MrHadiSatrio