Document picker code and architecture

This commit is contained in:
“Naeel”
2026-09-05 13:24:00 +03:00
parent 13ea0efcd7
commit e4b4dca53a
18 changed files with 437 additions and 2 deletions
+11
View File
@@ -1,5 +1,16 @@
import { flattenFiles } from './render.js';
/**
* Legacy helper: заменяет HTML статуса у найденного leaf-файла.
*
* @param {string} path Полный логический путь файла в текущем дереве.
* @param {string} html Готовая HTML-строка статуса; вызывающая сторона отвечает
* за её безопасность.
* @param {{nodes: Array}} state Состояние дерева, из которого ищется файл.
* @param {{tableBodyEl: HTMLElement}} elements DOM-элементы старого renderer.
* @returns {void} Ничего не возвращает; при отсутствии файла или ячейки ничего
* не изменяет.
*/
export function setStatus(path, html, state, elements) {
const file = flattenFiles(state.nodes).find((item) => item.path === path);
if (!file) return;