Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

positioning of built in slide editor wrong #1573

Open
gureckis opened this issue May 6, 2024 · 6 comments
Open

positioning of built in slide editor wrong #1573

gureckis opened this issue May 6, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@gureckis
Copy link

gureckis commented May 6, 2024

Describe the bug
When opening the slide editor in Safari 17.4.1 (Sonoma 14.41) and also Chrome (124.0.6367.119) the slide editor spacing and alignment is off. When it is in "sidebar mode" it actually appears below the slide.

Screenshot 2024-05-06 at 10 26 09 AM

When it is in "dock to bottom" mode, it doesn't actually go down to the bottom but sort of hang with a lot of white space below.

Screenshot 2024-05-06 at 10 26 16 AM

In the first case it should just go to the right side of the window. In the second case it should probably align to margin-bottom: 0; and either fill all the space or give more room to the slide letter boxing.

To Reproduce
Steps to reproduce the behavior:

  1. open the slide deck
  2. click the "Show editor" menu item
  3. Toggle either "Dock to right" or "Dock to bottom"

Desktop (please complete the following information):

  • OS:Sonoma 14.41
  • Browser:Safari 17.4.1/Chrome (124.0.6367.119)
  • Slidev version:v0.49.0-beta.6
@KermanX
Copy link
Member

KermanX commented May 6, 2024

Thanks for your report. I've noticed this strange behavior before, but I can't reproduce this now. Could you share the data in the local storage (con be found in the "application" panel in Chrome DevTools) when the bug happens?

@KermanX KermanX added the bug Something isn't working label May 6, 2024
@gureckis
Copy link
Author

gureckis commented May 6, 2024

Sure here is an example:

Screenshot 2024-05-06 at 11 47 34 AM

I had one strange situation where it was messed up in Safari and I opened Chrome to the same URL and suddenly everything snapped into place in both browsers. I can't understand how that could happen and maybe I'm going crazy (can't repeat it) but thought to mention.

@KermanX
Copy link
Member

KermanX commented May 6, 2024

I had one strange situation where it was messed up in Safari and I opened Chrome to the same URL and suddenly everything snapped into place in both browsers. I can't understand how that could happen and maybe I'm going crazy (can't repeat it) but thought to mention.

Thanks for your information! According to this, I can remember something now. IIRC, this issue is because some UnoCSS classes are missing.😢

@gureckis
Copy link
Author

gureckis commented May 6, 2024

Actually just replicated it. First, I opened the editor in Safari and it displays wrong. Next, I opened chrome pointing it at the same localhost URL (http://localhost:3030/). Suddenly the Safari editor snapped into place in the background. Perhaps the CodeMirror editor rewrites something on the server side when it connects to chrome?

Screenshot 2024-05-06 at 11 52 15 AM

@KermanX
Copy link
Member

KermanX commented May 6, 2024

Actually just replicated it. First, I opened the editor in Safari and it displays wrong. Next, I opened chrome pointing it at the same localhost URL (http://localhost:3030). Suddenly the Safari editor snapped into place in the background. Perhaps the CodeMirror editor rewrites something on the server side when it connects to chrome?

If the UnoCSS class controls the grid layout is not loaded, the editor will be in the wrong place. And after the page is opened in another browser, somehow the UnoCSS class is loaded in the server, and the old page can also receive the class.

@gureckis
Copy link
Author

gureckis commented May 6, 2024

interestingly doesn't appear to be a problem on Arc browser (1.41.0).

UPDATE: I was wrong it affects ARC too, oddly intermittently. However I found a reliable fix:

  • If in ARC, I choose "clear Cookies and refresh" the tool bar goes back to working correctly.
  • Then if I stop and and start the Vite process (npx) and reload then the page goes back to broken.
  • If I choose "clear cookies and refresh" it goes back to working.

There doesn't appear to be any cookies set by the program so I believe this is resetting local storage.
I checked the values in local storage and they don't seem to be changed by resetting. So I think it is something like
"if there is local storage already set at the time the Vite process launches then there is an error in rendering, if local storage is cleared/doesn't exist then the page loads correctly"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants