Full Height GitHub PR Status List

removes the max height of the merge status list in Github PRs to display all the checks without scrolling.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

You will need to install an extension such as Tampermonkey to install this script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name         Full Height GitHub PR Status List
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  removes the max height of the merge status list in Github PRs to display all the checks without scrolling.
// @author       Othman Shareef ([email protected])
// @match        https://github.com/*
// @icon         https://github.githubassets.com/favicons/favicon.svg
// @grant        none
// @license MIT
// ==/UserScript==
(function () {
  'use strict';
  const elementSelector = '[aria-label="Checks"] [class^="MergeBoxExpandable-module__expandableContent"]';

  const timers = new Map();

  const waitForSelector = (selector = '', options = { timeout: 1000 }) => {
    return new Promise((resolve, reject) => {
      // Create a key from the selector and the optional id
      const key = selector;

      // Clear the existing timer for the key (if any)
      const existingTimer = timers.get(key);
      if (existingTimer) {
        clearInterval(existingTimer);
      }

      const startTime = Date.now();
      const timer = setInterval(() => {
        try {
          const element = document.querySelector(selector);
          if (element) {
            clearInterval(timer);
            timers.delete(key);
            resolve(element);
          } else if (Date.now() - startTime >= options.timeout) {
            clearInterval(timer);
            timers.delete(key);
            reject(new Error('Timeout ' + key));
          }
        } catch (error) {
          clearInterval(timer);
          timers.delete(key);
          reject(new Error('Invalid selector: ' + selector));
        }
      }, 100);

      // Store the new timer
      timers.set(key, timer);
    });
  };

  const removeMaxHeight = async () => {
    try {
      await waitForSelector(elementSelector);
      const checksList = document.querySelector(elementSelector);
      checksList.style.maxHeight = 'none';
      checksList.parentElement.style.maxHeight = 'none';

    } catch (error) {
      console.error(error);
    }
  };

  const observer = new MutationObserver(removeMaxHeight);

  observer.observe(document.body, {
    childList: true,
    subtree: true,
  });
})();