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

Update copy plugin #2580

Merged
merged 2 commits into from
Dec 21, 2024
Merged

Conversation

Incogdino
Copy link
Contributor

@Incogdino Incogdino commented Dec 20, 2024

Previously, copy plugin does not indicate a response when the code block is copied. A more informative response can help improve user experience when copying the code block.

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:
This PR closes #2579.

The copy button lacked response when copying from a code block. An added response such as a tick can improve the systems feedback to the user making it slightly more enjoyable to use.

Anything you'd like to highlight/discuss:

Testing instructions:
nil

Proposed commit message: (wrap lines at 72 characters)
Update copy plugin

Previously, copy plugin does not indicate a response when the code
block is copied. A more informative response can help improve user
experience when copying the code block.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

Previously, copy plugin does not indicate a response when the code
block is copied. A more informative response can help improve user
experience when copying the code block.
@yucheng11122017
Copy link
Contributor

Hi @Incogdino this is great work! Thanks for the contribution. Definitely an interesting and helpful UI change.
Sorry for being particular but could you revert the white spaces changes you made that doesn't actually affect the code? This is just to make it easier for us to read. I'll review it once you are done! Do ping me after

Also another point to consider is if we should allow a user to disable this if they want.. but this can be discussed in another issue since the user SHOULD want this in the first place (and is very minor change to their UI)

@Incogdino
Copy link
Contributor Author

Hi @Incogdino this is great work! Thanks for the contribution. Definitely an interesting and helpful UI change. Sorry for being particular but could you revert the white spaces changes you made that doesn't actually affect the code? This is just to make it easier for us to read. I'll review it once you are done! Do ping me after

Also another point to consider is if we should allow a user to disable this if they want.. but this can be discussed in another issue since the user SHOULD want this in the first place (and is very minor change to their UI)

@yucheng11122017 thanks for the review. I have changed the indent back to 4 spaces and alphabetize the attributes I added. I'm a bit unsure about the indentations for the css file since the css coding standard stated on the dev guide suggested an indentation of 2 spaces.

Allowing users to choose whether they want to enable this feature is a great point too!

Copy link
Contributor

@yucheng11122017 yucheng11122017 left a comment

Choose a reason for hiding this comment

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

Hi @Incogdino Thanks for the great work! LGTM :) We can discuss disabling this in another issue. Was also thinking about adding a notification (which I think is quite common) saying copied!

This is from leetcode which I think is quite nice:
https://github.com/user-attachments/assets/c6e4ede6-4dec-44ad-8cc7-e605bbb4b2b7

@yucheng11122017 yucheng11122017 merged commit b566c46 into MarkBind:master Dec 21, 2024
8 checks passed
Copy link

@yucheng11122017 Each PR must have a SEMVER impact label, please remember to label the PR properly.

Copy link

Welcome, @Incogdino! 🎉 Thank you for your contribution to the MarkBind project!

@yucheng11122017, please remember to add @Incogdino as an official contributor to our repository.

See the full list of contributors here. ✨

@yucheng11122017
Copy link
Contributor

@all-contributors please add @Incogdino for code

Copy link
Contributor

@yucheng11122017

I've put up a pull request to add @Incogdino! 🎉

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.

Have code blocks show more UI details/ be more responsive
2 participants