Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Edit in Playground #72

Closed
wants to merge 16 commits into from
Closed

Add Edit in Playground #72

wants to merge 16 commits into from

Conversation

jamesnw
Copy link

@jamesnw jamesnw commented Jul 17, 2024

Original Design:
https://xd.adobe.com/view/84c872fe-0e51-46e4-a59c-f72aab2b8c6a-d19b/

I decided to not show a link if there are multiple sections of code, for instance on the @use page. Those examples require a importing and a file system, which isn't supported.

Todo:

  • Design

@jamesnw jamesnw linked an issue Jul 19, 2024 that may be closed by this pull request
@jamesnw
Copy link
Author

jamesnw commented Jul 19, 2024

@mirisuzanne or @stacyk This is ready for design

Copy link

netlify bot commented Sep 3, 2024

Deploy Preview for sass-site-oddbird ready!

Name Link
🔨 Latest commit 91b6441
🔍 Latest deploy log https://app.netlify.com/sites/sass-site-oddbird/deploys/66da102d82910000086a024b
😎 Deploy Preview https://deploy-preview-72--sass-site-oddbird.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mirisuzanne mirisuzanne removed their assignment Sep 3, 2024
@jamesnw jamesnw requested a review from jgerigmeyer September 5, 2024 14:30
@jamesnw
Copy link
Author

jamesnw commented Sep 5, 2024

@jgerigmeyer I think this is ready for a code review

@stacyk stacyk removed their assignment Sep 5, 2024
source/assets/sass/components/_playground.scss Outdated Show resolved Hide resolved
Copy link
Member

@jgerigmeyer jgerigmeyer left a comment

Choose a reason for hiding this comment

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

Looks good! Three questions:

  1. Visually, the "Edit on Playground" text looks bigger than what I see in the mockup. Should it be the same size as the Sass/SCSS/CSS tabs?
  2. The rectangle background on hover over "Edit on Playground" looks a bit strange to me, but I guess that's based on the existing link hover pattern. Maybe it will look better if the font size is a bit smaller.
  3. On narrower screens, do we want to hide the "Edit on Playground" link when the CSS tab is selected? Right now it opens the playground with the code in whichever style (Sass or SCSS) was most recently selected -- which is probably okay?

Screenshot 2024-09-05 at 3 19 53 PM

source/helpers/components/codeExample.ts Outdated Show resolved Hide resolved
source/_includes/code_examples/code_example.liquid Outdated Show resolved Hide resolved
Comment on lines 39 to 40
state: Partial<PlaygroundState> &
Pick<PlaygroundState, 'inputFormat' | 'outputFormat' | 'inputValue'>
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be simplified?

Suggested change
state: Partial<PlaygroundState> &
Pick<PlaygroundState, 'inputFormat' | 'outputFormat' | 'inputValue'>
state: Pick<PlaygroundState, 'inputFormat' | 'outputFormat' | 'inputValue'>

Copy link
Author

Choose a reason for hiding this comment

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

Hmm, that was so the function could be called with the whole state or a subset, but I can't track down where the whole state was being passed, so I took your suggestion.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, makes sense. I think the entire state is passed in earlier in this same file, but I also think TS allows extra properties on objects as long as the specified ones match.

@jgerigmeyer
Copy link
Member

I decided to not show a link if there are multiple sections of code, for instance on the @use page. Those examples require a importing and a file system, which isn't supported.

This makes sense to me, but we should probably draw Natalie's attention to this and see if she has another proposal.

Copy link
Member

@jgerigmeyer jgerigmeyer left a comment

Choose a reason for hiding this comment

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

🚀

@stacyk
Copy link
Member

stacyk commented Sep 5, 2024

Looks good! Three questions:

  1. Visually, the "Edit on Playground" text looks bigger than what I see in the mockup. Should it be the same size as the Sass/SCSS/CSS tabs?

@jgerigmeyer Good call, I updated it to match the tab size better.

  1. The rectangle background on hover over "Edit on Playground" looks a bit strange to me, but I guess that's based on the existing link hover pattern. Maybe it will look better if the font size is a bit smaller.

You are right, these are the link hover styles minus the bottom border. I think it looks better smaller, and I thought it probably did need to look a bit different from the tab styles since it does a different thing than the tabs.

  1. On narrower screens, do we want to hide the "Edit on Playground" link when the CSS tab is selected? Right now it opens the playground with the code in whichever style (Sass or SCSS) was most recently selected -- which is probably okay?

I think I still like the edit link shown even if on a css panel. There's still sass there, even if not shown at the moment.

@stacyk
Copy link
Member

stacyk commented Sep 5, 2024

The hover stat isn't working for me anymore in Chrome... hold off on merging for a bit

@stacyk
Copy link
Member

stacyk commented Sep 5, 2024

The hover stat isn't working for me anymore in Chrome... hold off on merging for a bit

Nevermind, was an issue with my browser. Proceed if/when ready

@jamesnw
Copy link
Author

jamesnw commented Sep 5, 2024

Moved to sass#1167

@jamesnw jamesnw closed this Sep 5, 2024
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.

Playground- Open examples in playground
4 participants