fix(desktop): mirror Windows path identity in live overlay + WSL spelling

Addresses @teknium1's review of #61950:

- The desktop live overlay (workspace-groups.ts) matched cwd membership
  case-sensitively, so a fresh mixed-case/separator Windows session missed
  its explicit/auto project until the next backend tree refresh. Mirror the
  backend identity (isWindowsPath/comparisonSegments/pathKey) in isPathUnder,
  liveSessionProjectId, and overlayRepoLanes lane matching. Comparison-only —
  emitted ids/labels keep their spelling. POSIX stays case-sensitive.
- Backend _is_windows_path missed root-relative `\wsl.localhost\...` (single
  leading backslash), leaving that historical spelling case-sensitive. Classify
  any backslash-rooted path as Windows.

Tests: WSL-spelling collapse + explicit-project precedence (project_tree),
Windows/WSL live-overlay membership + POSIX case-sensitivity (workspace-groups).
This commit is contained in:
Brooklyn Nicholson
2026-07-12 04:33:05 -04:00
parent fff1769bd1
commit ceb179163d
4 changed files with 80 additions and 9 deletions
+4 -1
View File
@@ -62,7 +62,10 @@ def _segments(path: str) -> list[str]:
def _is_windows_path(path: str) -> bool:
value = (path or "").strip()
return bool(re.match(r"^[A-Za-z]:[/\\]", value)) or value.startswith(("\\\\", "//"))
# Drive-letter (`C:\…`), UNC (`\\srv`, `//srv`), or any backslash-rooted path
# — the root-relative `\wsl.localhost\…` / `\Users\…` spellings included. A
# single leading `/` stays POSIX (case-sensitive).
return bool(re.match(r"^[A-Za-z]:[/\\]", value)) or value.startswith(("\\", "//"))
def _comparison_segments(path: str) -> list[str]: