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

line break toggle covers code block content #1425

Open
n1ru4l opened this issue Mar 28, 2024 · 6 comments
Open

line break toggle covers code block content #1425

n1ru4l opened this issue Mar 28, 2024 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@n1ru4l
Copy link
Member

n1ru4l commented Mar 28, 2024

line break toggle covers code block content

image

@dimaMachina
Copy link
Collaborator

dimaMachina commented Mar 29, 2024

I remember you already submitted similar issue in v2.
In v3 I

  • moved copy code button in code block title
  • removed blured background
  • added transparent bg instead, similar how to docusaurus does

What’s your proposition to fix?

@dimaMachina dimaMachina added the question Further information is requested label Mar 29, 2024
@n1ru4l
Copy link
Member Author

n1ru4l commented Mar 29, 2024

Possible options are

  • hide completely
  • collapse both buttons into an expandable context/dropdown menu

@dimaMachina
Copy link
Collaborator

hide completely

disagree, useful feature, especially on mobile

collapse both buttons into an expandable context/dropdown menu

I think it's too overcomplicated for only 2 actions


As an another idea we can do approach similar as GitHub do but we'll lose some 44px for code-block content

image

@n1ru4l
Copy link
Member Author

n1ru4l commented Mar 30, 2024

I rarely use the copy and line-break toggle on my phone, so I disagree that a context menu would be too complicated.

How often do people copy a code snippet on mobile, for me it makes most sense on a desktop where you want to run the example? It might be an acceptable trade-off to hide that button and only display the line break toggle.

The code area is already quite small due to all the vertical spacings, so the latter seems suboptimal.

Reducing the size of the buttons in the header and placing them next to each other could also be a possibility.

@dimaMachina
Copy link
Collaborator

dimaMachina commented Mar 30, 2024

How often do people copy a code snippet on mobile, for me it makes most sense on a desktop where you want to run the example? It might be an acceptable trade-off to hide that button and only display the line break toggle.

this is true, we already show Word wrap button only on mobile, so we can hide Copy button from mobile and put Word wrap there

Will be more minimalistic too for mobile devices

The code area is already quite small due to all the vertical spacings, so the latter seems suboptimal.

true too

Reducing the size of the buttons in the header and placing them next to each other could also be a possibility.

We can try to see how it looks like, but I would stay with putting word wrap button on copy button place

Accepted to be fixed in Nextra directly!

@dimaMachina dimaMachina added enhancement New feature or request help wanted Extra attention is needed and removed question Further information is requested labels Mar 30, 2024
@dimaMachina
Copy link
Collaborator

dimaMachina commented Mar 30, 2024

@n1ru4l I've just thought that github approach will be perfect since if code block doesn't contain filename, copy code button will be in code block and not in its filename (and covering issue will still persist), so we can leave copy-code for mobile for now (since github has it on mobile too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants