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

Fix: The Copy button of the PostURL shouldn't be placed in the slug input #63706

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

Rishit30G
Copy link
Contributor

@Rishit30G Rishit30G commented Jul 18, 2024

What?

Fixes #63700

Why?

As a user, one would expect the Copy button to copy the value inside the input field, because that's what the UI shows

How?

Change the first parameter in the useCopyToClipboard hook to / + postSlug from permalink

Testing Instructions

  • Create a new post
  • From settings change permalink to Post Name
  • Now go back to the post and on the right panel click on the value part of Link
  • Copy the value of the slug by pressing the copy button
  • Verify that the value now copied is the slug and not the link to the post

Testing Instructions for Keyboard

Same as above

Screenshots or screencast

Screen.Recording.2024-07-18.at.8.59.40.AM.mov

Copy link

github-actions bot commented Jul 18, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Rishit30G <[email protected]>
Co-authored-by: afercia <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Jul 18, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Rishit30G! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Mamaduka Mamaduka requested a review from afercia July 19, 2024 06:27
@afercia
Copy link
Contributor

afercia commented Jul 19, 2024

@Rishit30G thank you for your PR. Sorry I wasn't clear. I didn't suggested to change what is copied.
I meant that the Copy button is misplaced. It should be moved close to the value that is actually copied: the full permalink shown below the input field.

Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

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

See comment.

@afercia afercia added the [Type] Bug An existing feature does not function as intended label Jul 19, 2024
@Rishit30G
Copy link
Contributor Author

Rishit30G commented Jul 19, 2024

Hey @afercia!
Thanks for sharing your feedback and insights 🙇
Let me know if this is what was expected:

Screen.Recording.2024-07-19.at.11.00.44.AM.mov

&#8599;
</span>
</a>
<div>{ suffix && <Suffix>{ suffix }</Suffix> }</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

is the <div> necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, as I'm using space-between in styling so it was needed

@@ -12,4 +12,9 @@ export type ExternalLinkProps = {
* The URL of the external resource.
*/
href: string;
/**
* Allows for markup other than icons or shortcuts to be added to the menu item.
Copy link
Contributor

Choose a reason for hiding this comment

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

This description should be adjusted, as this component isn't s 'menu item'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, can you suggest a better description
Thanks

Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Yes, this is how the Copy button should be placed. I left some comments, please have a look. I don't think the Input control and the input base components should be changed.

@afercia
Copy link
Contributor

afercia commented Jul 23, 2024

Note: the unit tests are failing because other components e.g. NumberControl use the suffix to add the Increment button. The Suffix prop and component should not be removed from the input control and input base components.

@Rishit30G
Copy link
Contributor Author

Hey @afercia,
Thanks for sharing your feedback, I have reverted back the changes in the Input Control and Input Base component
Additionally, I have left few comments as well in response to your suggestions
Appreciate your time and efforts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Copy button of the PostURL shouldn't be placed in the slug input
2 participants