// Root todo.txt rail widget. Surfaces wiki-root/todo.txt at the top of the // left navigation rail (above the folder tree) and keeps it editable in place: // a plain read view paints first (fast, no dependency), then a minimal // CodeMirror instance (todo.txt highlighting from the bundle) always mounts — // lazily, off the critical path, so the bundle fetch never delays first paint. // Autosave is debounced + saves on blur via POST /_todo. If the file is absent // (GET /_todo → 404) the widget renders nothing and no FAB is created; the // file is only ever created out-of-band. Mobile: a dedicated todo FAB opens // the widget in the full-viewport Overlay (overlay.js), saving on dismiss. (function () { var container = document.querySelector('[data-todo-rail]'); if (!container) return; var TODO_URL = '/_todo'; var DEBOUNCE_MS = 800; var RETRY_MS = 5000; var view = null; // CM EditorView once mounted var fallback = null; //