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

new-log-viewer: Requesting next page switching too frequently can cause the view to jump back to a previous page. #64

Closed
junhaoliao opened this issue Sep 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@junhaoliao
Copy link
Member

Bug

#54 added a Monaco editor instance and page switching can be achieved via keyboard shortcuts.

It was found that requesting the next page too frequently can cause the view to jump back to a previous page.

yscope-log-viewer version

fefbff7

Environment

Windows
Node.js 22 which runs the dev server
Microsoft Edge Version 129.0.2792.12 (Official build) stable app, beta channel (64-bit)

Reproduction steps

  1. Launched dev server and loaded an example file (refer to Add support for loading files, decoding them as JSONL, and formatting them using a Logback-like format string. #46).
  2. Held down Ctrl + ] on the keyboard to request next page switching multiple times in a short period.
  3. Observed pageNum changed from 1 -> 2 -> 3 -> 4 -> 3 -> 2 or a similar pattern where the view jumps back to a previous page although only "next" pages are requested.
@junhaoliao junhaoliao added the bug Something isn't working label Sep 1, 2024
@junhaoliao
Copy link
Member Author

@davemarco
Has this been fixed by #76 ?

@davemarco
Copy link
Contributor

My intuition is that this is not fixed by #76, in normal use, we prevent this by locking the ui arrow buttons. I don't believe we provide the same support for key buttons. I will need to eventually confirm this with testing

@Henry8192
Copy link
Collaborator

Your intuition is right; it is true that we don't lock the key bindings during fast loading. But in state context provider, we are using pageNum for PREV_PAGE calculation, and the worst case is that we the keybinding triggers multiple PREV_PAGE calculation and loads the same page for a few times, which I think in this case is acceptable.

@Henry8192
Copy link
Collaborator

Nevertheless, I'll create a new issue regarding this multiple page loading thing.

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

3 participants