feat(sidebar): implement canonicalize roots, authoritative mount handling & preserved incremental UX for local folder mode

This commit is contained in:
Anish Sarkar 2026-04-27 19:58:12 +05:30
parent dbdeaa1bcf
commit 95511f0915
5 changed files with 98 additions and 22 deletions

View file

@ -30,6 +30,7 @@ def test_backend_resolver_returns_multi_root_backend_for_single_root(tmp_path: P
backend = resolver(_RuntimeStub())
assert isinstance(backend, MultiRootLocalFolderBackend)
assert backend.list_mounts() == ("tmp",)
def test_backend_resolver_uses_cloud_mode_by_default():
@ -57,3 +58,4 @@ def test_backend_resolver_returns_multi_root_backend_for_multiple_roots(tmp_path
backend = resolver(_RuntimeStub())
assert isinstance(backend, MultiRootLocalFolderBackend)
assert backend.list_mounts() == ("resume", "notes")

View file

@ -26,3 +26,12 @@ def test_mount_ids_preserve_client_mapping_order(tmp_path: Path) -> None:
)
assert backend.list_mounts() == ("pc_backups", "pc_backups_2", "notes_2026")
def test_mount_id_is_authoritative_not_folder_name(tmp_path: Path) -> None:
root = tmp_path / "Resume Folder"
root.mkdir()
backend = MultiRootLocalFolderBackend((("custom_resume_mount", str(root)),))
assert backend.list_mounts() == ("custom_resume_mount",)