refactor: externalize local folder watch marker

This commit is contained in:
lix-2026
2026-05-25 06:55:35 +08:00
parent d39612bf34
commit 4eda7179cc
3 changed files with 31 additions and 1 deletions
@@ -239,6 +239,13 @@ function applyLocalFolderSidebarSnapshot(nextDocument, options) {
return applied;
}
function markLocalFolderWatchApplied(value) {
var appliedValue = String(value || 'projection');
if (!document || !document.documentElement) return false;
document.documentElement.setAttribute('data-mnote-local-folder-watch-applied', appliedValue);
return true;
}
function revealFileTreeRow(row) {
if (!(row instanceof HTMLElement)) return;
var node = row.closest('.tree-node');
@@ -378,6 +385,7 @@ window.__mnoteFileTreeRuntime = {
groupRowsByParent: groupRowsByParent,
replaceSidebarTreeFromDocument: replaceSidebarTreeFromDocument,
applyLocalFolderSidebarSnapshot: applyLocalFolderSidebarSnapshot,
markLocalFolderWatchApplied: markLocalFolderWatchApplied,
fileTreeRowKind: fileTreeRowKind,
fileTreeRowDocumentId: fileTreeRowDocumentId,
fileTreeRowAssetId: fileTreeRowAssetId,