gabriel / musehub public
tree.ts typescript
19 lines 667 B
Raw
sha256:969ddc5e88776e70af33c016b8777bb721356508ae5f304b3fb46c451494ece7 test(mwp3): Phase 4 — fix adjacent suite regressions, lock … Sonnet 4.6 22 days 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 2 commits
sha256:969ddc5e88776e70af33c016b8777bb721356508ae5f304b3fb46c451494ece7 test(mwp3): Phase 4 — fix adjacent suite regressions, lock … Sonnet 4.6 22 days ago
sha256:1749b9cc5cd2583c56d3261c4c00a342c27435f3946d4bc3e70f76aa2795458a docs(mwp-3): TDD implementation plan for job-enqueue idempo… Opus 4.8 22 days ago