Skip to content

Conversation

@OnkarRuikar
Copy link
Contributor

@OnkarRuikar OnkarRuikar commented Aug 31, 2025

Issues

The PR addresses the following issues in the playground:

  1. In a freshly loaded playground, after clearing, it doesn't auto-run the code.

2. After clearing, the report message(Seeing something inappropriate?) toast doesn't go away.
3. The report message doesn't go away after closing the report dialog.
4. There is no close/dismiss button on the report toast/banner.

Solution

  • For the first issue, when the clear button is clicked, set the _autoRun and runOnChange variables.
    - For the second issue, use ${this._gistId && this._showReportToast condition and hide the toast message on clear button click.
    - For the third and fourth issues, define a new toast element named MDNToast to show dismissable messages. Toasts are lightweight, dismissible notifications.

Related issues and pull requests

Fix #663

@caugner
Copy link
Contributor

caugner commented Sep 1, 2025

@OnkarRuikar Thank you for taking the time to work on these changes.

For all the issues that you're addressing in this PR, and that don't have an issue yet, can you please create one? I think they should first go through triage, before we can accept fixes.

That said, if you could extract the fixes for #663 into a separate PR, that would be great to land that fix earlier.

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimmed over the changes, and left some comments here and there.

this._reportToastHide();
controller.clear();
this._autoRun = true;
controller.runOnChange = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably happen as part of controller.clear().

Suggested change
controller.runOnChange = true;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@OnkarRuikar OnkarRuikar marked this pull request as draft September 2, 2025 07:47
@OnkarRuikar
Copy link
Contributor Author

For all the issues that you're addressing in this PR, and that don't have an issue yet, can you please create one? I think they should first go through triage, before we can accept fixes.

Created separate issues:

That said, if you could extract the fixes for #663 into a separate PR, that would be great to land that fix earlier.

Let's fix #663 here itself and rest of the stuff in separate PRs after triages there.

@OnkarRuikar OnkarRuikar marked this pull request as ready for review September 5, 2025 10:39
@OnkarRuikar OnkarRuikar changed the title fix(playground): update report and clear features fix(playground): set auto run on clear Sep 5, 2025
@OnkarRuikar OnkarRuikar requested a review from caugner September 5, 2025 10:40
@caugner caugner merged commit 2fd268b into mdn:main Sep 5, 2025
6 checks passed
@OnkarRuikar OnkarRuikar deleted the pg_clear branch September 7, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clear in shared Playground doesn't clear properly

2 participants