Repository navigation
fix: text editor bugs found during exploratory testing - #3533
Merged
Merged
Conversation
JammingBen
requested changes
Oct 5, 2026
| } | ||
|
|
||
| // `beforeunload` can't wait for a flush, so a pending change counts as unsaved there | ||
| const hasUnsavedWork = computed(() => unref(isDirty) || unref(yjsSession?.hasPendingContent)) |
Member
There was a problem hiding this comment.
You need to check for (!isReadOnly && hasPendingContent) because hasPendingContent evaluates for read-only users as well.
Member
Author
There was a problem hiding this comment.
Good catch, fixed in 0bbf82e. I used the permission-based isReadOnly rather than effectiveReadOnly, because a session that locks for reload mid-edit must keep the unload guard armed. Added a test for the read-only case.
JammingBen
approved these changes
Oct 5, 2026
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.
Description
Fixes found while exploratory testing the text editor (notes and markdown) with Playwright. One commit per bug:
errorOnInvalidContent)flushContent()/hasPendingContent, theAppWrapperflushes before saving, autosaving, downloading and leavingbeforeunloadalso treats a pending change as unsaved now. The route leave guard returns its result instead of callingnext, since vue-router 5 rejects async guards that takenext. "Cancel" in the dialog now aborts the navigation instead of leaving it pending.@tiptap/extension-underlinedependency droppedOcEmojiPickerwatches() => language.currentlanguage.currentis a plain string, so the watch never fired on language changes (and Vue warned about an invalid watch source).Related Issue
How Has This Been Tested?
Types of changes