go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.11k stars 5.41k forks source link

[Actions] Auto scroll feature #25186

Open RealFascinated opened 1 year ago

RealFascinated commented 1 year ago

Feature Description

It would be nice if on the action page it would auto scroll down to the bottom of the logs (and maybe auto open the steps?)

Screenshots

No response

GammaGames commented 1 year ago

I was impatient so I wrote a hacky tamper monkey script that limits the height of the action step and auto scrolls on changes:

// ==UserScript==
// @name         Gitea Autoscroll
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Limit height of build steps and scroll them automagically
// @author       You
// @match        [DOMAIN HERE]*/actions/runs/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=gitea.io
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    GM_addStyle(`.job-step-logs {
        max-height: 75vh !important;
        overflow-y: scroll;
    }`);

    $("body").on('DOMSubtreeModified', ".job-step-logs", function() {
        this.scrollTo(0, this.scrollHeight);
    });
})();

I downloaded tamper monkey 10 minutes ago, so I might've done something weird in my script 😛 it works for me!

Edit: It no longer works since Chrome removed the DOMSubtreeModified event :/

jjardina commented 4 months ago

100% I am new to Gitea and this issue really stood out as Jenkins has had this for years. I have several long running actions and having to scroll to the bottom on every update is a PITA. I was going to open a proposal but found this one already opened.

Rainnny7 commented 4 months ago

This definitely needs to be added