feat(review): send preview comments to quickfix list#747
Open
antono wants to merge 11 commits into
Open
Conversation
Let a reviewer attach a comment to a rendered block in the browser preview and map it back to the original markdown line, appending it to Neovim's quickfix list (usable by :copen and quickfix-review-nvim). Opt-in via g:mkdp_enable_review. - plugin/mkdp.vim: add g:mkdp_enable_review and g:mkdp_review_auto_open - autoload/mkdp/review.vim: mkdp#review#add() resolves the buffer path and appends a quickfix item, gated by the flag - app/server.js: handle add_comment socket event and ack the client - app/routes.js: inject the review flag and comments.js at serve time (no out/ rebuild required) - app/_static/comments.js: build-free overlay with hover button, comment popover, and quickfix-line marker decoration
Add a one-shot command that enables g:mkdp_enable_review and opens the preview, so the comment UI is active without setting the flag manually. - autoload/mkdp/review.vim: mkdp#review#open() sets the flag then opens - plugin/mkdp.vim: register :MarkdownReview command and <Plug> mappings
Rename the plugin and all internal namespaces from markdown-preview to markdown-review to reflect the fork's focus on integrated review comments. Changes: - Rename autoload/mkdp → autoload/mdrv, plugin/mkdp.vim → plugin/mdrv.vim - Rename user commands: :MarkdownPreview* → :MarkdownReview* - Rename all config variables: g:mkdp_* → g:mdrv_* - Rename CSS classes: .mkdp-* → .mdrv-* - Rename JS window variables: __MKDP_REVIEW__ → __MDRV_REVIEW__ - Update TypeScript and compiled JS (app/lib/) - Rewrite README with upstream attribution and community/unsupported notice - Default g:mdrv_enable_review to 1 (review mode always on by default) - Update package metadata (name, description) - Rename containing directory: markdown-preview.nvim → markdown-review.nvim
- Remove avi/nixvim complexity causing version mismatch issues - Use wrapNeovimUnstable to include markdown-review plugin - Update Node.js from EOL 20 to 22 - Simplify devShell to lightweight dev environment - Include app directory in plugin build for server availability
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.
Review comments → quickfix list
Let a reviewer attach a comment to a rendered block in the browser preview and map it back to the original markdown line, appending it to Neovim's quickfix list — immediately usable by
:copenand by quickfix-review-nvim. No extra plugins required for the base feature.The feature is opt-in and built without requiring a Next.js rebuild of the bundled
app/out/.Usage
" one-shot: enable review mode and open the preview :MarkdownReviewThen in the browser, hover any paragraph / heading / list item / table → click the 💬 button → type a comment. Back in Neovim:
:MarkdownPreviewstill opens a normal preview with no comment UI.Configuration
g:mkdp_enable_review0g:mkdp_review_auto_open0:copenautomatically after each commentHow it works
data-source-lineattributes on block elements (used for sync-scroll); the overlay reuses them to map a click back to the 1-based source line.setqflist(..., 'a')directly — nonvr, no extra channel.Changes
g:mkdp_enable_reviewandg:mkdp_review_auto_open; register:MarkdownReviewcommand +<Plug>MarkdownReviewmappingsmkdp#review#open()enables review then opens the preview;mkdp#review#add()resolves the buffer path and appends a quickfix item, gated by the flag, with an unnamed-buffer guardadd_commentsocket event and ack the clientcomments.jsat serve time (noout/rebuild required)Notes / limitations
data-source-line(paragraph, heading, list item, table).