Add file-based comment persistence with .review.json - #27
Open
dfpersonal wants to merge 4 commits into
Open
Conversation
Save/load review comments to .review.json files on disk instead of browser localStorage. Adds GET/PUT/DELETE /api/reviews endpoints with atomic writes, a useReviewFile hook with debounced auto-save, a Save button in the comment sidebar, and one-time localStorage migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ryo-manba#28) * fix: keep markdown content width stable when comments sidebar toggles Move the comments sidebar padding from inside `.markdown-container` to its parent flex container so it no longer eats into `max-width`. This keeps the readable text width consistent regardless of sidebar state. When the sidebar is collapsed, reserve a small 80px gutter for the floating toggle button to minimize horizontal shift. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * style: apply prettier formatting Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> (cherry picked from commit d6c42be)
Add a Fork & Upstream Sync section describing the ryo-manba/md-review relationship and a cherry-pick-based sync workflow. Correct two stale lines that still described localStorage-only comment persistence. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
.review.jsonfiles on disk alongside the source markdown, replacing browser localStorage for persistence/api/reviewsendpoints with atomic writes (write to.tmp, then rename)useReviewFilehook with debounced auto-save (1s) and immediate flush on unmount.review.jsonfileresolveSecurePath()helperFiles changed
server/index.jssrc/hooks/useReviewFile.tssrc/components/DevModeApp.tsxuseLocalStoragewithuseReviewFilesrc/components/CliModeApp.tsxuseStatewithuseReviewFilesrc/components/CommentList.tsxsrc/components/MarkdownPreview.tsxsaving/onSaveNowpropssrc/styles/markdown.css.gitignore*.review.jsonfilesAI disclosure
This code was written by Claude (Anthropic's AI assistant) using Claude Code. The commit is co-authored accordingly. I'm submitting this because I find the tool genuinely useful and wanted file-based persistence — but I want to be upfront that I directed the work rather than writing the code by hand.
Test plan
pnpm test— all 37 existing tests passpnpm build— builds cleanlymd-review some-file.md— comments save to.review.json, reload on refreshmd-review docs/— comments persist per file.review.jsonfile