public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH widget-toolkit] fix #6679: log/journal view: keep x scroll position when updating the scrolling
Date: Wed, 13 Aug 2025 13:12:04 +0200	[thread overview]
Message-ID: <20250813111204.2342612-1-d.csapak@proxmox.com> (raw)

otherwise the refresh logic will 'jump' back to the beginning of the
line if the user has scrolled horizontally.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
should be cherry-pickable for stable-bookworm too if desired

 src/panel/JournalView.js | 5 +++--
 src/panel/LogView.js     | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/panel/JournalView.js b/src/panel/JournalView.js
index 71c0f30..45aeda7 100644
--- a/src/panel/JournalView.js
+++ b/src/panel/JournalView.js
@@ -49,17 +49,18 @@ Ext.define('Proxmox.panel.JournalView', {
             let me = this;
             let view = me.getView();
 
+            let scrollX = view.getScrollX() ?? 0;
             if (!livemode) {
                 setTimeout(function () {
                     view.scrollTo(0, 0);
                 }, 10);
             } else if (view.scrollToEnd && scrollPos <= 5) {
                 setTimeout(function () {
-                    view.scrollTo(0, Infinity);
+                    view.scrollTo(scrollX, Infinity);
                 }, 10);
             } else if (!view.scrollToEnd && scrollPosTop < 20 * view.lineHeight) {
                 setTimeout(function () {
-                    view.scrollTo(0, num * view.lineHeight + scrollPosTop);
+                    view.scrollTo(scrollX, num * view.lineHeight + scrollPosTop);
                 }, 10);
             }
         },
diff --git a/src/panel/LogView.js b/src/panel/LogView.js
index a774178..4e81846 100644
--- a/src/panel/LogView.js
+++ b/src/panel/LogView.js
@@ -87,7 +87,7 @@ Ext.define('Proxmox.panel.LogView', {
             if (scrollToBottom) {
                 let scroller = view.getScrollable();
                 scroller.suspendEvent('scroll');
-                view.scrollTo(0, Infinity);
+                view.scrollTo(view.getScrollX() ?? 0, Infinity);
                 me.updateStart(true);
                 scroller.resumeEvent('scroll');
             }
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


                 reply	other threads:[~2025-08-13 11:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250813111204.2342612-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal