adam
adam•5mo ago

Convex dashboard suggestion (DX)

It would be great to have the "Edit Document" view auto subscribe to document updates, so I don't need to re-open the edit document preview window each time I make a change.
8 Replies
ballingt
ballingt•5mo ago
Do you imagine it would be live until you edit it, and then freeze? Right now it's frozen the whole time, but it could live update right up to when you type a character? It's difficult to edit something that is changing out from under you, but it makes sense that if you're not editing it it would be nice to see the updates live.
adam
adamOP•5mo ago
It would be good to have the view refreshed when the browser tab/window is refocused or window clicked. Maybe a simple "refresh" button may be an option too, or shortcut key.
adam
adamOP•5mo ago
Some visual indicator of freshness would also be helpful, something like this.
No description
ari
ari•4mo ago
Hey @adam, we have a feature that's a bit early, but it allows you to view and edit one or multiple documents you've selected in a new way. This view is live, meaning the fields will update as long as you're not actively editing a field. It needs a bit more polish before we ship to everyone, but I've turned it on for your account. Try it out and let me know what you think 🙂
adam
adamOP•4mo ago
Hi @ari thanks for sharing this. I like the intention of where you are going with the multi-document edit, as this would help with ensuring documents are valid when making changes to schema design during development. However, I much prefer the existing JSON view of the document for the following reasons: - It allows me to easily copy and paste parts of the JSON to other systems or convex documents. - It gives much more control over changing nested JSON objects (and arrays). - Empty values such as null can be more easily represented and are not confused with empty string values. - The data type of the JSON field is more explicit and clear. - JSON view is more compact and readable on a laptop screen compared to the UI input approach. This is feedback from what I can see from the video you have posted. I don't seem to see this new UI on my account - though I would prefer to stick with the current UI for now and not have this updated UI applied. In addition to the current JSON view of the document, it would be nice to have a check box toggle to wrap the JSON property names in quotes, so that it's valid JSON and improves compatibility with other tools such as https://app.quicktype.io and JSON comparison tools.
{
name: "John",
age: 12
}

// to

{
"name": "John",
"age": 12
}
{
name: "John",
age: 12
}

// to

{
"name": "John",
"age": 12
}
My hunch is that most devs would prefer the JSON view, while no-code devs may prefer the input based UI.
ari
ari•4mo ago
Thanks for the feedback, I agree with your thoughts about editing data as JSON! Rest assured, the existing UI to add and edit documents is not going away. The new view is an addon, and in our latest set of changes, we added the ability to resize and hide it. I'll look into why the UI isn't showing up for you, but if you don't want it at all, we can keep it off for you until it's fully polished and all early feedback has been addressed Nice point about having the documents default to quotes, noted
adam
adamOP•4mo ago
Ok, good to know. Re my original post around having the "Edit Document" JSON view subscribe to updates: One approach to address @ballingt 's concern of the doc changing from under you while editing it, could be to disable the subscription to updates if the form is dirty (essentially the same logic that is being used now for the disabled/enabled "Save" button). I would find this feature helpful. Not necessarily as default, because it becomes more tedious to add fields. Potentially on copying of the document or when the entire document text is selected a toggle to wrap with quotes would be nice. I can now see this new UI in my account @ari - its working better than I was expecting it would. I'll collect my feedback over the coming days.
ari
ari•4mo ago
Glad to hear that and looking forward to your feedback! Some form of being notified if an edited document in the js editor seems right, and we’ve filed that to look at in the future; this new panel happened to already be in development

Did you find this page helpful?