Making the code block collapsible in the v2 editor

Mat Kamil
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 22, 2019

Is there a way to make the code block collapsible in the v2 editor? i can't find an option for it, and it needs to be collapsible, since the json im putting in there is 6000 lines long

17 answers

1 accepted

6 votes
Answer accepted
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 26, 2019

Hello Mat,

Thank you for bringing this up. It's not yet possible while we roll about the new editor, but we have a feature request below that would include that:

  • CONFCLOUD-66437 Allow further customization of the "Code" macro in the new editor

Please vote on the feature request and you will be automatically added to the list of watchers.

As a workaround, you might want to attach the code in a text file with a preview snippet using the code block macro.

Let me know if you have any further questions about that.

Regards,

Shannon

Deleted user February 5, 2020

@Shannon S Hi there -- it looks like I can no longer insert the Code block macro in confluence pages....and thus cannot make collapsible...is this true?

Like smingolelli likes this
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 6, 2020

Hi Colin,

Welcome to Atlassian Community! It's nice to meet you.

The Code macro has replaced the original Code Block macro. The Code Block Macro was the one that has the ability to collapse, the Code macro does not.

The feature request I shared with Mat earlier would hopefully include a collapsible option for the new Code macro.

Can you confirm that you're able to insert the Code macro using the slash / command in the new editor?

Regards,

Shannon

Like smingolelli likes this
Alexandra Mihaltan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 11, 2020

This should not be classified as feature suggestion, it should be a bug because it is very frustrating to use the editor v2 when it lacks in such a trivial functionality like collapsibility and this was preset in v1.

Like # people like this
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 11, 2020

Hi Alexandra,

Thank you for following-up on this thread. I agree that the Code macro is definitely lacking in comparison to the Code Block macro.

However, the Code macro is a different macro entirely, thus the feature request for the missing capabilities that were offered in the former Code Block macro. 

There are multiple other missing features in the new version of the editor, so if you encounter anything else you find that is sorely lacking, you can compare with our Confluence Cloud Editor Roadmap to see if it's a feature we plan to include in the future.

Take care,

Shannon

Like # people like this
dmitry_popov
Contributor
February 17, 2020

As a workaround for a shitty new editor, I've put a code block inside an "Expand" element.

Like # people like this
Tom Kremer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2020
They still have code blocks in the comments though!

But they don't expand...

Like # people like this
Dylan Frankland
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2020
nice
Like # people like this
Darina Voloshyna
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 13, 2020

Doesn't even let me to put the code snippet inside the expand block :facepalm:

Like # people like this
Inara Rukmane May 23, 2020

@Darina Voloshyna may I ask if you managed to solve this issue? As I have faced the same now :( cannot add  code  inside  expand block

darina_v
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 23, 2020

It is working only if it is not inside the table or other element. Just the expand block in a root of the document, and code block inside of it. But doing so inside the table won’t work :(

Like # people like this
Inara Rukmane May 23, 2020

Thanks for prompt response @Darina Voloshyna !

P.S.: that's a pity to hear though (((

Steve Sparkes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 26, 2020

Not being able to remove line numbers makes my table of functions look horrible

Like # people like this
Eric Wehrly
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 28, 2022

We're over 3 years out from the initial ask. I'd say this is normal for Atlassian, but it's actually advanced. Here, they've decided to close both issues asking (so far), this implying the finality in the reduced feature set of our "upgrade".

As usual, it feels like Atlassian is begging for competition that somehow hasn't shown up yet.

Like # people like this
Mark Baijens
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2023

I was able to use the code block inside an expanable block which worked great.

Matt Kentala
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 25, 2023

However, it still doesn't work when the expand macro is used within a table.

Chue Vang August 7, 2024

regarding
"However, the Code macro is a different macro entirely, thus the feature request for the missing capabilities that were offered in the former Code Block macro. "

Yes we do this all the time.  Replace a useful macro, with a piece of junk.  Then any attempt to get the features of the useful macro back is a feature request.  Obviously our users are so familiar with our low level macros or even components, they should understand this.  I mean... gosh one macro is different from another macro.  Did you all know that?  What you are asking for features and don't care that they are different macros, UNHEARD OF! 

18 votes
Peter Colclough
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 29, 2020

Just adding my voice... collapsible code blocks were really useful... kept a page legible... people see a huge long page.. they dont read... if they dont read they give up and dont learn.

Needs to go in.. seriously needs to go in 

 

)

Connor White March 30, 2022

couldn't agree more. They are obviously not in sync with their users

Like # people like this
9 votes
Rob Overell
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 16, 2021

Atlassian remove existing functionality as part of upgrade.  Users request to fix, results in a feature "suggestion".  2 years later they are still considering it.

Fireman lights a house on fire.  The occupant calls to the fireman for help.  Fireman commences thinking about what should happen next...

In case it isn't clear, we are the occupants of the house that is on fire.  Atlassian, are you even listening any more?

7 votes
Stephen Sykes
Contributor
January 20, 2021

OMG - it keeps getting worse.  Formerly I used the code in an expand block workaround, now this does not work in tables.

Way to drive it into the ground, Atlassian!

Steve Wright
Contributor
October 26, 2021

I just ran into this same problem. Its ridiculous.

Like # people like this
7 votes
Rickson Kuriakose
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 14, 2020

Checking in August; any updates on this yet?

5 votes
Marco Lackovic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 6, 2020

Checking in October 2020, any updates on this yet?

The question is:

  • how do we make a code block collapsible in the new editor?
Tom Loden
Contributor
October 6, 2020

Update? No Atlassian doesn't appear to care. The only solution I am aware of is to put a code macro inside an expand macro.

Like # people like this
Tom Loden
Contributor
October 6, 2020

And why was this "Solved"? They still haven't fixed anything.

Like # people like this
3 votes
Rasanka Jayawardana
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 4, 2021

+1 They have managed to remove the most useful feature...

Rasanka Jayawardana
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 4, 2021

And marked the feature request as solved :(

Like # people like this
3 votes
Hale Xie
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 21, 2020

It is bad to remove a good feature when upgrading something

3 votes
Tom Loden
Contributor
April 2, 2020

Why Atlassian take it away?  That's stoopid.

Truong Van Tan Dat
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 9, 2020

agree.

Like # people like this
2 votes
Tatsiana Harakhovich
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 11, 2021

The same, doesn't work in tables, when trying to put code block into expand block.

Tazo Lezhava October 9, 2022

Same, works outside the table but not inside the table, I wonder if there is a report specifically for this.

1 vote
Liad Ben Ari
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 23, 2023

If this is solved, why is it still not working
I want a table to have a collapsible code block

Atlassian why are you doing this to me???

1 vote
dakulig
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 21, 2021

It is still not even taken into consideration (gathering interest) - please vote for it, maybe they'll eventually hear the plea...

https://jira.atlassian.com/browse/CONFCLOUD-72003

Yet still long way to go...

image.png

1 vote
Sebastian Gurlt July 13, 2021

Juli 2021 ... Still waiting for this.

Confluence / @Shannon S any news on that?

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2021

Hi Sebastian,

Thank you for your reply. I looked into the request, and as of April, there's an updated version of this request. This includes the requirement for collapsible code blocks. 

You can follow that here:

  • CONFCLOUD-72003 Allow further customization of the "Code" macro in the new editor (Different background color & ability to collapse the code block)

  Thank you again for your feedback, and take care.

Shannon

1 vote
Muhammad Umer Farooq
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 26, 2021

Is the code block collapsable workaround? why did they mark it as solved? It's frustrating!!!

0 votes
pablo.lunavelasco@plexus.es
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 4, 2023

It shouldnt be a problem. Redmine and other markdown tools have this functionality apparently with simplicity:
[[collapse(show,hide)
text to collapse
]]

Why this is so complicated to atlassian?

0 votes
Chris O'Neil
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 9, 2020

This is clearly a bug.  Any significant technical design requires large code blocks but without the collapse feature, the document becomes TL;DR  - this is a bad dog moment for atlassian :-(

BTW
I discovered if one has an older document that used the older code block macro, it is possible to copy that document and with it will be capability to include the older code block macro with the collapse feature.

0 votes
Kaushik G
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 15, 2020

This is a very good feature to have it removed

Chue Vang August 7, 2024

o.o.o I know!  create a plugin and charge $$$ for it

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events