sanity-io / sanity

Sanity Studio – Rapidly configure content workspaces powered by structured content
https://www.sanity.io
MIT License
5.28k stars 426 forks source link

Slow input keystroke lag in Studio #7456

Closed eldoy closed 2 months ago

eldoy commented 2 months ago

Describe the bug

Every keystroke is slow and laggy in Sanity Studio. I'm quite a fast typist, and this totally makes the user experience terrible. It seems like every keystroke is synced to the cloud?

To Reproduce

Type fast in any text input field and it lags.

Expected behavior

Absolutely no lag.

Which versions of Sanity are you using?

@sanity/cli (global) 3.56.0 (up to date) @sanity/eslint-config-studio 4.0.0 (up to date) @sanity/vision 3.56.0 (up to date) sanity 3.56.0 (up to date)

What operating system are you using?

Darwin v2.local 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 21 21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 x86_64

Which versions of Node.js / npm are you running?

10.8.2 v20.17.0

FancyJeff commented 2 months ago

Experiencing this also, this issue is particularly bad when interacting with an object nested within the portable text editor.

thomasm commented 2 months ago

Same here. The keystroke lag is very noticeable, especially when typing in text fields within items in my page builder array.

jordanl17 commented 2 months ago

Hi, @eldoy - thanks for highlighting this issue.

Are you experiencing this only when running the studio locally, or also on a deployed studio?

eldoy commented 2 months ago

@jordanl17 It's just as bad for both. Keep holding backspace and it's even more evident. I'm having a hard time recommending Sanity to my clients when such a basic annoyance exists. Are you not seeing it?

jordanl17 commented 2 months ago

@jordanl17 It's just as bad for both. Keep holding backspace and it's even more evident. I'm having a hard time recommending Sanity to my clients when such a basic annoyance exists. Are you not seeing it?

@eldoy apologies you are experience such poor performance. We are aware of some rendering issues and are continually trying to work through these. We have some high priority improvements in the works right now, which it looks like will directly help mitigate the issues you've encountered. These should be released shortly in the coming week/s. Please ensure you are always on the latest studio to capture these improvements when they drop.

We recently released v3.37.0 which includes an upto x10 speed improvement although this change only affects when running in dev mode. For prod slowness, our team are actively pursuing improvements. Apologies again for the frustrating experience you've seen- hopefully the fixes will rectify this for you.

runeb commented 2 months ago

@eldoy @FancyJeff @thomasm As Jordan said; sorry that you are experiencing this and we are currently working on improvements which specifically target increased typing performance. We have other reports that echo your findings, that in certain Studios there can be very noticeable lag when typing quickly or holding backspace.

Would you mind letting us know whether you have any plugins installed in your Studio? If so, which are they and are they custom input components? Are they also used/registered for fields within portable text?

eldoy commented 2 months ago

@runeb It's a very basic studio based on your templates with zero plugins.

FancyJeff commented 2 months ago

@eldoy @FancyJeff @thomasm As Jordan said; sorry that you are experiencing this and we are currently working on improvements which specifically target increased typing performance. We have other reports that echo your findings, that in certain Studios there can be very noticeable lag when typing quickly or holding backspace.

Would you mind letting us know whether you have any plugins installed in your Studio? If so, which are they and are they custom input components? Are they also used/registered for fields within portable text?

Happens in both deployed and local studios for me. I have the presentation, media and assist plugins enabled. All of the inputs are out of the box sanity inputs.

The issue outside of portable text is slow but objects within the portable text its almost unusable to the point I am waiting for the text to catch up to me.

runeb commented 2 months ago

@eldoy @FancyJeff Thanks for confirming! If you are blocked on this peformance regression, downgrading to 3.50.0 should improve performance for you while we work on fixing this issue

runeb commented 2 months ago

@eldoy @thomasm @FancyJeff Please see https://github.com/sanity-io/sanity/releases/tag/v3.57.1 for a version that addresses this

FancyJeff commented 2 months ago

@eldoy @thomasm @FancyJeff Please see https://github.com/sanity-io/sanity/releases/tag/v3.57.1 for a version that addresses this

Thanks, this has definitely improved the input speed a bunch. I am still seeing some (much less) lag of an string input inside an object in a portable text. Might be worth including this in the bench marking.

Also to note its much worse in firefox than it is in chrome so for people who have this issue make sure you are using chrome.

