Feature: Need to add “Show More” / “Show Less” toggle in Note.#77446
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Thanks @t-hamano For the review. Further, I have handled some more of edgecase. The overall functionality is like below,
Let me know if there are any other edge cases needs to be handled, I guess most of them are covered. Thanks, |
t-hamano
left a comment
There was a problem hiding this comment.
This PR works well for me.
@Mamaduka @adamsilverstein, Are there any better approaches besides using element.scrollHeight > element.clientHeight to detect element overflow and display a button?
|
@t-hamano, I'll try to do a proper review later. I think some of the logic can be simplified/derived. But without design feedback, I think final reviews are low priority, since we're not sure what the end product will be. |
|
Nice work! Good feedback has already been given, worth following. Some of the nuance embedded in this is: we have this design to consider:
But this button is not the same. This button is for when a single comment note is very long and complicated. In that sense, the PR feels fairly close. Here's a quick sketch:
Some subtle differences to the PR:
An awkward detail is that the tertiary button has left/right padding. The above mockup does not. So the text inside the button will not align with the text of the note. Probably this is fine? |
|
Unless there's a true "text only" button we can use? CC: @ciampo Edit: "Link" from |
|
cc @mirka and @jameskoster , and also mentioning #77098 as likely related. |
|
Unless the element triggers a url change I agree this should be a button. I think this is the kind of scenario we added the Unstyled variant for. |
Yes, we could try the
|
|
@hbhalodia, do you have the bandwidth to resolve the code conflicts and address the feedback? |
|
Hi @t-hamano, Thanks for the ping! Yes I have some bandwidth today. I will resolve the conflicts and address the feedbacks to use the unstyled variant of the button as mentioned here - #77446 (comment) Apologies on getting this missed! |
|
@hbhalodia Thanks for the update. This PR is working well and appears to be ready for release from my end. @jasmussen @Mamaduka Do you have any feedback? |
|
I love the idea of this enhancement and the code looks fine, but in my local testing I couldn't get it working correctly (running Gutenberg and WordPress trunk). Maybe I am missing something, I'll give it a shot agains 7.0 as well. |
adamsilverstein
left a comment
There was a problem hiding this comment.
code looks good, but I didn't see the more/less feature in my testing for some reason.
It would be great to add some e2e tests or storybook story to verify this works as expected... |
this was user error, its working for me now. |
|
Hi @t-hamano, I have fixed the deprecated tokens and used the new ones. We can forward this PR. Thanks, |




What?
Closes #72822
Why?
show more and show lessexactly as how google docs commenting works for larger notes.How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Screen.Recording.2026-04-17.at.3.13.53.PM.mov
Use of AI Tools