Skip to content

feat(review): send preview comments to quickfix list#747

Open
antono wants to merge 11 commits into
iamcco:masterfrom
antono:markdown-review
Open

feat(review): send preview comments to quickfix list#747
antono wants to merge 11 commits into
iamcco:masterfrom
antono:markdown-review

Conversation

@antono

@antono antono commented May 24, 2026

Copy link
Copy Markdown

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 :copen and 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
:MarkdownReview

Then in the browser, hover any paragraph / heading / list item / table → click the 💬 button → type a comment. Back in Neovim:

:copen           " the comment is a quickfix item at the right source line
:QuickfixReview  " optional: annotate with quickfix-review-nvim

:MarkdownPreview still opens a normal preview with no comment UI.

Configuration

Variable Default Description
g:mkdp_enable_review 0 Enable the comment UI and quickfix integration
g:mkdp_review_auto_open 0 Run :copen automatically after each comment

How it works

  • The browser already injects data-source-line attributes on block elements (used for sync-scroll); the overlay reuses them to map a click back to the 1-based source line.
  • The Node server already holds a live msgpack-RPC handle to Neovim, so it calls setqflist(..., 'a') directly — no nvr, no extra channel.

Changes

  • plugin/mkdp.vim: add g:mkdp_enable_review and g:mkdp_review_auto_open; register :MarkdownReview command + <Plug>MarkdownReview mappings
  • autoload/mkdp/review.vim (new): mkdp#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 guard
  • app/server.js: handle the 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 (new): build-free overlay with hover button, comment popover, and quickfix-line marker decoration

Notes / limitations

  • Comments anchor to the nearest block that carries data-source-line (paragraph, heading, list item, table).
  • Line numbers can drift if the buffer is edited after commenting — same as any quickfix entry.
  • Markers are in-memory per page session (a future phase could sync them back from the quickfix list).

antono added 11 commits May 25, 2026 01:27
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant