code-block-pro icon indicating copy to clipboard operation
code-block-pro copied to clipboard

Code Block Collapsing Feature

Open tanmb opened this issue 1 year ago • 2 comments

Are there plans to add a code block collapsing feature in the next update?

tanmb avatar Oct 01 '24 09:10 tanmb

I don't have plans for that in the next version but it's something I want to add eventually. I need to do a major update which includes some breaking changes, and plan to start focusing on that in the coming weeks. It might be awhile though. I don't have a timeline.

KevinBatdorf avatar Oct 01 '24 12:10 KevinBatdorf

Hi @KevinBatdorf, I did a round of testing of your wonderful Code plugin. I used the Enable frontend max height feature quite a bit, and wondered if there could be a add-on to have a similar overlay to the "See more text" overlay, that says "Collapse" and revert to "see more feature" just on the frontend.

bph avatar May 09 '25 12:05 bph

Do you mean so that it returns back to the shorter height? I think it should be pretty easy to impliment. I'll look into it this weekend.

KevinBatdorf avatar May 09 '25 14:05 KevinBatdorf

Yes. Exactly. Oh, that would be wonderful 👏

bph avatar May 09 '25 14:05 bph

I just made a release with this feature :) Let me know if you have any issues using it

KevinBatdorf avatar May 11 '25 13:05 KevinBatdorf

Hi there, Kevin... That's awesome! Thank you! You can see it in action in this post

When you collapse it, you, however, lose your place on the post... I expected to get back to the vicinity where jumped off when used the "Click to see more" button..

bph avatar May 11 '25 17:05 bph

Good point. Thanks for that feedback. Let me look into that

KevinBatdorf avatar May 12 '25 02:05 KevinBatdorf

I have a PR here with an update. I think it works ok but I can check again on your page after you update it. I can make a release in a day or two also, but if you want you can get a build here (that won't have any issues updating).

Build (at the bottom of the page) https://github.com/KevinBatdorf/code-block-pro/actions/runs/14967719452

PR: https://github.com/KevinBatdorf/code-block-pro/pull/362

KevinBatdorf avatar May 12 '25 08:05 KevinBatdorf

Thank you Kevin. I'll give it another try tomorrow.

bph avatar May 12 '25 09:05 bph

The PR seems to do the trick nicely! It a great experience now on the front end. Thank you, @KevinBatdorf for making the modification so fast. 🎉

@tanmb Does that work for your use case as well?

bph avatar May 14 '25 14:05 bph

This should be live in a few minutes. I'll go ahead and close this issue but feel free to reopen or leave a comment @tanmb if you were looking for something else :)

Thanks @bph for the push to implement it and feedback.

KevinBatdorf avatar May 15 '25 11:05 KevinBatdorf