gabriel / musehub public
tree.ts typescript
19 lines 667 B
Raw
sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2 feat: add repair-commit wire endpoint (API parity with repa… Opus 4.8 minor ⚠ breaking 1 day ago
1 /**
2 * tree.ts — File tree browser page module.
3 *
4 * The tree is fully SSR'd. This module only handles the branch selector
5 * navigation, which requires JS to redirect on change.
6 *
7 * Registered as: window.MusePages['tree']
8 */
9
10 export function initTree(data: Record<string, unknown>): void {
11 const base = String(data.base ?? '');
12 const dirPath = String(data.dir_path ?? '');
13 const pathSuffix = dirPath ? '/' + dirPath : '';
14
15 const sel = document.getElementById('branch-sel') as HTMLSelectElement | null;
16 sel?.addEventListener('change', () => {
17 window.location.href = base + '/tree/' + encodeURIComponent(sel.value) + pathSuffix;
18 });
19 }
File History 1 commit
sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2 feat: add repair-commit wire endpoint (API parity with repa… Opus 4.8 minor 1 day ago