Skip to content

Add loadout manager for copying, renaming and deleting loadouts - #10224

Open
canuysal wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
canuysal:manage_loadouts
Open

Add loadout manager for copying, renaming and deleting loadouts#10224
canuysal wants to merge 2 commits into
PathOfBuildingCommunity:devfrom
canuysal:manage_loadouts

Conversation

@canuysal

Copy link
Copy Markdown
Contributor
  • Add "Manage Loadouts" option to the loadouts dropdown, replacing "Sync"
  • Manager supports New, Copy, Rename and Delete across all four associated sets, plus double-click to activate
  • Copy creates the new loadout automatically with a unique name
  • Move Sync into the manager popup
  • Update help.txt and add tests

Description of the problem being solved:

Hey guys, long time no see!

Previous loadout management was bugging me, whenever I wanted to clone a loadout for some changes, I have to copy tree/skills/itemset/config, rename each, then sync to get a new set to play around. If I have a live build to import from poe, it means losing the subtle changes I made to the skills/items, i.e making raise zombie count 17, managing spectres (another issue on that, will send a PR soon) and so on. This fixes that by adding instant clone, new, delete and rename buttons for loadouts in a similar manage dialog as individual sets use.

Sync button is moved inside the dialog. Reason is it will be used less and less from now on, but it's still there in the dialog for backwards compatibility, organizing individual sets into one.

New Loadouts are left in the quick access menu for convenience.

Steps taken to verify a working solution:

  • Ran the busted suite via docker compose up: 525 successes / 0 failures (522 pre-existing plus 3 new loadout tests in spec/System/TestLoadouts_spec.lua, covering loadout creation, automatic copy with unique naming, and {identifier} link resolution)
  • Created a loadout via "New Loadout" and via the manager's "New" button, confirmed a tree, item set, skill set and config set are all created with the given name and that the loadout appears in the dropdown
  • Selected a loadout with customised gems and items, hit "Copy", confirmed a " (copy)" loadout is created instantly with all four sets duplicated, and that editing the copy's tree, gems and items leaves the original untouched
  • Copied the same loadout twice, confirmed the second copy is named " (copy 2)" rather than colliding
  • Renamed a loadout, confirmed all four sets are renamed on the Tree, Skills, Items and Configuration tabs
  • Renamed a loadout that uses {1} style identifiers, confirmed the identifier is preserved on each set and the loadout still resolves
  • Deleted a loadout, confirmed all four of its sets are removed, and that a set shared with another loadout (e.g. a single "Default" config set) is kept rather than deleted
  • Double-clicked a loadout in the manager, confirmed it activates and shows "(Current)"
  • Confirmed "Sync" inside the manager still rebuilds the list after renaming a set directly on its own tab
  • Saved and reloaded the build, confirmed loadouts persist (no new save data is introduced, loadouts are still derived from set names)

Link to a build that showcases this PR:

Any build would do:
https://pobb.in/H_y7eOag7gaK

Before screenshot:

image

After screenshot:

image image image image image image image image image

* Add "Manage Loadouts" option to the loadouts dropdown, replacing "Sync"
* Manager supports New, Copy, Rename and Delete across all four associated sets, plus double-click to activate
* Copy creates the new loadout automatically with a unique name
* Move Sync into the manager popup
* Update help.txt and add tests
* Add "New/Copy Custom" button, which creates a loadout choosing per set whether to start fresh or copy an existing one
* Default the choices to the currently active sets, so saving immediately copies the active loadout
* Split the per-set copy and delete logic out of Copy/Delete so both paths share it
* Add tests for copying the untitled default loadout, deleting a loadout, keeping shared sets, and resetting the dropdown selection
@canuysal

Copy link
Copy Markdown
Contributor Author

New changes, reflecting #9647

* Add "New/Copy Custom" button, which creates a loadout choosing per set whether to start fresh or copy an existing one
* Default the choices to the currently active sets, so saving immediately copies the active loadout
* Split the per-set copy and delete logic out of Copy/Delete so both paths share it
* Add tests for copying the untitled default loadout, deleting a loadout, keeping shared sets, and resetting the dropdown selection

self.selIndex = nil
self.selValue = nil
for index, loadout in ipairs(self.list) do
if loadout.specId == specId then

@mcagnion mcagnion Aug 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For identifier loadouts, specId is not unique: a tree titled Linked {A,B} produces {A} and {B} rows with the same passive tree but different linked sets. After double-clicking {B}, the active tuple remains {B}, but SyncLoadouts() rebuilds the rows and this condition selects {A}. Copy/Rename then consume {A}'s tuple, and Delete presents {A} and can remove its A-only item/skill/config sets. A focused repro observed linkId == "A" while {B} was current. Could this reselect by a stable full key (linkId plus the four set IDs, or the equivalent active tuple) rather than by passive tree alone?

AI-assisted review disclosure: This finding was identified during a review using OpenAI Codex and confirmed with a focused reproduction.

controls.save.enabled = buf:match("%S")
end)
controls.save = new("ButtonControl"):ButtonControl(nil, {-45, 70, 80, 20}, "Save", function()
local newName = controls.edit.buf

@mcagnion mcagnion Aug 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new Rename path only validates non-whitespace for non-identifier loadouts. Renaming Second to an existing First leaves two First trees; because SyncLoadouts() indexes item/skill/config sets by title, both rows resolve to the last matching tuple and the original First component sets become unresolved (not deleted). A focused repro observed exactly those 2 First rows after the rename. Could Rename reject an existing loadout name, while allowing the current name for a no-op rename, and apply the same guard to the new Custom path before any set is mutated?

AI-assisted review disclosure: This finding was identified during a review using OpenAI Codex and confirmed with a focused reproduction.


-- Every set defaults to "New"; if a loadout is selected in the manager, its sets are
-- preselected instead so they can be kept or swapped out one at a time
local selected = self.selValue

@mcagnion mcagnion Aug 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Opening the manager does not select a row, so self.selValue is nil here and all four dropdowns intentionally remain on the New sentinel. Manage → New/Copy Custom → Save therefore creates four fresh sets instead of copying the active tuple as explicitly described in the PR and help text; a focused test observed four nil selection IDs instead of the four active IDs. Selecting a row does preselect that highlighted row, but that is different from the documented active-tuple default. Could these selectors initialize directly from the active tree/item/skill/config IDs, with an explicit row selection overriding them afterward?

AI-assisted review disclosure: This finding was identified during a review using OpenAI Codex and confirmed with a focused reproduction.

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