markdown_preview: Fix Ctrl+S saving checkbox toggle state - #53236
Merged
osiewicz merged 6 commits intoApr 27, 2026
Merged
Conversation
MarkdownPreviewView - Implement `can_save`, `can_save_as`, `save`, and `save_as` for `MarkdownPreviewView` (to help save when a checkbox is toggled) - Fix preview path resolution to ignore URL fragments and handle workspace-absolute image paths correctly - Add and update tests for path and image resolution, including fragment and URL-encoded cases - Add test dependencies to Cargo.toml for improved test coverage
|
We require contributors to sign our Contributor License Agreement, and we don't have @Priyansh4444 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
Contributor
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
…w-save-from-preview # Conflicts: # Cargo.lock # crates/markdown_preview/src/markdown_preview_view.rs
Priyansh4444
marked this pull request as ready for review
April 7, 2026 00:31
zed-codeowner-coordinator
Bot
requested review from
a team,
nathansobo and
osiewicz
and removed request for
a team
April 7, 2026 00:32
Contributor
Author
|
CC: @esthertrapadoux |
Contributor
Author
2026-04-06.17-41-34.mp4 |
osiewicz
reviewed
Apr 16, 2026
osiewicz
reviewed
Apr 16, 2026
osiewicz
reviewed
Apr 16, 2026
osiewicz
reviewed
Apr 16, 2026
osiewicz
requested changes
Apr 16, 2026
…overwriting has a flipped state and cleaning up code
Contributor
Author
|
Thank you so much for the comments @osiewicz, it is ready for review again! |
ebaah46
pushed a commit
to ebaah46/zed
that referenced
this pull request
May 6, 2026
…ries#53236) Changes Made: - Adding the `Item::can_save()`, `save()`, `save_as()`, `can_save_as()` functions to help the Editor save when a checkbox is toggled - Small refactor to seperate checkbox toggle and refreshing preview - Adding support for both `/...` and `\\...` for windows users. [NOTE: I no longer own a window's machine and I am unsure if this is correct, and will fix it immediately if this is wrong] - Resolving preview paths, strips out the fragment, and image paths are coalesced to None if they don't exist - Adding Tests for the added behaviour [NOTE: would love feedback since this is the first time I am writing tests, and had a bit of assistance from an AI, but manually reviewed the code and ran the application and it seemed fine] 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable Closes zed-industries#46901 Release Notes: - Fixed Crtl+S saving while toggling checkbox in preview mode
5 tasks
benbrandt
added a commit
that referenced
this pull request
May 7, 2026
If you implement can_save, you need to also support reload. Fix a bug introduced in #53236
This was referenced May 7, 2026
zed-zippy Bot
added a commit
that referenced
this pull request
May 7, 2026
…56026) Cherry-pick of #56016 to preview ---- If you implement can_save, you need to also support reload. Fix a bug introduced in #53236 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed missing reload implementation for markdown preview. Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
zed-zippy Bot
added a commit
that referenced
this pull request
May 7, 2026
…56027) Cherry-pick of #56016 to stable ---- If you implement can_save, you need to also support reload. Fix a bug introduced in #53236 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed missing reload implementation for markdown preview. Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
strank
pushed a commit
to strank/zed
that referenced
this pull request
May 7, 2026
If you implement can_save, you need to also support reload. Fix a bug introduced in zed-industries#53236 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed missing reload implementation for markdown preview.
kathbigra
pushed a commit
to kathbigra/zed
that referenced
this pull request
May 10, 2026
…ries#53236) Changes Made: - Adding the `Item::can_save()`, `save()`, `save_as()`, `can_save_as()` functions to help the Editor save when a checkbox is toggled - Small refactor to seperate checkbox toggle and refreshing preview - Adding support for both `/...` and `\\...` for windows users. [NOTE: I no longer own a window's machine and I am unsure if this is correct, and will fix it immediately if this is wrong] - Resolving preview paths, strips out the fragment, and image paths are coalesced to None if they don't exist - Adding Tests for the added behaviour [NOTE: would love feedback since this is the first time I am writing tests, and had a bit of assistance from an AI, but manually reviewed the code and ran the application and it seemed fine] 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable Closes zed-industries#46901 Release Notes: - Fixed Crtl+S saving while toggling checkbox in preview mode
Nkr1shna
pushed a commit
to neozed-industries/neo-zed
that referenced
this pull request
May 11, 2026
…k to stable) (zed-industries#56027) Cherry-pick of zed-industries#56016 to stable ---- If you implement can_save, you need to also support reload. Fix a bug introduced in zed-industries#53236 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed missing reload implementation for markdown preview. Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Nkr1shna
pushed a commit
to neozed-industries/neo-zed
that referenced
this pull request
May 13, 2026
…k to stable) (zed-industries#56027) Cherry-pick of zed-industries#56016 to stable ---- If you implement can_save, you need to also support reload. Fix a bug introduced in zed-industries#53236 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed missing reload implementation for markdown preview. Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…ries#53236) Changes Made: - Adding the `Item::can_save()`, `save()`, `save_as()`, `can_save_as()` functions to help the Editor save when a checkbox is toggled - Small refactor to seperate checkbox toggle and refreshing preview - Adding support for both `/...` and `\\...` for windows users. [NOTE: I no longer own a window's machine and I am unsure if this is correct, and will fix it immediately if this is wrong] - Resolving preview paths, strips out the fragment, and image paths are coalesced to None if they don't exist - Adding Tests for the added behaviour [NOTE: would love feedback since this is the first time I am writing tests, and had a bit of assistance from an AI, but manually reviewed the code and ran the application and it seemed fine] 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable Closes zed-industries#46901 Release Notes: - Fixed Crtl+S saving while toggling checkbox in preview mode
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
If you implement can_save, you need to also support reload. Fix a bug introduced in zed-industries#53236 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed missing reload implementation for markdown preview.
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…ries#53236) Changes Made: - Adding the `Item::can_save()`, `save()`, `save_as()`, `can_save_as()` functions to help the Editor save when a checkbox is toggled - Small refactor to seperate checkbox toggle and refreshing preview - Adding support for both `/...` and `\\...` for windows users. [NOTE: I no longer own a window's machine and I am unsure if this is correct, and will fix it immediately if this is wrong] - Resolving preview paths, strips out the fragment, and image paths are coalesced to None if they don't exist - Adding Tests for the added behaviour [NOTE: would love feedback since this is the first time I am writing tests, and had a bit of assistance from an AI, but manually reviewed the code and ran the application and it seemed fine] 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable Closes zed-industries#46901 Release Notes: - Fixed Crtl+S saving while toggling checkbox in preview mode
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
If you implement can_save, you need to also support reload. Fix a bug introduced in zed-industries#53236 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 is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed missing reload implementation for markdown preview.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Made:
Item::can_save(),save(),save_as(),can_save_as()functions to help the Editor save when a checkbox is toggled/...and\\...for windows users. [NOTE: I no longer own a window's machine and I am unsure if this is correct, and will fix it immediately if this is wrong]Self-Review Checklist:
Closes #46901
Release Notes: