software-mansion / react-native-ide

https://ide.swmansion.com
Other
705 stars 21 forks source link

Avoid closing IDE accidentally #390

Closed kewinzaq1 closed 2 days ago

kewinzaq1 commented 1 week ago

Problem

Currently, there is a chance of accidentally closing the IDE panel and it can be an unpleasant experience

Solution

Simple confirmation popup to avoid headaches. The following popup only appears if users click cmd+w/ctr+w https://github.com/software-mansion/react-native-ide/assets/77052270/70c45f35-9d89-4b99-ad97-9f69e0cbc96e

https://github.com/software-mansion/react-native-ide/issues/387

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 26, 2024 4:31pm
kewinzaq1 commented 3 days ago

@kmagiera Thanks for the review. I tried to go withonDidChangeActiveTextEditor however I ended up checking the active state  this._panel.active before the update had happened, so I moved to the direct method on the panel; onDidChangeViewState allows for avoiding this problem pretty straightforwardly. What do you think about this approach?