stride3d / stride3d/stride

UNDO script asset create can lose data if file is unsaved

Open
#681 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-GameStudio bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: official 4.0.0.1 beta 2 0926
Version: official 4.0.0.1 beta 2 0926
Platform(s): Windows

Describe the bug

Xenko UNDO has separate contexts for the project assets, and each text-editor, which leads to non-intuitive behavior when trying to use the built-in editor... If focus is accidentally not in the editor, pressing undo can remove the entire file if the last action was to add the script, which is non-intuitive and dangerous if the file is not saved.

To Reproduce
Steps to reproduce the behavior:

  1. add a script
  2. edit the contents of the script (and dont save)
  3. click in the solution explorer
  4. press undo (ctrl-Z)
  5. WITNESS: it removes the script from the project, blowing away edits

Expected behavior

EXPECTED: Xenko to show a warning before removing an unsaved script file asset.

Additional context

Pretty much other editor environment I use (such as visual studio) has a single global UNDO stack.. which means if you press undo, it will remove the last action you did globally in the application, regardless of your focus context. It's very very non-intuitive that in Xenko, if you change the focus and undo, it will undo different things.

In itself, this is not necessarily a problem.. but if you can accidentlaly undo a scrip asset create, that causes the removal of a script asset, without a warning dialog.. that's a problem.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named in the issue. Start by reproducing the undo sequence in the Xenko editor, then trace the project-asset and text-editor undo contexts. Done means undoing an unsaved script asset creation warns before removal and does not silently discard edits.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.