Repository navigation
Conversation
|
|
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
This branch has not been deployed
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.
Problem
Clickable relative file links in a Markdown preview currently pass their raw
hreftoopenLink. The preview already supplies the document directory and connection for resolving images, but link activation does not use them. Consequently, a link such as[Target](target.md)is dispatched to an external opener (or a web block) without resolving it against the displayed document.Minimal reproduction
README.mdandtarget.md.[Target](target.md)inREADME.md.README.mdin Wave's Markdown preview and click Target.target.mdas an unresolved URL. The expected behavior is file-preview navigation to the sibling document on the same connection.The same handler path affects relative PDF and audio-file links. This is a Markdown-preview issue, separate from terminal/OSC 8 hyperlinks.
Change
FileJoinCommand, using the displayed document directory.goHistoryroute rather than the external URL opener.The link component is extracted for focused activation tests. Additional tests render the actual MarkdownPreview/Markdown/parser/sanitizer/link chain, with mocked RPC and native-navigation boundaries.
Verification
Checked against base
9f1c9670d407be3b93cf090319a63ef30bf54d0ewith Node 22 and npm 10 on Windows:npm test -- --run --fileParallelism=false: 98 tests passed (51 existing + 47 new).npm run build:dev: passed (main, preload and renderer bundles).preview-markdown.tsx: passed. The existingmarkdown.tsxhas formatting issues on the unchanged base as well; unrelated formatting is left untouched.git diff --check: passed.npx tsc --noEmit: reports 17 existing preview-mock diagnostics on both pristine base and patched source. Diagnostic output was compared byte-for-byte after the final repair, with no new diagnostics.Dependencies were installed from the committed lockfile with workspace/lifecycle scripts skipped, followed by the inspected Electron binary installer. The missing docs-workspace
@docusaurus/tsconfigproduces a non-failing warning in the test/build commands.Draft / remaining validation
This is a draft pending a live Windows UI check. The automated integration tests exercise parsed-anchor activation and the callback boundary, not a live Electron window, real remote/WSL filesystem, backend RPC, audio playback, or persisted preview history. The Go backend/package build was not run.
This does not add Obsidian
[[wikilinks]]or cross-document fragment scrolling. A file link with a query/fragment suffix opens the file itself; query-only destinations are not navigated. Schemed destinations keep their existing behavior and sanitizer restrictions.AI-assisted implementation and review; the contribution is limited to this file-link repair and synthetic regression cases.