Skip to content

Refine Auto-save notification #877

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

Merged
merged 11 commits into from
Nov 6, 2018
Merged

Refine Auto-save notification #877

merged 11 commits into from
Nov 6, 2018

Conversation

van800
Copy link
Member

@van800 van800 commented Nov 2, 2018

No description provided.

@van800 van800 self-assigned this Nov 2, 2018
Copy link
Member

@citizenmatt citizenmatt left a comment

Choose a reason for hiding this comment

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

Looks ok, but is a Unity console message better than a Rider notification?

Perhaps the Rider notification could have a hyperlink that causes the plugin to display the settings?
Or we just automatically set the do-not-compile-during-play-mode flag and show a Rider notification saying so with a link to show settings?

And one thing that would be really nice is a "learn more" link to take us to the wiki with more details.

@@ -156,6 +156,9 @@ private static Version TryGetUnityVersionFromDll(XmlElement documentElement)
return null;

var filePath = FileSystemPath.Parse(referencePathElement.InnerText);
if (!filePath.IsAbsolute)
Copy link
Member

Choose a reason for hiding this comment

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

If it's not absolute, does that mean it's relative to the project file? Can we use that to try to resolve it and continue?

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately I don't have repro. Just Exception https://youtrack.jetbrains.com/issue/RIDER-21237

@van800
Copy link
Member Author

van800 commented Nov 3, 2018

I am rewriting it back to Notification in Rider. In progress.

@van800 van800 closed this Nov 5, 2018
@van800 van800 force-pushed the 183-auto-save-notification branch from 9594465 to 6aeb7a3 Compare November 5, 2018 10:09
@van800 van800 reopened this Nov 5, 2018
@van800
Copy link
Member Author

van800 commented Nov 5, 2018

Rewrote it from scratch, could you please review again @citizenmatt ?
image

@van800 van800 changed the title [WIP] Refine Auto-save notification Refine Auto-save notification Nov 5, 2018
Copy link
Member

@citizenmatt citizenmatt 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. Suggested some changes to the text.

It would be really cool if the text would include links that changed the setting:

Unity play mode script compilation

Unity is currently configured to compile scripts during play mode, and Rider's auto save is currently enabled. This can cause unwanted loss of state in the running game.

Change Unity to:

You can also change this manually in the $tabName tab of Unity's Preferences.

Do not show this message again

I would actually like to take this further, and have Rider to automatically set it to "Recompile After Finished Playing" and then show a notification that says "we've changed this, because of auto save. Here's how to change it back". This would be a good default for people that don't read notifications.

What do you think?


val message = "Auto save is enabled in Rider. This can cause unwanted recompilation and the loss of current state during play mode." +
"<br/>* Consider changing the <i>Script Changes While Playing</i> in Unity Preferences $tabName tab." +
"<br/>* <a href=\"doNotShow\">Do not show</a> this notification for this solution."
Copy link
Member

@citizenmatt citizenmatt Nov 6, 2018

Choose a reason for hiding this comment

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

This wording worked better when it was shown inside Unity's console tab. If we're displaying a notification in Rider, we should say:

Unity play mode script compilation

Unity is currently configured to compile scripts during play mode, and Rider's auto save is currently enabled. This can cause unwanted loss of state in the running game.

  • Consider changing the Script Changes While Playing in the $tabName tab in Unity's Preferences.
  • Do not show this notification again for this solution.

Learn more

See if you can use <ul><li>…</li></ul> for the bullet points instead of asterisks.

Copy link
Member

Choose a reason for hiding this comment

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

And add a "learn more" link

Copy link
Member Author

Choose a reason for hiding this comment

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

If it is so good default for everybody, why then Unity hasn't used it by default.
I think that if you write a proper Unity-way code, then even in PlayMode you can reload scripts without problems.


val generalSettings = GeneralSettings.getInstance()
if (generalSettings.isAutoSaveIfInactive || generalSettings.isSaveOnFrameDeactivation){
val autoSaveNotification = Notification(notificationGroupId.displayId, "Unity: scripts reload while Playing", message, NotificationType.WARNING)
Copy link
Member

Choose a reason for hiding this comment

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

Set the title to "Unity play mode script compilation"

@van800
Copy link
Member Author

van800 commented Nov 6, 2018

image
Does it look good?

@citizenmatt
Copy link
Member

Nice! Do we want to show the notification for all solutions? The setting is application wide, isn't it?

@van800
Copy link
Member Author

van800 commented Nov 6, 2018

This setting is frontend one. I am not changing the way it is implemented. It changes something in .idea folder.

@van800
Copy link
Member Author

van800 commented Nov 6, 2018

Notification may be shown when protocol gets connected.

@van800 van800 merged commit eac4f70 into 183 Nov 6, 2018
@van800 van800 deleted the 183-auto-save-notification branch November 6, 2018 18:46
@citizenmatt citizenmatt added this to the Rider 2018.3 milestone Nov 26, 2018
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