Thanks for the quick release :)

runeb commented 2 months ago

@FancyJeff Thanks for confirming! And yes, there are still performance challenges to tackle and that work continues

josh-padnick commented 2 months ago

This comment from @FancyJeff exactly matches our experience:

Thanks, this has definitely improved the input speed a bunch. I am still seeing some (much less) lag of an string input inside an object in a portable text.

In fact, making a trivial string edit takes a full 3 seconds to finish saving and propagating to the page, and I'm on a MacBook M1 Pro.

Just to highlight the criticality here, we were starting to question our choice of CMS given this editing experience and wondering why there weren't more complaints online. We assumed the UX would be real-time editing where as you type, you see the updates instantly, so the multi-second delay is pretty jarring. As a user, this feels like it's on the level of "the brakes in this car don't work right." Even downgrading to 3.50.0 still had sluggish performance for us.

Thanks for taking this seriously. ('cc @panzacoder)

Update: Here's a video demonstration of the lag while running 3.57.1. https://www.loom.com/share/3e021251c2aa4592a6517eb1a7083d3b.

eldoy commented 2 months ago

Tried the 3.57.1 update, didn't see any difference... Still border-line unusable. I mean, if there's anything at all you should fix, it would be this. Editing, the core of your product, is basically broken imho.

I would be fine with an option to disable the sync while typing, I just don't want to be annoyed by this when I'm in the process of creating content.

thomasm commented 2 months ago

@eldoy @thomasm @FancyJeff Please see https://github.com/sanity-io/sanity/releases/tag/v3.57.1 for a version that addresses this

Thank you for looking into it. It seems to have improved slightly now for me at least. There's still a small delay with each keystroke, but it's now manageable to write and delete text in the fields without too much frustration. :)

panzacoder commented 2 months ago

Pulled iin the 3.57.1 update and has improved the local dev experience significantly. I think there is improvement to be made still but this has made it much more workable.

Additionally we did some testing of our prod studio (we are still very much in development, so this hadn't been used yet) and the experience was fine even without the update.

Will keep an eye on the performance and report back if we experience issues again or identify specific pain points.

CC: @josh-padnick

runeb commented 2 months ago

@josh-padnick @eldoy Sorry to hear you are still having latency issues!

I want to clarify that our recent release and my comments above address poor responsiveness of the form fields themselves, meaning lag from typing till seeing your typed characters in the field. This is unrelated to live preview of a website.

The live preview feature is called visual editing and there is a separate latency involved from editing content and till seeing it in the website preview.

If you are still having issues with the first scenario - laggy field inputs - then this is the best thread to provide more information. A Loom or reproduction description on latest version would be very helpful.

For the second scenario, I suggest that the https://github.com/sanity-io/visual-editing repository is a great place to discuss any latency issues regarding the website preview feature.

HarunIO5 commented 1 month ago

Hi, I am having this slow input lag in my dev studio, I have tried sanity@3.57.1 and @3.60.0, it didn't help at all. I have used Sanity for a previous client recently and it worked fine, but now it's totally unusable.

I am not sure why this is happening but it looks like whenever I try to type it is constantly syncing and saving, is there any way to stop the auto-sync?

eldoy commented 1 month ago

@runeb Are you not seeing the issue though? It's obviously not just me, just type in any field and it's laggy, should be visible immediately. As long as I'm paying for this product, I'm not spending time recording a video, I'll just use another CMS instead.

HumidBrains commented 3 weeks ago

How come this issue is closed when it never got solved? My problem is the same as described by others and in fact, this problem has existed now for at least a year. We are building a commercial product on top of Sanity, but if the most basic core functionality (inputting and editing text) doesn't work, we're not able to launch. @runeb I'm afraid your many tries to fix this have not been very successful so far, what do you suggest your users/customers do meanwhile your team is (hopefully) working on a solution? Btw I'm on the latest version 3.61.0 and the problem concerns string inputs, portable text and custom string inputs. The lag seems to be slightly worse when in a modal (almost unusable), than it is on a normal pane (painfully slow still).

lukepearce commented 3 weeks ago

I'm also experiencing this painful UX running a very basic studio inside a Next.js app during local development. I can't recall it being like this when I was running it standalone (locally too!)

Update: I deployed to Vercel today and there is no lag when typing