Files
mnote/.codex/reasonix-tasks/2026-05-25-batch-g-worker-b-3-20-filetree-upload-target.md
T

1.9 KiB

Batch G Worker B: 3-20 filetree upload target helper

Project root: /mnt/Data1T/mnote-worktrees/0525-g-worker-b-3-20-filetree-upload-target

Goal

Move only the low-risk, synchronous fallback/normalization part of resolveFileTreeUploadTarget(detail) out of inline SIDEBAR_TREE_JS and into rust/crates/mnote-web/browser/filetree-runtime.js.

This is a candidate patch only. Codex will review and selectively merge.

Allowed files

  • rust/crates/mnote-web/browser/filetree-runtime.js
  • rust/crates/mnote-web/src/ssr/pages/layout.rs

Do not edit any other file.

Expected shape

  • Add a small exported runtime helper, for example resolveFileTreeUploadTargetFallback(detail, deps) or a better local name.
  • Keep async preflight / fetch / backend ownership in layout.rs.
  • Keep complete inline fallback behavior in layout.rs.
  • Preserve local-folder resource ownership semantics exactly.
  • Do not move uploadFileToMediaAsset, uploadFilesWithResolvedTarget, refreshLocalFolderSidebarSnapshot, or appendUploadedAssetRow.

Verification

Run these from the project root:

node --check rust/crates/mnote-web/browser/filetree-runtime.js
cargo fmt --manifest-path rust/Cargo.toml --all --check
cargo check --manifest-path rust/Cargo.toml -p mnote-web
cargo test --manifest-path rust/Cargo.toml -p mnote-web filetree -- --test-threads=1
cargo test --manifest-path rust/Cargo.toml -p mnote-web local_upload_runtime_contains_editor_upload_context_helpers -- --test-threads=1
NODE_PATH=/mnt/Data1T/mnote/node_modules node scripts/task479-local-folder-markdown-resource-lifecycle-smoke.js

If a command fails because of a pre-existing baseline issue, record the exact command and failure.

Required output

  • Produce process-handoff.md, process-handoff.json, result.json, and final.md.
  • Include modified files, exact verification commands, pass/fail evidence, risks, and remaining work.
  • Do not commit.
  • Do not modify /mnt/Data1T/mnote.