Skip to content

Implement Collapsible Groups#175

Open
Rsslone wants to merge 43 commits intoCleanroomMC:cleanroomfrom
Rsslone:cleanroom
Open

Implement Collapsible Groups#175
Rsslone wants to merge 43 commits intoCleanroomMC:cleanroomfrom
Rsslone:cleanroom

Conversation

@Rsslone
Copy link
Copy Markdown

@Rsslone Rsslone commented Mar 14, 2026

A compiled binary for testing can be found on my repo if you would like to test drive and break it.

Implements / Backports the idea of collapsible groups with built in filters and ability for user defined groups. Items adhere to current blacklists, blacklisted items will not appear.
image

New conditional function to HEI config menu button which toggles between expand all and collapse all.
image

4 new settings related to groups, 1 of which is a submenu for group management. All contain tooltip keys.
image

New submenu for group management, contains built in sets for Enchanted Books, Potions, Arrows, and Spawn Eggs.
image

New item selector for groups, groups are saved into a customCollapsibleGroups.json as individual items/gas/fluids, a current minor shortcoming is it does not handle individual NBT. Potential for replacing the old blacklist selection process, but was set aside for now. Currently the left panel supports click and drag, the right panel is single click only.
image

Special attention of areas I am less sure about, i.e help I need an adult.

Making enchanted books searchable, I know not the consequences of my actions.
1f66391
and
Cached baked models, this is entirely suggested by AI, please look this over.
c7c930f

Rsslone added 22 commits March 12, 2026 21:23
Fix the option being placed in the HEI menu. Placement under hide mode but likely will be moved later.
Add a group management screen to create and edit custom groups and toggle built in groups.
Moved the configuration buttons below the blacklist. One entry for bool enable for groups and one for the groups submenu.
While hide mode is enabled, we just expand all the collapsed entries.
Amend Enchanted Book to item name making it searchable in non-prefix search.
Fixed search result being applied to groups management page
Fixed enchanted book previews
Increased rows to 3
Removed ID string from display
Fixed GUI scaling on group management page.
Render 8 x 3 rows of icons, if overflow, -1 from last row and print + overflow count.
Simple drag selection
Allowing duplicate items in multiple groups. Not sure why people would want this, but its how REI does it too.
Changed the static list with overflow counter to a basic scrolling list. Scrollwheel and basic mouse drag support.
Implements searchable group names instead of only items within a group.
When a user presses "New Group" but goes back, the expected behavior is to cancel and not create a new group. Only save group on save.
Displays the first two items in a group, better indicating its a group. Changed the item count to a orange color, to better match the tooltip color and to stand out better. Decreased the size of the count.
Implement collapse on close, when HEI is closed collapse all currently open groups.
Implement Default Action, user selectable single click action, default to the more user friendly single click to expand group. Inverts Alt+Click action.
Fixed tooltips for closing expanded groups.
All translations were machine generated and cannot be validated with confidence. Take it with the grain of salt it deserves or leave it.
Implements an Alt+Click toggle to expand/collapse all groups via the HEI config button. Conditional tooltip to inform user. Includes translated keys.
Implement fluidstack in groups.
Implement single item groups act as itemstack.
Copy link
Copy Markdown
Member

@Rongmario Rongmario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick look and spotted something, CollapsedStack and CollapsibleEntry could be merged and to be a HEI "ingredient type", which can help compatibility.

Also where classes can be imported, should be imported.

Rsslone added 3 commits March 15, 2026 02:26
Merge CollapsedStack and CollapsibleEntry classes.
Registered CollapsedStack.TYPE
Changed CollapsedStack Ingredient Renderer to implement IIngredientRenderer<>
CollapsedStackIngredientHelper implements IIngredientHelper<>
CollapsedStackRenderer implements IIngredientRenderer<>
Implements wildcard selections item selector
Implements badges for wildcards
Implements orange tints for grouped items in other groups
Implements tooltips in item selector
@Rsslone Rsslone requested a review from Rongmario March 15, 2026 08:48
Rsslone added 3 commits March 15, 2026 05:04
Fixed single item collapsed stack to return item tooltip instead of group tooltip.
Bring the item selection behavior on par with the blacklist.
User selection is now less explicit, allowing promotions to wildcard and decompose of wildcards (all except).
Configurations are saved similar to blacklist, promotes to wildcard if all meta space is selected and decomposed to explicit listings when not, regardless of selection method.
Fixed alignments of item grid on gui selector.
Fixed several buttons a few pixels too thin.
Rsslone added 11 commits March 22, 2026 02:23
Collapsed and expand invalidated the filter cache causing client lag spikes.
Implements a basic delete confirm prompt so users don't delete groups in a single click.
Item Selector now remembers last search term and page, very useful for quickly and repeatedly adding groups.
Ctrl+F now focuses the search field.
When show all items was enabled with creative, we would show items API blacklisted unintentionally.
When a user toggles the setting to show blacklisted items in creative, the cache needs to be reloaded for the change to reflect in the itemlist.
Allow mods to register custom groups with HEI.
Condensed API calls to a single addGroup, use IIngredientType<V> predicate.
Collapsible Groups Manager now condenses group calls with the same ID as a single card.
Changed ICollapsibleGroupRegistry API to accept the untranslated lang key instead of a pre-resolved name, we now translate it on the API end.
Copy link
Copy Markdown
Member

@Rongmario Rongmario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through just about everything except for the ingredient filter (searching) and the ingredient batch renderer (rendering)

  • Realistically the searching would just encapsulate those that are in collapsed group + the CollapsedStack ingredient itself. Anything more custom introduces extreme complexity
  • The renderer caches can probably be minimized with little to no effect

* @param type The ingredient type (e.g. {@code VanillaTypes.ITEM}).
* @param matcher Predicate receiving a fully-typed {@code V} — no casting needed.
*/
<V> void addGroup(String id, String langKey, IIngredientType<V> type, Predicate<V> matcher);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaner API may be to do a CollapsibleGroupBuilder newGroup(String id, String langKey) and the builder may contain methods such as:

CollapsibleGroupBuilder add(Object ingredient) - adds specific objects (backend resolves it into ingredients)
CollapsibleGroupBuilder add(IIngredient<?>... ingredients) - adds specific ingredients
CollapsibleGroupBuilder addAllOf(IIngredientType<?>... types) - adds all ingredients for a given type
<V> CollapsibleGroupBuilder addAny(IIngredientType<V> type, Predicate<V> ingredientFilter)

Other group modification methods can go into the builder too, and more can be added in newer versions without breaking API compatibility

private static final Type GROUP_LIST_TYPE = new TypeToken<List<CustomGroup>>() {}.getType();

private final File configFile;
private List<CustomGroup> customGroups = new ArrayList<>();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to use a Map<String, CustomGroup> here, to fix updateGroup method O(n) lookup => O(1) lookup.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause regression where if resources are loaded, the cached baked models will incur memory usage, duplicated and allow for broken models with broken textures.

To cache here is possible, but needs a resource reload listener to clear all of these caches.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure new lang keys are prefixed with hei. rather than jei.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave these out of gitignores, just make sure you don't stage these files either

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll modify this later...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants