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

Missing updates after Tab switch / position desync #201

Closed
luposmi opened this issue Jan 22, 2025 · 3 comments
Closed

Missing updates after Tab switch / position desync #201

luposmi opened this issue Jan 22, 2025 · 3 comments
Labels
type:bug Something isn't working

Comments

@luposmi
Copy link
Contributor

luposmi commented Jan 22, 2025

Description

If you tab out of the browser window and then move inside vim, the position is not updated.
However, if you then move inside of vim, unless you go into a new element, the browser tab
does not jump to the new position.

To Reproduce

I use firefox.

  1. Open file with large element, e.g., this. Then go to the bottom of the page.
  2. Tab out of the window
  3. go into the large html table
  4. Tab back
  5. Now, if you move inside the html table, your position is still not updated. You need to move out of the element and back into it for that to happen.

Some logic would be needed to check for desync on the browser because the tab is no longer open.
Idk if its worth to fix, propably anoying with little use, just wanted to share it.

Context

My operating system is:

linux, firefox browser

Running viv --version outputs:

vivify-server v0.6.4-1-g4afd46e

I installed Vivify in the following way (e.g. name of the package manager, self-compiled or development mode):
pacman, self-compiled

This is what happens when I kill any running instance of Vivify with killall vivify-server and then run vivify-server at the absolute installation path (e.g. at command -v vivify-server) instead of viv and try to reproduce the problem:
idk why thats important
In the following I specify if I use any custom configuration, and if so provide it in its entirety including any additional files referenced there (e.g. CSS or JavaScript):

@luposmi luposmi added the type:bug Something isn't working label Jan 22, 2025
@luposmi
Copy link
Contributor Author

luposmi commented Jan 22, 2025

Oh, and in complete off-topic fashion, would maybe be nice to delete the broken file. Built it, ran into the issue, installed supported nodejs version, said everything is fine but did not build the file as it thought it's already there.

Here is a patch of what I mean:

diff --git a/Makefile b/Makefile
index c69ed39..b8e29d0 100644
--- a/Makefile
+++ b/Makefile
@@ -76,6 +76,7 @@ $(SERVER_PATH_LINUX): $(BUNDLE_PATH) sea-config.json
                { \
                printf "\n\n\x1b[1;31mYour $(shell command -v node) does not support Node SEA, which is needed to compile Vivify.\x1b[0m\n"; \
                printf "\x1b[1;31mPlease install Node.js through Node Version Manager (nvm) and try again.\x1b[0m\n"; \
+               rm $(SERVER_PATH_LINUX)
                exit 1; \
                }
        chmod +w $(SERVER_PATH_LINUX)

@jannis-baum
Copy link
Owner

Good idea about the Makefile! Feel free to open a PR for that ^^

The other thing I'll look into later

@jannis-baum
Copy link
Owner

Hello! I kind of forgot about this, sorry about that.

I checked it out now and it seems like it's a Firefox bug. I can reproduce it as you described in Firefox but it works in Safari without problems. Adding console.log's into the case 'SCROLL': in static/client.mjs confirms that the scroll functions are called correctly in Firefox but the browser doesn't react.

Since this is a pretty minor edge case and probably Firefox's fault I won't try and find some hack to solve it and instead just close the issue. If this is important to you, feel free to look for a solution yourself and reopen this, I'll accept a PR :)

@jannis-baum jannis-baum closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants