Make "file not found" behavior more source control friendly
- Dominant language
- C++
- Stars
- 12.9k
- Forks
- 2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 8
Description
**Is your feature request related to a problem? Please describe.**
Every time an open file is deleted or moved, Tiled pops up a dialog that requires user interaction to resolve, like this:

This gets very frustrating very quickly when you have a lot of maps open and you're working with source control. I use git, and I'm often moving between branches or commits, stashing and un-stashing changes, etc., and there's a constant cacophony of error dialog sounds from Tiled and an ever increasing stack of dialogs like the one above I have to press "OK" on before I can resume work after I'm done.
**Describe the solution you'd like**
I love the way Visual Studio Code deals with this situation. The open file gets a red color and a strikethrough on the open file tab, but otherwise nothing happens:

and if you bring the file back, it reloads it and goes back to showing it as a normal, open tab:

If you happen to be editing the file and it is removed and restored *with different changes* since you started editing it, you will be notified of this only when attempting to save your new changes:

and again, it's an important detail that this only shows up when the file being saved is *different* on disk than when the edit started. So even if you made a bunch of edits to the file behind the scenes, it'll still save just fine if the contents of it is back to what VSCode expects by the time you save, or if you deleted it.
**Describe alternatives you've considered**
Something that does work is closing all the maps before doing file operations as the editor only complains about rug pulls on open files. But it's easy to forget and a less friendly option when making on-going changes to multiple files that you like keeping open.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with several open maps while moving or deleting files through source control, then inspect the existing file-not-found handling. No file or test is named in the issue; done means missing files no longer require repeated dialogs, tabs visibly indicate the missing state, restored files reload, and conflicting edits are reported when saving.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100