Support for user scripts (Javascript)

This is a tricky feature to request, but an impactful one.

In my past life I used to work with TestRail, a QA management tool. One of its killer features was the ability to create your own UI scripts — pieces of Javascript that could be injected into specified pages and manipulate content on those pages and make API requests. For example, one of my scripts — save the test, then clone it and edit it in a single click — is still very popular there.

Supporting something like this for Coda could be huge. This would let us add extra functionality ourselves, be it different kinds of charts, in-browser encryption, or some sophisticated actions.

19 Likes

This would be really awesome to see added in! My assumption is that this would take the Coda team a long time to implement, partially because it needs to be approved and partially because there are a TON of security implications with this. From what I can tell, Coda is built on React & Redux (as far as I can tell), which means that any JS that isn’t just a data-transformation needs to be a React component that follows whatever API they have established within their code-base (which could potentially be more advanced than most people are comfortable with).

If the goal is to be able to create UI components, I think that this feature request might make more sense - I think it might make more sense for this to be a request to open-source their document UI component library rather than to support user scripts.

2 Likes

Yeah, I totally agree and I see how it’s a barely realistic feature request. Not only Coda uses React & Redux, but also has minified, seemingly webpack’d code, which is impossible to integrate with (because of minified method names and stuff). Whereas TestRail always had and still has their JS neatly organized in a non-minified fashion, and uses simple jQuery for everything front-end.

I just felt like throwing this out. I’d love any possibility to extend Coda with 3rd party plugins such as UI components and custom functions.

1 Like

I am wondering if anything like observable is possible to be implemented in coda? I.e. code blocks that can read coda data and variables and manipulate them. That would make coda an amazing system.

2 Likes

Here’s a new perspective on this:

No DOM access. Instead expose a fluent API to work with the data in the doc (get rows, get cells, enumerate columns etc), directly with the data in the doc and not through remote API calls. And that would solve all the problems in the world.

Well, it won’t solve the UI extendability, but in this last year that turned out to be not as important as the ability to quickly calculate and transform large data sets, for which I had to invent many workarounds like this. On the other hand, if this JS can use Canvas to create images and SVG to create interactive pieces, and we could insert the result of that function in a canvas or a cell — that would solve the UI extendability need as well.

5 Likes

I was trying to get at this same idea with my post here.

(deleted a bunch of text because I realized I have commented on this before. Oops!)

This year, as I have had the need for more and more power-user powers, it seems like the Coda team has moved from focusing on doc creating features to doc consumption features, which has made me start to explore other options for this same kind of work

1 Like

I think it is a good idea for developer to import npm modules from the documentation.

I would love to see a sort of plugins ecosystem emerge of third-party companies.

1 Like

My company at the moment uses Airtable, and i must admit ability to write custom JavaScripts as well as make automations trigger JavaScript code is something that proved to be very useful over time, as it helped solve some problems and more complicated user-cases that platform by default wasn’t able to support.

Also ability to write your own “app” to further extend functionality is really great (something I think Monday did really good).

1 Like

One workaround is to use Tampermonkey, though it is not the official solution. :laughing:

1 Like

Cloak.ist could be another unofficial solution - particularly if you’re trying to surface additional functionality for your users.

You may be able to code something similar by hand using Cloudflare workers if you need to be able to experiment with a lot of docs.