Repository navigation
feat(bags): keep the layout while taking items out - #3579
Merged
EllesmereGaming merged 2 commits intoNov 24, 2026
Merged
Conversation
New opt-in switches "Keep Layout While Taking Items Out" for the bags (Layout section) and the bank (last row of Grouping, needs Nest by Expansion or Group by Category), both off by default. While on, the window items are taken out of keeps every category, sub-group, Pinned, Recent Items and the bank's Empty Slots group at its place and size: items close up inside their group, the freed slots at its end stay empty, and an emptied group stays as an empty block. The window items go into sorts as before. The bags fill the gaps with the existing empty-slot pad frames, the bank with the real empty slots the taken items left, so no secure button is involved. Only item-event refreshes keep the hold; any other refresh releases it, as do closing the window (every bank hide closes the bank), opening or closing an item panel, a search change, a sort (counted suspension; passes during a sort never hold) and new items coming in (a quantity above its running maximum since the hold began). Group keys use category identity through named prefixes, so equal labels never share a held size. A held Compact pass feeds CompactPack the held cell counts and label widths, so its memo hits and the bands are not replanned. Labels are planned with a small fixed reserve per count digit, so a count that drops to 0 never cuts the label. A held pass allocates no tables in the hold code. With both switches off the hold adds no event, hook, timer, frame or allocation site; its tables are created on first enable. The empty-pad pool's get-or-create moved to file scope so Grid and Compact share one pool and counter; the upstream pad placement lines are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I went straight to a PR instead of opening a feature request first, so the change is ready to try. If you would prefer a different approach, a smaller scope (for example bags only) or other names and placement for the options, tell me and I will gladly rework it.
What does this PR do?
Problem. When you sell at a vendor or move items between bags and bank, every removed item re-lays out the window. In Compact a block that lost one item can get narrower, and the planner moves other blocks into another band, so a category jumps from bottom left to top right. In Grid every category below shifts up when one loses a row or empties. The mouse stays where it was, so the next right-click can hit an item of a different category, and it is easy to sell the wrong thing.
Change. Two new switches, both off by default, named "Keep Layout While Taking Items Out": one for the bags (Layout section) and one for the bank (last row of Grouping). While a switch is on, the window you take items out of keeps every category, sub-group (armory slots, expansions, type splits), Pinned, Recent Items and the bank's Empty Slots group at its place and size. Items inside a group still close up left to right as today. The freed slots at the group's end stay empty, and a group that empties stays as an empty block with "(0)". The window items go into sorts as today.
There are two switches because the two windows have separate option pages and the bank hold needs the bank's grouping. The bank hold works in OneBank and OneWarbank with Nest by Expansion or Group by Category. Its toggle is greyed out in List or without grouping (the tooltip says why). In per-tab views and while a search or a sidebar category is selected it has no effect. In the bags the hold covers Grid and Compact (All Items, group view, single category, virtual views). In OneBag and MultiBag only the Pinned and Recent Items quickviews hold, and the bag sections keep slot order as today. List is untouched in both windows.
When the held layout resets.
How it works. A small state module,
EUI_Bags_Hold.lua, records per window each group's cell count and planned label width while items leave. Only refreshes that come from item events keep the hold: the existing debounced bag/bank refresh (including the v9.9.2 tint retry), the combat-end replays, and the Pawn and search repaints set one flag. Every other refresh releases it. Held passes draw at least the recorded cells per group. The bags fill the gaps with the existing empty-slot pad frames (mouse off, never secure buttons), the bank with real empty slots of the view. In Compact a held pass handsCompactPackidentical inputs, so its memo hits and the bands are not replanned. While held, Auto-Size with Shrink keeps the column count. Labels are planned with a small fixed reserve per count digit (0.35 of the font size), so "(1)" turning into "(0)" (wider in proportional fonts) does not cut the label.Cost. Each cell is garbage per pass / Lua VM instructions per pass, measured at this commit against upstream v9.9.2.
These are deterministic counts from a Lua 5.1 harness that loads the real addon files with stubbed WoW APIs. They are not timings taken in the game client, and the client's own work behind API calls such as SetText or SetPoint is not included. No in-game timing was taken.
Reading the numbers:
By design.
Known limits.
How was it tested?
python3 .tools/guardrails.pyOK.extract-locale-keys.shleaves_keys.txtunchanged (option texts are localised at runtime). deDE strings added.Screenshots
Before moving items:

After moving items:

Checklist
HookScript/hooksecurefunconly, neverSetScripton Blizzard frames: only EllesmereUI's own frames are touched, with one line inside the existingEUI_Bags:HookScript("OnHide")and one inside the bank's own OnHide.