[email protected]: Add context menu
Closes #16522
- [x] Use conventional PR title:
<manifest-name[@version]|chore>: <general summary of the pull request> - [x] I have read the Contributing Guide
Summary by CodeRabbit
- New Features
- Adds Windows context menu integration so users can right-click files, folders, or folder backgrounds to open them with Zed.
- Includes installation and uninstallation scripts to manage the context menu.
- Installer manifest enhanced with install/uninstall hooks and user-facing notes to support post-install and pre-uninstall actions.
Walkthrough
Adds Windows Registry install/uninstall scripts that create/remove "Open with Zed" context menu entries for files, directories, and directory backgrounds, and extends the installer manifest with notes, post_install, and pre_uninstall fields.
Changes
| Cohort / File(s) | Summary |
|---|---|
Windows context menu scripts scripts/zed/install-context.reg, scripts/zed/uninstall-context.reg |
Adds an install .reg that registers "Open with Zed" handlers under HKEY_CURRENT_USER\Software\Classes for *, Directory, and Directory\Background (sets display name, icon, and command using %1/%V). Adds an uninstall .reg that deletes the three keys. |
Installer manifest bucket/zed.json |
Adds notes (array), post_install (array), and pre_uninstall (string) fields to the manifest. No other behavioral changes. |
Sequence Diagram(s)
sequenceDiagram
participant User
participant Explorer
participant Registry as Windows Registry
participant ZedApp as Zed.exe
rect rgb(240,248,255)
User->>Explorer: Right-click file/dir/background
Explorer->>Registry: Read context menu handler for clicked item
Registry-->>Explorer: Return "Open with Zed" command (with %1/%V)
Explorer->>ZedApp: Launch "Zed.exe" with argument (%1 or %V)
ZedApp-->>User: Open item in editor
end
Estimated code review effort
π― 2 (Simple) | β±οΈ ~10 minutes
- Verify registry paths and key names under HKEY_CURRENT_USER\Software\Classes.
- Confirm command-line argument placeholders (
%1for files,%Vfor directories/background) are correct for intended behavior. - Review
bucket/zed.jsonadditions for schema/validation compatibility and correct intended scripting semantics. - Ensure uninstall .reg removes exactly the keys created by install .reg.
Suggested labels
review-needed
Suggested reviewers
- chawyehsu
Poem
π° Frolic in the shell, a click and Zed hops near,
Files and folders open wide β the editor appears,
A tiny rabbit cheers, "Context menu, youβre the key!" π₯β¨
Pre-merge checks and finishing touches
β Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | β Passed | The pull request title '[email protected]: Add context menu' clearly and directly summarizes the main change. It follows the conventional format specified in the template (<manifest-name[@version]>: <general summary>), identifying the package and version being updated along with the specific feature being added. |
| Description check | β Passed | The pull request description is mostly complete and follows the required template structure. It includes the issue reference (Closes #16522) and has both required checkboxes marked as complete, indicating the author has used the conventional PR title format and read the contributing guide. However, the description could benefit from more detail about the specific changes being made. |
| Linked Issues check | β Passed | The pull request successfully addresses the linked issue #16522 by adding Windows Explorer context menu support to Zed. The changes include install-context.reg registering the 'Open with Zed' context menu entries for files, directories, and directory backgrounds, and uninstall-context.reg removing these entries. The manifest updates in bucket/zed.json add post_install and pre_uninstall hooks to execute the registry scripts during installation and uninstallation. |
| Out of Scope Changes check | β Passed | All changes in the pull request are directly related to implementing Windows Explorer context menu support as outlined in issue #16522. The three files modified (install-context.reg, uninstall-context.reg, and bucket/zed.json) are all necessary for adding and managing the context menu feature, with no extraneous modifications. |
β¨ Finishing touches
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
@coderabbitai review
β Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
This PR has been in draft status for over a month. Is it ready for review now? Or would it be better if I close it for now and you reopen it once it's ready?
I will come back to this soon.