You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Azure DevOps网页端折叠所有文件夹?

批量折叠Azure DevOps视图中的文件夹

这个功能在处理拉取请求、调整分支策略或查找特定分支时十分实用。

临时书签脚本方案

我目前使用的临时解决方法是一段JavaScript书签脚本:

javascript: (function(){
    if(!window.location.hostname.endsWith('.visualstudio.com'))
    {
        alert("You must be on Azure DevOps to minimize the folders.");
        return;
    }
    
    let targets = Array
        .from(document.querySelectorAll('.cursor-pointer.ms-Icon--ChevronDownMed'))
        .reverse();

    let delay = 0; // 延迟等待折叠完成
    for(let t = 0; t < targets.length; t++)
    {
        window.setTimeout(function(){
            targets[t].click();
        }, delay);
        delay += 50; 
    }
})();

将这段代码压缩后添加到浏览器书签,点击该书签即可一键折叠当前Azure DevOps视图中的所有文件夹。

不过我更希望能有免维护的解决方案,欢迎大家提供更多建议。

内容的提问来源于stack exchange,提问作者Canabale

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 13:31:07