mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 12:52:39 +02:00
feat(sidebar): implement canonicalize roots, authoritative mount handling & preserved incremental UX for local folder mode
This commit is contained in:
parent
dbdeaa1bcf
commit
95511f0915
5 changed files with 98 additions and 22 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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",)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue