feat(files): sync Source panel browser with chosen save directory

This commit is contained in:
jack
2026-07-10 14:37:29 -07:00
parent bdc667b2ed
commit e2ce8778e0
5 changed files with 37 additions and 3 deletions
+13
View File
@@ -28,3 +28,16 @@ def test_recorded_live_file_flagged_as_recording(qapp, tmp_path):
files_by_name = {Path(row["fileName"]).name: row for row in browser.files}
assert files_by_name["live_P00001_20260706_143022.csv"]["isRecording"] is True
assert files_by_name["P00002-20260706_143500.csv"]["isRecording"] is False
def test_set_current_directory_updates_dir_and_refreshes(qapp, tmp_path):
"""setCurrentDirectory (no native dialog) is how the Status tab's save-dir
picker keeps the Source panel pointed at the same folder."""
_write_csv(tmp_path / "P00003-20260706_143500.csv")
browser = FileBrowser()
browser.setCurrentDirectory(str(tmp_path))
assert browser.currentDirectory == str(tmp_path)
assert len(browser.files) == 1
assert Path(browser.files[0]["fileName"]).name == "P00003-20260706_143500.csv"