Systematically reduce the folders of a universal app

Hi,

Using Seatable Cloud, I’m looking for a way to set all folders of an universal app as “reduced” each time users visit the app.

On my experience, thoses folders stay in same status as they were set by users on last visit. But with many folders, it makes the experience less friendly.

Thanks for your answers.

Cheers,

Fabien

Hi Fabien,

Unfortunately, as far as I know, there is no built-in way to achieve what you want. If the app is always loaded on the same computer, and if you have control over that, you can consider using the TamperMonkey extension if it’s available for you browser (an extension that lets you run any special script in your browser when loading a page). Using the following script:

// ==UserScript==
// @name         SeaTable - replier les dossiers du menu
// @namespace    http://tampermonkey.net/
// @version      2026-10-20
// @description  Replie automatiquement les dossiers dépliables du menu au chargement
// @match        https://cloud.seatable.io/external-apps/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=seatable.io
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function () {
    'use strict';

    const sleep = ms => new Promise(r => setTimeout(r, ms));

    async function run() {
        // 1. Attendre que le menu soit rendu (15 s max)
        for (let i = 0; i < 50; i++) {
            if (document.querySelector('.view-folder .icon-toggle-expand')) break;
            await sleep(300);
        }
        await sleep(300); // laisser le rendu se stabiliser

        // 2. Replier les dossiers un par un
        const count = document.querySelectorAll('.view-folder').length;
        for (let i = 0; i < count; i++) {
            // On relit le DOM à chaque tour : React a pu le re-rendre
            const folder = document.querySelectorAll('.view-folder')[i];
            const toggle = folder?.querySelector('.icon-toggle-expand');
            if (toggle && !toggle.classList.contains('rotate-90')) {
                folder.click();
                await sleep(300); // laisser React appliquer le nouvel état
            }
        }
    }

    run();
})();

You may be able to do what you want.
Please note that I wrote @match https://cloud.seatable.io/external-apps/* so it will be fired for every page whose URL starts with https://cloud.seatable.io/external-apps/: this is something you might change, either if you use a self-hosted instance or if you want the script to fire only when opening one specific page.

Bests,
Benjamin