Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve run instances UX: avoid removing data and add a clear popup. #99649

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

ckaiser
Copy link
Contributor

@ckaiser ckaiser commented Nov 24, 2024

Improves the experience of using the "Run Instances" dialog by not aggressively resizing the internal structures, I was bitten by this multiple times when testing things that require multiple instances with different parameters: If I have the dialog set up with 4 instances with different parameters but I want to run two instances temporarily for a different test, lowering the number deletes all the data in the rows that are gone, so when I go back to the old number I'd have to set it up again.

To make it a bit easier to remove things if, for example, the user creates a ton of different params and wants to go back, I've added a right click menu with the option to clear a single line in the tree or to clear everything, I think that should cover the more common use cases.

Here's a video of it in action:

behavior_demo.mp4

@ckaiser ckaiser requested a review from a team as a code owner November 24, 2024 19:22
@Calinou Calinou added this to the 4.x milestone Nov 24, 2024
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally, it works as expected.

However, when you restart the editor, all instances are back to the highest number of instances you've ever defined.

This means that for example, if you create 2 instances (having 3 in total), fill their arguments, reduce the instance count to 1, save and restart the editor, you'll see all 3 instances again once you restart the editor. This applies even after using right-click > Clear All.

@ckaiser
Copy link
Contributor Author

ckaiser commented Nov 25, 2024

Had to add a new project metadata entry to keep the value, because before we were just relying on the size of the list's size for the instance count field, but since now we're keeping all the data it's not really possible to do this without storing the number somewhere.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 27, 2024

When you clear an item, its arguments will travel one below.

godot.windows.editor.dev.x86_64_xqAA8F61Pa.mp4

@ckaiser ckaiser force-pushed the run-instances-data branch 2 times, most recently from d964996 to bbc7d5a Compare November 27, 2024 20:04
@ckaiser
Copy link
Contributor Author

ckaiser commented Nov 27, 2024

😅 silly mistake, fixed and rebased.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Looks good.

@akien-mga
Copy link
Member

akien-mga commented Nov 28, 2024

I think it's an improvement, but I find it a bit weird that some information is kept but not visible to the user. And the overall UX of having to decrease the number in the SpinBox which then removes lines with important configuration was IMO always subpar.

How about instead doing something like this:

  • Remove the SpinBox, and add a "Add Instance" button that adds a new entry to the tree (could be similar to the "Add Element" buttons in the Inspector for array/dictionary editors.
  • Add a first column with a checkbox to enable the instance.
  • Add a Delete icon and possibly a Move button, again similar to the array/dictionary editors.

So you can have e.g. 4 instances configured, and just check the ones you want to be active. This also makes it easier to have various presets for different configurations and test them separately without having to rewrite things in a specific order.

My only minor concern is that there's already two "[ ] Enabled" columns and having a 3rd one might not make clear at glance what each checkbox affects, but IMO that would still be a net improvement compared to both the current status, and the implementation in this PR.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 28, 2024

Instance counter makes it easier to tell how many instances will start.
Maybe we can keep the SpinBox, but set its max value to number of added instances. The "Add Instance" button could work.
This would also allow to implement deleting of instances, as currently you can only do Clear All to remove extra stored data.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

This is fine for now but I still think we should improve the UX further as I suggested in a comment.

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Dec 17, 2024
@akien-mga akien-mga merged commit 45d8c21 into godotengine:master Dec 17, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@ckaiser
Copy link
Contributor Author

ckaiser commented Dec 17, 2024

Oh that took me by surprise, I was already working on the improved version but I'll take my time and do a new PR 😄

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

Successfully merging this pull request may close these issues.

4 participants