Card-Forge / Card-Forge/forge

Deck Editor tabs disappear permanently after using a draft, sealed or quest editor

Open
#11,892 0 comments 0 reactions 1 assignee Claimed by @leriomaggio View on GitHub
BUG Deck Editor GUI
Dominant language
Java
Stars
2.7k
Forks
1.1k
Avg merge
1d 1h
Merged PRs (30d)
158

Description

**Describe the bug**

The Constructed Decks, Commander, Oathbreaker, Brawl and Tiny Leaders deck lists
and the Deck Gen tab are removed from the layout while a limited or quest editor
is open, and are meant to return when you leave. If the layout happens to be
saved during that window, their absence is written to `editor.xml` and they never
come back, across restarts.

The save is easy to trigger without meaning to. Clicking a tab is enough.

The only recovery is Preferences, Reset Deck Editor Layout, which also discards
whatever else the user had arranged on that screen.

**To Reproduce**
1. Home, Sanctioned Formats, Booster Draft. Start a draft.
2. During the draft, or in the deck editor that opens at the end, click between
the Deck, Statistics and Probabilities tabs in the deck pane.
3. Leave the draft and open the Deck Editor.
4. The deck list tabs and Deck Gen are gone, and stay gone after restarting.

**Expected behavior**

Leaving the editor puts the tabs back, and the saved layout keeps describing the
full Deck Editor.

**Desktop**
- OS: macOS
- Version: 2.0.15-SNAPSHOT, master at c8199da

**Additional context**

Ten controllers hide these docs in `update()` and restore them in
`resetUIChanges()`. Every deck editor screen shares
`ForgeConstants.EDITOR_LAYOUT_FILE`, `DRAFTING_PROCESS` included, so a save taken on the draft screen overwrites what the Deck Editor tab reads.

`SLayoutIO.save` serialises the live `FView.getDragCells()`, so hidden docs are
simply not written. Two ways a user triggers that save:

- `DragTab:38` attaches `SRearrangingUtil.getRearrangeClickEvent()` to every tab.
`mouseReleased` runs `endRearrange()`, and with `Dropzone.NONE`, meaning press
and release without dragging, it saves whenever the click changed the selection.
- `DragCell:74` and `:78` attach the resize listeners to `pnlBorderRight` and
`pnlBorderBottom`, 5px strips on every cell edge. Their `mouseReleased` calls
`SResizingUtil.endResize()`, which saves unconditionally, with no drag and no
guard.

Observed directly by watching `editor.xml`: four writes in twenty seconds while
clicking between Deck, Statistics and Probabilities, with the doc lists identical and only the `sel` attribute changing.

Note `loadLayout` rebuilds every cell from the file on each screen switch, so the in-memory state always looks fine. Only the save is destructive.

**Workaround**

Preferences, Reset Deck Editor Layout.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.