Skip to content

feat(playground): share button#141

Merged
Princesseuh merged 12 commits into
bruits:feat/share-buttonfrom
HiDeoo:hd/feat/share-button
Jul 3, 2026
Merged

feat(playground): share button#141
Princesseuh merged 12 commits into
bruits:feat/share-buttonfrom
HiDeoo:hd/feat/share-button

Conversation

@HiDeoo

@HiDeoo HiDeoo commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR continues the work started in #84 (and targets it) about adding a share button to the playground.

Most of the feature was implemented in the previous PR, so this PR mostly builds on top of that. As suggested, the Rust playground was used as a reference for the implementation, where the URL is never updated to avoid a potential confusion for the user having to guess if it's updated live or not or mess with the history.

Here is a summary of some of the changes made in this PR:

  • Move the button to the sidebar as the initial position in the tab bar was confusing and not very discoverable.
  • The feedback of the copy button after a successful copy was improved to be more visible and accessible.
  • An alert bar was implemented to surface various errors to the user, which can optionally be dismissed.
    • An alert is shown when we fail to copy the share link to the clipboard but still provide the link so it can be manually copied
      SCR-20260702-ldvx
    • An alert is shown when we fail to restore the playground state
      SCR-20260702-leeh
    • I added size limits to both compression and decompression and an alert is shown when a limit is exceeded
      SCR-20260702-lezi
    • The Sätteri version is now saved in the state and we show an alert when the version of the playground state is different from the current version (fake screenshot where I inverted the condition so version numbers are identical in the message)
      SCR-20260702-lfvk
  • When restoring a playground that includes scripts and these scripts are not the default ones, we no longer compile them automatically (as they could do anything) and we show an alert to the user for them to review them and choose to either dismiss or run them.
    SCR-20260702-lglz

Happy to drop anything that you don't like or want, change anything, add missing things, or drop the PR entirely if you think it's not good.

A few notes:

  • I tried to match as much as possible the existing code to minimize the changes (but some parts are meh imo)
  • I'm not the best when it comes to UI and colors
  • I had formatting issues for TS and CSS files in the website/ directory so I only committed formatted code that I changed and ignored formatting changes for the rest of the code I did not change. I'll investigate that later
  • A potential missing feature is schema versioning that I did not add to this PR. I thought it could be done if the schema is ever changed in a breaking way

@Princesseuh Princesseuh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me :)

@Princesseuh Princesseuh merged commit c64162e into bruits:feat/share-button Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants