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

chore: merge shellbox into codebox #5425

Merged
merged 10 commits into from
Jul 13, 2023
Merged

Conversation

araujogui
Copy link
Member

@araujogui araujogui commented Jun 12, 2023

Description

Merge Shellbox into Codebox

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npx turbo lint to ensure the code follows the style guide. And run npx turbo lint:fix to fix the style errors if necessary.
  • I have run npx turbo format to ensure the code follows the style guide.
  • I have run npx turbo test to check if all tests are passing, and/or npx turbo test:snapshot to update snapshots if I created and/or updated React Components.
  • I've covered new added functionality with unit tests if necessary.

@vercel
Copy link

vercel bot commented Jun 12, 2023

@araujogui is attempting to deploy a commit to the OpenJS Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jun 12, 2023

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

Name Status Preview Comments Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2023 11:34pm
nodejs-org-stories ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2023 11:34pm

@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories June 12, 2023 19:34 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories June 12, 2023 19:35 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories June 12, 2023 20:15 Inactive
@mikeesto mikeesto mentioned this pull request Jun 14, 2023
5 tasks
@ovflowd
Copy link
Member

ovflowd commented Jun 14, 2023

Can on dark theme the button to have this background and colour?

image

Also, the "copy" text should be "copy" not "Copy" or we can use a Copy emoji/icon from React Icons (I rather the emoji/icon!)

@ovflowd
Copy link
Member

ovflowd commented Jun 14, 2023

Also what about the selected option also have a darker colour? (Screenshot below with the change)

image

The colour is --dark5

@ovflowd
Copy link
Member

ovflowd commented Jun 14, 2023

Also if we use an icon for the copy/paste button instead of text (which I think is better) we need to remove the translation. (And also change the width of the button)

@AugustinMauroy
Copy link
Member

Personally -1 for the icons on button. Copy is more explicit that an icons. Then there's nothing specific about the design system.

@ovflowd
Copy link
Member

ovflowd commented Jun 14, 2023

Personally -1 for the icons on button. Copy is more explicit that an icons. Then there's nothing specific about the design system.

A copy icon is a very standard practice. Is actually the most common thing done out there. (Example from Next.js docs)

image

@ovflowd
Copy link
Member

ovflowd commented Jun 14, 2023

Like something like this
image

But maybe floating or hmmm

@AugustinMauroy
Copy link
Member

With more padding and small increase of size and ok

@ovflowd
Copy link
Member

ovflowd commented Jun 14, 2023

My screenshot was just an example. Ideally the way of the Next.js docs would be great. But we don't have a designer, so...

@AugustinMauroy
Copy link
Member

I'm learning design with Figma. Are you interested by I mock-up ?

@ovflowd
Copy link
Member

ovflowd commented Jun 14, 2023

I'm learning design with Figma. Are you interested by I mock-up ?

Thanks, but we don't need that for now. The Foundation is also in talks on providing a Designer, so that's awesome news.

@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories June 18, 2023 18:52 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories June 18, 2023 23:54 Inactive
@shanpriyan
Copy link
Contributor

shanpriyan commented Jun 25, 2023

Also, the "copy" text should be "copy" not "Copy" or we can use a Copy emoji/icon from React Icons (I rather the emoji/icon!)

+1 for using an copy emoji

@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories June 26, 2023 22:39 Inactive
@araujogui araujogui marked this pull request as ready for review June 26, 2023 22:58
@araujogui araujogui requested a review from a team as a code owner June 26, 2023 22:58
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories June 26, 2023 22:58 Inactive
Copy link
Member

@mikeesto mikeesto left a comment

Choose a reason for hiding this comment

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

Nice work. The unit tests are failing atm, I think we just need a new snapshot.

It's also kind of annoying that the $ is copied for shell. If it's not fixed in this PR, I think it would be good to create a new issue for it.

@ovflowd
Copy link
Member

ovflowd commented Jun 28, 2023

cc @araujogui any updates here?

@ovflowd
Copy link
Member

ovflowd commented Jun 28, 2023

