[2.0.14] Display panel clears unsaved changes when another GUI is opened

Things that we don't consider worth fixing at this moment.
User avatar
LCStark
Fast Inserter
Fast Inserter
Posts: 200
Joined: Thu Jan 28, 2021 5:04 pm
Contact:

[2.0.14] Display panel clears unsaved changes when another GUI is opened

Post by LCStark »

I'm editing a display panel, adding a few dozen messages to it. After going through a lot of them I don't notice that the "Edit Message" text input box isn't focussed and start typing something beginning with "T", which opens the technology tree. I press "T" again to close the research window, and I find the the "Edit Message" window has closed, but the display panel GUI is still open and all the unsaved changes in it have been removed.





Since the display panel GUI remains open after closing the research screen, I'd expect it to retain all the unsaved changes. Or if possible, prevent opening another GUI and show the unconfirmed changes dialog first.
11-03-2024, 11-54-31.png
11-03-2024, 11-54-31.png (11.41 KiB) Viewed 539 times

But another problem here is the edit message window. Would it be possible to make the text box focussed by default when opening this dialog window? I feel like it not being focussed leads to accidentally opening other menus quite often. It's easy to either not notice the input has no focus or make a mistake while quickly editing a lot of messages. Since that window's prime function is to edit a text message (and the only other function - adding an icon to the rich text edit - is only accessed via a click anyway and doesn't care about focus), I think default focus on the text box would be better here.
Attachments
factorio-current.log
(15.15 KiB) Downloaded 20 times
display_panel.mp4
(8.36 MiB) Downloaded 33 times
jyasutin
Burner Inserter
Burner Inserter
Posts: 17
Joined: Thu Nov 28, 2024 4:43 am
Contact:

Re: [2.0.14] Display panel clears unsaved changes when another GUI is opened

Post by jyasutin »

Can confirm this is still present in 2.0.21; if a dialog has a confirmation window then it should not be trivial to bypass that confirmation window. Furthermore the results are inconsistent depending on what you do due to the fact that the dialog sets some attributes immediately but delays setting other attributes.

To start:

* Place a display panel (no need for a circuit network connection).
* Open the "Display panel" dialog by clicking on the panel.
* Change the icon.
* Change the text.
* Make sure focus is not on any text box.

At this point pressing Esc opens the "Confirmation" dialog. If you agree to discard changes then the icon change persists (as it was applied immediately) but the label changes are discarded. This is surprising to a user who would expect *all* changes made in the dialog to be discarded.

Pressing "t" opens the technology tree; when you close the technology tree the Display panel dialog is still open, the label changes are discarded but the icon change persists.

Pressing Shift-L opens the logistic networks window; when you close that the display panel dialog has closed completely, the icon change persists and the label change is discarded. In general anything that causes Remote view or Blueprint library to open will close the Display panel dialog.

Some windows such as Factoriopedia and Tips and tricks do not cause the edits to be discarded.

The idea of confirming to discard changes is nice but the inconsistencies may baffle newcomers. Other dialogs of similar complexity do not confirm before discarding changes so that may further surprise newcomers.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3518
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.14] Display panel clears unsaved changes when another GUI is opened

Post by boskid »

My guts are telling my that if this would be made to save the contents to the entity without confirmation it would share fate with blueprint's "Select new content" button that is commonly complained about for doing a silent save without any confirmation. This is not a display panel specific behavior, exactly the same thing happens with... blueprint gui where you can have some pending changes (entities excluded) and opening technology gui will cancel the progress.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15013
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.14] Display panel clears unsaved changes when another GUI is opened

Post by Rseding91 »

I'm going to put this into won't-fix and say that by pressing the technology GUI button you are actively choosing to throw out any pending changes you have in the opened GUI. If you don't want that, simply don't do that.

Maybe another developer disagrees and wants to add a "you open the other GUI, this GUI, your current one has pending changes" popup, but I doubt that will be any nicer of an experience.
If you want to get ahold of me I'm almost always on Discord.
User avatar
LCStark
Fast Inserter
Fast Inserter
Posts: 200
Joined: Thu Jan 28, 2021 5:04 pm
Contact:

Re: [2.0.14] Display panel clears unsaved changes when another GUI is opened

Post by LCStark »

Rseding91 wrote: Thu Dec 12, 2024 3:39 pm I'm going to put this into won't-fix and say that by pressing the technology GUI button you are actively choosing to throw out any pending changes you have in the opened GUI. If you don't want that, simply don't do that.

Maybe another developer disagrees and wants to add a "you open the other GUI, this GUI, your current one has pending changes" popup, but I doubt that will be any nicer of an experience.
To be clear about my issue - I'm not pressing the technology GUI button, I'm pressing the T key on the keyboard because I've opened the Edit Message window and I'd expect that to be immediately focussed and let me input the message (since this is the only function of that window). But it isn't focussed by default, and pressing the T key opens the research GUI instead of typing "T" in the message window.

Having the confirmation window would be great, but I think that just making the message window focus when it is opened would solve most of the issues with the display panel. The idea for showing the confirmation message came to me because the display panel GUI remained open after opening and closing the research window, which is inconsistent with opening any other GUI (e.g. remote view) - that seems to just close the display panel GUI. But since that would have other issues, I think that doing what I added as a sort-of secondary solution and what jyasutin suggested in their post (123310) would work "good enough" to prevent accidentally erasing your edits.
Post Reply

Return to “Won't fix.”