Make the branches dropdown work on new repos page

7db57c4a30497bdb48914a95353fbdb361fb52fe

Tucker McKnight | Tue Dec 09 2025

Make the branches dropdown work on new repos page
js_templates/helpers/nav.ts:1
Before
1
import path from 'path'
After
1
js_templates/helpers/nav.ts:28
Before
28
After
28
    repoBranchHome: (branchName: string) => {
      return `${rootBasePathBranches}/${slugify(branchName)}`
    },
js_templates/repo.ts:25
Before
25
After
25
          <script>
            window.branches = ${JSON.stringify(repo.branches)};
          </script>
js_templates/repo.ts:42
Before
42
43
44
45
46
47
                          main
                        <ul class="dropdown-menu">
                          <li><a class="dropdown-item" href="#"&gt;Action&lt;/a&gt;&lt;/li>
                          <li><a class="dropdown-item" href=&quot;#&quot;>Another action</a&gt;&lt;/li>
                          <li><a class=&quot;dropdown-item&quot; href=&quot;#&quot;>Something else here</a></li>
                        </ul>
After
42
43
44
45
46
47
                          ${branch.name}
                        <div class="dropdown-menu">
                          <form class=&quot;mx-3 my-1"&gt;
                            <input type="text" class="form-control" id=&quot;dropdownBranchSearch&quot; placeholder=&quot;Search branches...&quot;>
                          </form>
                          <div class="dropdown-divider"&gt;&lt;/div>
                          <ul class=&quot;dropdown-branches&quot;>
                            ${repo.branches.map((branch) =&gt; { return `&lt;li><a class=&#39;dropdown-item&#39; href=&#39;${nav.repoBranchHome(branch.name)}&#39;>${branch.name}</a></li>`}).join('')}
                          </ul>
                        </div>