Also, @araujogui can we create a prop that allows us to disable the "header" of the Codebox (like hideHeader), which hides the language label? Like the screenshot below

image

Also when the header is hidden the copy button should only appear when hovering and should be inline with the code like in the screenshot below,

image

@ovflowd
Copy link
Member

ovflowd commented Jun 28, 2023

Also on Light Mode, the copy button background feels weird. It doesn't fit. It should be a lighter green variation.

image

chore: delete shellbox component

chore linting

test: create textToCopy tests

feat: wip

feat: add copied icon

feat: fix colors

fix: increase copied timeout

feat: add aria label

refactor: remove shellbox i18n

refactor: linting

fix: some colors

test: fix copy find

chore: update snapshot

fix: lighter copy button

feat: add hideheader prop

feat: trim and remove $

chore: fix linting

chore: update snapshots

fix: button display
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 12, 2023 23:30 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org July 12, 2023 23:31 Inactive
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

LGTM! Fantastic work you've done here. Also, the pair programming sessions were super insightful!

This component looks way better and the new design is stunning!

@vercel vercel bot temporarily deployed to Preview – nodejs-org July 12, 2023 23:34 Inactive
@vercel vercel bot temporarily deployed to Preview – nodejs-org-stories July 12, 2023 23:34 Inactive
Copy link
Member

@mikeesto mikeesto left a comment

Choose a reason for hiding this comment

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

Great work

@bmuenzenmeyer
Copy link
Collaborator

It's also kind of annoying that the $ is copied for shell. If it's not fixed in this PR, I think it would be good to create a new issue for it.

Yeah I've seen a technique where it's visually present but not copy-able. And in case people don't know (because I didn't forever), the prompt does serve some purpose, if however small, in showing that sudo is not needed.

@ovflowd
Copy link
Member

ovflowd commented Jul 13, 2023

Well this PR fixed the $ issue but only for $.

Maybe what we need in the future is a field called prefix that allows us to add non-cooyable pieces

@AugustinMauroy
Copy link
Member

I’m still not fan of Lang button. I propose to glue them and use an separator like |

@ovflowd
Copy link
Member

ovflowd commented Jul 13, 2023

I’m still not fan of Lang button. I propose to glue them and use an separator like |

Please open the latest version of Storybook before commenting this.

@AugustinMauroy
Copy link
Member

In lasted version of storybook it’s isn’t glue

@ovflowd
Copy link
Member

ovflowd commented Jul 13, 2023

@araujogui a tiny bug the third one should not have left border-radius and the second one should.

image

@ovflowd
Copy link
Member

ovflowd commented Jul 13, 2023

In lasted version of storybook it’s isn’t glue

image

Yes, they are. Or what do you mean with "glue" if this is not what you're referring to?

@AugustinMauroy
Copy link
Member

7B674B7D-0818-43A9-B21A-DE9C1E6D6911

idk but it’s render like that on my phone

@ovflowd
Copy link
Member

ovflowd commented Jul 13, 2023

image

It is working as expected on my "mobile" viewport. @araujogui are you able to reproduce this?

@AugustinMauroy can you tell me which browser you're using?

@AugustinMauroy
Copy link
Member

Safari lasted on iPhone 7 (I’m on lasted storybook deploy)

@ovflowd
Copy link
Member

ovflowd commented Jul 13, 2023

Safari lasted on iPhone 7 (I’m on lasted storybook deploy)

I can't reproduce this on Safari macOS, nor on Safari on my iPhone 14 Pro (iOS 17)

@ovflowd ovflowd merged commit cfb93f1 into nodejs:main Jul 13, 2023
@ovflowd
Copy link
Member

ovflowd commented Jul 13, 2023

I'm merging this as it is now, but @araujogui, can you make a follow-up PR with the tiny bug fix I've mentioned? This PR just had been sitting for so long, and we can reiterate the minor bugs on follow-up PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Requesting a new Technological Feature to be added to the Website website redesign Issue/PR part of the Node.js Website Redesign
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants