Improve the Markdown editing experience - #64
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the Markdown-first editing workflow by adding document compatibility analysis (to protect against lossy BlockNote conversions), tightening autosave + path-mutation coordination across vault operations, and upgrading Find/link UX in both Block and Raw editors.
Changes:
- Added document analysis + “risky Markdown” gating (raw-mode protection with explicit override) and centralized content fingerprinting for safe external reloads.
- Hardened autosave/navigation/path operations (rename/move/trash/vault switch) with exclusive transaction ordering and path-mutation guards.
- Improved editor UX: exact Find highlighting (raw + block overlays), curated BlockNote UI controls for Markdown-safe commands, and platform-correct link activation/tooltips.
Reviewed changes
Copilot reviewed 83 out of 83 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/lib/vaultTransactions.ts | Adds exclusive runners to serialize vault listing/folder switch operations. |
| src/lib/toast.ts | Improves errorText for serialized { message }-style errors. |
| src/lib/openDocumentPaths.ts | Centralizes remap/remove of path-keyed editor state on FS operations. |
| src/lib/documentAnalysis.ts | Introduces document fingerprinting + Markdown risk analysis (frontmatter edge cases). |
| src/lib/tests/toast.test.ts | Adds coverage for serialized command error messages. |
| src/lib/tests/storePersistence.test.ts | Verifies persisted store boundaries and legacy session drops. |
| src/lib/tests/storeFindState.test.ts | Tests ephemeral block Find index store action behavior. |
| src/lib/tests/storeDocumentMode.test.ts | Tests compatibility-driven editor-mode transitions and overrides. |
| src/lib/tests/openDocumentPaths.test.ts | Tests path remap/removal across all live path-keyed state. |
| src/lib/tests/editorSelection.test.ts | Updates fixtures to use analyzed doc shape. |
| src/lib/tests/documentAnalysis.test.ts | Adds detailed document analysis edge-case coverage (CRLF/BOM/mixed endings). |
| src/features/watcher/useExternalChanges.ts | Serializes tree refresh + external reloads; avoids stale reloads overwriting edits. |
| src/features/watcher/tests/useExternalChanges.test.ts | Adds concurrency/ordering tests for external reload + tree refresh. |
| src/features/tree/useTreeActions.ts | Adds save/path-mutation guards and remap/remove of path-keyed state for rename/trash. |
| src/features/tree/moveExecutor.ts | Refactors move logic to use guards + centralized remap and pruning. |
| src/features/tree/tests/treeSaveGuards.test.ts | Tests guard acquisition behavior for rename/trash batches. |
| src/features/tree/tests/moveExecutor.test.ts | Tests move guard behavior, pruning, collision remap, and refresh failure handling. |
| src/features/statusbar/StatusBar.tsx | Surfaces save lifecycle states and adds “Retry” for save errors. |
| src/features/statusbar/tests/StatusBar.test.tsx | Covers statusbar save states and retry wiring. |
| src/features/properties/PropertiesPane.tsx | Routes frontmatter edits through analyzed edit action; blocks edits during load errors. |
| src/features/properties/tests/PropertiesPane.test.tsx | Tests analyzed property edits and load-error gating. |
| src/features/palette/SearchMode.tsx | Names pending scroll payload as vault-reveal kind. |
| src/features/palette/tests/SearchMode.test.tsx | Ensures vault search reveal payload remains scoped and stable. |
| src/features/folder/useFolderPicker.ts | Adds exclusive vault switching workflow with guard/rollback and legacy-path restoration. |
| src/features/editor/wikilinkInline.tsx | Uses shared tooltip affordance helper for BlockNote wikilinks. |
| src/features/editor/wikilinkCM.ts | Unifies CM link decoration presentation + tooltips with platform modifiers. |
| src/features/editor/useOpenFile.ts | Hardens navigation: flush barriers, load-error state, and safe retry behavior. |
| src/features/editor/useLinkActivation.ts | Uses platform-aware modifier detection for link activation. |
| src/features/editor/useEditorMode.ts | Routes mode changes through compatibility guard and exposes direct request API. |
| src/features/editor/useAutoSave.ts | Switches to coordinator-based flush + safe close handling using window destroy. |
| src/features/editor/useAutoRename.ts | Uses save/path-mutation guard + centralized remap on auto-rename. |
| src/features/editor/renameOpenDoc.ts | Uses guard + remap; improves rename error messaging via errorText. |
| src/features/editor/rawFindHighlight.ts | Adds CM state for exact Find highlighting without stealing focus/selection. |
| src/features/editor/RawEditor.tsx | Enables line wrapping, exact Find decoration, and focus preservation during Find. |
| src/features/editor/markdownTables.tsx | Adds Markdown-safe table handles with delete semantics tailored to GFM constraints. |
| src/features/editor/markdownSlashMenu.tsx | Curates/pins Markdown-safe slash-menu items and table insertion behavior. |
| src/features/editor/MarkdownEditorUi.tsx | Streamlines BlockNote UI to Markdown-safe formatting toolbar/side menu behavior. |
| src/features/editor/MarkdownCompatibilityBanner.tsx | Adds banner that explains raw-mode protection and provides explicit override. |
| src/features/editor/linkAffordance.ts | Centralizes link modifier detection + tooltip wording per platform. |
| src/features/editor/findInText.ts | Adds exact range computation for Find, including Unicode case-fold mapping. |
| src/features/editor/EditorPane.tsx | Integrates compatibility banner + load error state; improves editor remount keys and export safety. |
| src/features/editor/documentRenderKey.ts | Defines stable doc identity for rendered editor state across path-only remaps. |
| src/features/editor/DocumentLoadState.tsx | Adds retryable document load failure UI. |
| src/features/editor/blockTextSearch.ts | Builds rendered-block Find index + exact range matches (including tables). |
| src/features/editor/blockFindHighlight.ts | Adds non-invasive exact Find overlays for BlockNote by mapping rendered text to DOM ranges. |
| src/features/editor/blockEditorHydration.ts | Adds a hydration gate to prevent stale async exports from mutating new buffers. |
| src/features/editor/tests/wikilinkCM.test.ts | Tests CM link decoration presentation/tooltip output. |
| src/features/editor/tests/useLinkActivation.test.tsx | Expands coverage for editable-surface clicks and platform modifiers. |
| src/features/editor/tests/useEditorMode.test.tsx | Tests guarded mode requests and shortcut behavior. |
| src/features/editor/tests/useAutoSave.test.tsx | Tests coordinator scheduling/flush and close-requested destroy flow. |
| src/features/editor/tests/useAutoRename.behavior.test.tsx | Tests auto-rename guard behavior and remap outcomes. |
| src/features/editor/tests/renameOpenDoc.test.ts | Tests rename behavior with guard/remap and override remapping. |
| src/features/editor/tests/rawFindHighlight.test.ts | Unit-tests CM exact-highlight field + apply helper behavior. |
| src/features/editor/tests/RawEditor.test.tsx | Ensures wrapping + exact Find wiring and focus preservation behaviors. |
| src/features/editor/tests/markdownTables.test.ts | Tests table factory and delete-axis semantics. |
| src/features/editor/tests/markdownSlashMenu.test.ts | Tests curated slash-menu subset and table insertion behavior. |
| src/features/editor/tests/markdownEditorUi.test.tsx | Tests toolbar/side-menu/table-handle composition and shortcut filtering. |
| src/features/editor/tests/MarkdownCompatibilityBanner.test.tsx | Tests banner visibility, labels, and override path behavior. |
| src/features/editor/tests/linkAffordance.test.ts | Tests platform modifier labeling + tooltip wording. |
| src/features/editor/tests/findInText.test.ts | Tests exact range mapping including Unicode folding. |
| src/features/editor/tests/FindBar.test.tsx | Tests exact Find targeting for raw + block modes and focus retention. |
| src/features/editor/tests/EditorPane.compatibility.test.tsx | Tests EditorPane wiring for compatibility, load failures, remount keys, and stale exports. |
| src/features/editor/tests/blocknoteMarkdownContract.test.ts | Encodes BlockNote Markdown round-trip contract and known loss boundaries. |
| src/features/editor/tests/blockFindHighlight.test.ts | Tests overlay mapping across formatted text, tables, breaks, and wrappers. |
| src/features/editor/tests/blockEditorHydration.test.ts | Tests hydration gate semantics and stale async export rejection. |
| src/features/ai/applyToNote.ts | Routes assistant edits through analyzed edit action and blocks changes during load errors. |
| src/features/ai/tests/applyToNote.test.ts | Adds coverage for load-error gating and risk reanalysis on assistant edits. |
| src/App.css | Adds heading side-menu alignment styles, CM wrapping layout tweak, and block Find overlay styling. |
| src-tauri/capabilities/default.json | Grants core:window:allow-destroy for safe flush-on-close handling. |
| e2e/heading-side-menu.spec.ts | Adds Playwright coverage for heading side-menu alignment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
312
to
+313
| .cm-content { flex-grow: 2 !important; flex-shrink: 0 !important; } | ||
| .cm-content.cm-lineWrapping { flex-shrink: 1 !important; min-width: 0; } |
Ryanb58
added a commit
that referenced
this pull request
Jul 15, 2026
Improve the Markdown editing experience
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.
Summary
Testing
node_modules/.bin/vitest run: 739 tests passedcargo test --manifest-path src-tauri/Cargo.toml --lib: 114 tests passednode_modules/.bin/tsc && node_modules/.bin/vite build: passednode_modules/.bin/playwright test: 2 browser tests passedNotes