ArchiveTeam / ArchiveBot

ArchiveBot, an IRC bot for archiving websites
http://www.archiveteam.org/index.php?title=ArchiveBot
MIT License
357 stars 72 forks source link

dashboard: when a new job is added, don't scroll the stopped log window being hovered over #563

Closed ivan closed 11 months ago

ivan commented 11 months ago

This fixes:

"when you hover over a log window, it stops scrolling as intended, but each time a new job is added at the top of the dashboard, the log window scrolls to the bottom. I'm pretty sure this wasn't the case before [...]."

Reported by @JustAnotherArchivist

Diagnosis:

JobsRenderer._createLogContainer calls this.applyFilter(); applyFilter was scrolling all the log windows (with the intention of scrolling log windows made newly visible by the filter), but neglected to check whether they were log-window-stopped.

ivan commented 11 months ago

Merging after testing:

Chrome 119 on Windows: before fix, confirmed that setTimeout(() => ds.jobsRenderer.applyFilter(), 3000); causing a stopped logged window to scroll down; no more scrolling after the fix.

Firefox 119 on Windows: confirmed no more scrolling after the fix.

Performance considerations: there might be a better way to do this without querying classList, but it should be fine and applyFilter isn't called very often.