mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-23 00:50:35 +01:00
5504e87bfd
# Objective This is another fix related to the path handling issue when connecting from Unix to Windows, similar to #62038 and #63075, but confined to the path handling in the security modal. The root cause is the same: when using the standard library `Path` API across platforms — especially connecting from Unix to Windows — these `Path` methods give wrong results. The bugs I have observed include: 1. When opening a single file, its parent folder is not shown properly in the project list. 2. When opening a folder, no parent folder is auto-filled into the input field after "Trust all projects in". 3. When Zed runs in debug mode, opening two untrusted folders, checking "Trust parents", and then trusting would result in a panic. ## Solution Use the corresponding methods in `PathStyle`, which is designed for handling paths across platforms, instead of the `Path` methods in the relevant code. ## Testing Built and tested locally, with comparison screenshots attached. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase || Before | After | |:--:|:--:|:--:| | Auto fill |<img width="657" height="343" alt="auto_fill_before" src="https://github.com/user-attachments/assets/e36ca3d5-998c-4bed-94e9-f97dd0e7ebf4" />| <img width="654" height="333" alt="auto_fill_after" src="https://github.com/user-attachments/assets/c8413fb5-d2dd-427a-afb0-9cbebc033742" /> | | Single file | <img width="654" height="322" alt="single_file_before" src="https://github.com/user-attachments/assets/bfe87ab0-bf87-491a-8f85-b5a2681763a9" />| <img width="657" height="325" alt="single_file_after" src="https://github.com/user-attachments/assets/0437cbde-42c3-44f6-847b-abd33e54cd2c" /> | --- Release Notes: - Fixed trusting projects on remote Windows machines from Unix systems