Move export format buttons to be more accessible

Issue

When users export flows in long form to the forum, we often request they use the compact form. Then there is the inevitable "how do I do that"

Suggestion

Move the export format options (currently hidden under the JSON tab) to the top level of the dialog.

image

Thoughts? Agree? Disagree? Variations?

1 Like

Seems a good idea, can we have it far right though.
Also as we are discussing this modal is there a way to define which view you see by default, I prefer the JSON view.

2 Likes

Sounds like a good idea and would make the options more obvious.
Also agree about positioning the options at far right.

2 Likes

I agree, should be far right. Also agree re JSON. I never use the nodes view.

1 Like

Yes, better to have "compact" / "formatted" radio buttons visible all the time.

Since there is a JSON tab, it "feels" as if I have to be looking at the JSON in order to export as JSON.
But what is the value in this JSON tab? I doubt if anyone ever needs to look at it except to find the "compact" button.
So how about dispensing with the JSON tab entirely?

image

Still perfectly clear what I'm exporting. In fact it's clearer; no possible thought of two alternate export formats, JSON on the JSON tab, something unknown on the Nodes tab.

Without the JSON, the whole dialog could be made narrower too.

Edit: @dceejay posted while I was redrawing that picture...

But what do you actually use the JSON tab for, beyond clicking "compact"?

I often use it to look at configs of non installed contrib nodes.

[edit]
I never use it to click compact, as that is my user defined default in setting.js.

Not asking to remove node view, or set the system default view. Just would like a user defined default view.

Oh, I didn't know you could do that, very handy!

Still, is Export the right place for that or should double clicking on an unknown node popup an equivalent JSON view rather than the current unknown node popup?

Now I think about it, that is indeed the main reason I use the json tab :slight_smile:

1 Like

I'm all for compact being the default!

Not NR but wouldn't it be nice if when you posted a flow in the forum it was automatically compressed. If moving the export format buttons is added, we will still see people (who haven't updated to the latest version) pasting uncompressed flows...sigh!

  1. Seeing 100% support for moving the buttons to the main dialog (preference is top-right) :white_check_mark:
  2. Seeing suggestions about removing the JSON tab - I dont have an opinion other than I think that should be a separate issue/task :grey_exclamation:
  3. Seeing request for "compact" to be the default - I personally agree but will wait and see if we get any more comments (for or against) :timer_clock:
  4. Remember users choice of which view they used last time (Export Nodes / JSON)
    • Happy to put this in scope along side agreed item No1 :white_check_mark:
2 Likes

Seeing one suggestion to remove it, I for one use this view a lot and would miss it if removed.

You seem to have missed the one suggest to allow it to have user defined default view. Which also may be a separate issue/task.

1 Like

I have updated the above, but slightly changed the feature (easier to remember/restore than provide an option). If there is a real push for making that an option, then I would put it out of scope for this.

1 Like

Yep, 100%. And that is what made me do this: Remember compact/pretty flow export user choice by Steve-Mcl · Pull Request #3974 · node-red/node-red · GitHub :wink:

Yes. Remembering last used option would be good.

1 Like

I think it already does remember it, doesn't it?

Compact/formatted does.


Choice of which view does not

chrome_FlFhzvdXkq

Definitely agree.

Also, can "compact" be made the default if it isn't already? I only ever use formatted when creating examples to include in with my nodes so fairly rarely.

2 Likes

(For what it is worth)

There is a big IF for me.

When moving stuff between machines, I don't use/need the JSON option.
compact or formatted doesn't really matter.
I am moving it from one machine to another.

But when people ask for help and I post code, the JSON tab comes in handy.

And here is the IF:

If it is a big flow the compact is the way to go.

But if it is a basic flow with maybe 1 or 2 nodes the formatted helps (from the receiver's point of view IMO) that they can see what they are getting easier.

Rather than having to import it paste it, open the nodes and look at the code.
(Yeah, I'm talking about function nodes specifically)

And always having to go to the JSON tab and select either the compact or formatted is annoying.
(Sod's law that what ever I have as default: I want the other)

Thanks.
Hope that is of some worth.

1 Like

After evaluating all the feedback and suggestions, I have raised a PR: Export Nodes dialog refinement by Steve-Mcl · Pull Request #4746 · node-red/node-red · GitHub

Outline

  1. move the buttons to the main dialog (top-right) :white_check_mark:
  2. Remember users choice of which view they used last time (Export Nodes / JSON) :white_check_mark:
  3. remove the JSON tab - out of scope :x:
  4. "compact" by default :x: - no need, it is already the default

Thanks all.

6 Likes