JonasJurczok / factorio-todo-list

A distributed todo list mod for Factorio
MIT License
35 stars 21 forks source link

Some UI Quality-of-Life tweaks #183

Closed hoylemd closed 3 years ago

hoylemd commented 3 years ago

Close UIs on pressing E or Escape

Goal

Most UIs in Factorio automatically close if you open another UI or press E or Esc. Unfortunately, the UIs from this mod do not, so they always have to be manually closed. The goal is to improve this mod's usability by conforming to that convention.

I also made it so that the edit dialog's title field gets focus when it's opened, same as with the add dialog.

Questions/Feedback request

I manually tested this a bunch, and all of the edge cases (detailed in the README) were identified and resolved entirely on my own judgement, which is far from perfect. I'm looking for feedback on how I handled those edge cases, as well as my implementation in general. I'm not really a Lua developer, so I've probably made some rookie mistakes.

I also didn't touch the tests at all. I would like to add some automated tests for this, but as I said, I have almost no Lua experience (in fact, all of the Lua code I've written is in this repo :p), so I didn't want to get rabbit-holed on that. I do plan to add some when I get around to learning about how the tests here work, but I wanted to get this code in front of somebody else for review ASAP.