Editing component/view properties using a text editor

Hi Devs,
I’m coming from the world of traditional programmers (code), and I keep getting frustrated by various GUI issues while developing views.

We can already export views, extract their zips, edit their json file, and then re-import them. We can also write some json somewhere and then paste it into the Perspective Property Editor.

Could it be possible to streamline those processes? By having a button to edit the raw json of a view within the Designer, using something akin to the Scripting window? For extra cool points, you could even let us set our own text editor, ala. git.

ie. press “Edit as JSON” > view is exported as json to a local file and the Designer would launch our text editor with the file as an argument > user edits the file then closes the text editor > Designer imports the view back

That’d be so awesome.

If your just wanting to be able to get at the JSON quicker, from the designer you can hold down shift and right click on the view you want to edit. Then it will give you the option to “Copy JSON”. You can then paste it into a text editor to do what you want. Then copy it from there and do the same shift/right click to get to the “Paste JSON” to update your view in the designer.

Is that on the idea of what your looking for? It doesn’t launch the text editor for you but gives you quick access to the JSON file without having to fully export it and extract the zip.

Oh this is great, thank you!

Can someone give me an example of meaningful editing or authoring you can do in the JSON that is actually faster and more convenient than using the Designer?

When I’m specifying an object structure in view.params/props/custom, and when I’m mass modifying bindings :confused:

Example of what I had to do just no: I forgot to specify bidirectional on all my bindings in a view, so I need to go through each component and click like a thousand times on properties, deep-selecting containers, selecting components. Arrg!

1 Like

Okay. I was asking genuinely because I don’t have much experience actually using Perspective.

If you’re after quick mass modifications, you could also export the project (it’ll just be a .zip), unpack it somewhere, then use your tool of choice to make modifications. Bundle it back up and reimport and it’ll overwrite your local resources in the designer.

I’ll agree that this isn’t an ideal workflow, but I’ll argue that this isn’t that common of a task.

I’m personally in favor of locally editable resource files and a more first-class VCS integration, akin to what an IDE like IntelliJ might give you, but there are some hidden complexities that make it a hard sell internally.

You can always edit the resource files directly on the server? Just be aware that the gateway monitors these by default only every 5mins so you won’t see your changes for at most that time

Thank you all for your suggestions. I think I’ll be happy with the copy/paste at the view level.