Skip to content

fix(manager): parse file labels across platforms - #516

Merged
kmnhan merged 1 commit into
mainfrom
agent/fix-cross-platform-file-labels
Jul 29, 2026
Merged

fix(manager): parse file labels across platforms#516
kmnhan merged 1 commit into
mainfrom
agent/fix-cross-platform-file-labels

Conversation

@kmnhan

@kmnhan kmnhan commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Parse recorded file stems with pathlib.PureWindowsPath so manager labels accept Windows, UNC, and POSIX path syntax on all operating systems.
  • Use the same parser for live manager rows and restored workspace labels.
  • Keep each recorded source path unchanged for replay, diagnostics, and file relinking.

Root cause

pathlib.Path.stem uses the current operating system's path rules. On macOS, it treats backslashes in a recorded Windows path as ordinary filename characters. The manager therefore displayed most of the Windows path instead of only the file stem.

User impact

ImageTool workspaces moved from Windows to macOS now show compact source filenames in the manager tree.

Validation

  • QT_QPA_PLATFORM=offscreen uv run --group pyqt6 pytest -q tests/interactive/imagetool/manager/provenance/test_dependencies.py::test_manager_compact_file_suffix tests/interactive/imagetool/manager/provenance/test_dependencies.py::test_manager_compact_file_suffix_accepts_cross_platform_paths tests/interactive/imagetool/manager/workspace/test_format.py (23 passed)
  • uv run --group pyqt6 ruff format --check on all changed files
  • uv run --group pyqt6 ruff check on all changed files
  • uv run --group pyqt6 mypy on all changed source files
  • git diff --check

ImageTool Manager now shows only the source file stem when a workspace records a Windows or UNC path and opens on another operating system. The saved source path remains unchanged for replay and relinking.
@kmnhan
kmnhan marked this pull request as ready for review July 29, 2026 06:31
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.65%. Comparing base (08e0b56) to head (193fce3).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #516   +/-   ##
=======================================
  Coverage   91.65%   91.65%           
=======================================
  Files         247      247           
  Lines       94768    94770    +2     
  Branches    15881    15881           
=======================================
+ Hits        86858    86862    +4     
+ Misses       4593     4591    -2     
  Partials     3317     3317           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@kmnhan
kmnhan merged commit 89ed162 into main Jul 29, 2026
26 checks passed
@kmnhan
kmnhan deleted the agent/fix-cross-platform-file-labels branch July 29, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant