dart-lang / dart-pad

An online Dart editor with support for console, web, and Flutter apps
https://dartpad.dev
BSD 3-Clause "New" or "Revised" License
1.7k stars 551 forks source link

Code Loss After Page Navigation in Asynchronous Programming Exercise on DartPad #3043

Open babinnepali opened 3 weeks ago

babinnepali commented 3 weeks ago

Change Intent

To improve the user experience by ensuring that code written in DartPad during exercises is preserved even after navigating to external links or other documentation pages.

Justification

Losing code when navigating between pages can be frustrating and disrupts the learning process. Preserving the user's work in DartPad will make the learning experience more productive and less frustrating.

Impact

This change will enhance the usability of DartPad in documentation exercises by preventing loss of code, leading to a more seamless and productive learning experience.

Mitigation

To mitigate the issue, consider auto-saving the code in DartPad when a user navigates away from the page, or warn users before they leave the page that their code will be lost if they proceed.

Change Timeline

Since this is an enhancement rather than a deprecation, an immediate or near-future implementation would be ideal to improve user experience.

Associated CLs

This is a new issue being reported, so there may not be any associated CLs yet.

dart-github-bot commented 3 weeks ago

Summary: Users are losing their code in DartPad when navigating to external links or other documentation pages during asynchronous programming exercises. This disrupts the learning process and makes the experience frustrating.

lrhn commented 3 weeks ago

I too have lost code to mistaken clicks, like pressing "back" accidentally (didn't release Alt soon enough before pressing Left-cursor).

The "old DartPad" kept the current text in some local storage, so that navigating away from the page and then back would preserve the content. Don't know if it was a cookie or a database, also doesn't matter, as long as it's the current text when I get back to the page.

I used to like prototyping in DartPad, for the quick turnaround, but I've started to avoid using it because of the risk of losing work. Definite UX degradation.