Repository navigation
Review a markdown file in its rendered view - #188
Merged
Merged
Conversation
The rendered view of a markdown file showed no comments and no changes, and a tap on it did nothing. The pane stored the scroll position of a file in pixels, so the rendered view started at the top, and a reopened markdown file always came back as source. Each block of the rendered view now knows its source lines. A tap on a block opens the composer for the block, a comment shows under the block that holds its line, a changed block gets the marker of the code pane, and the toolbar steps through the changed and the commented blocks. A comment on a block is a block comment. REVIEW.md writes it with the heading "#### Line 10 to 14", keyed by the first line, and its context holds the block plus three lines on each side. The desktop review tool reads such a file and drops the range when it writes it. A block of one line writes a line comment. The API takes an optional endLine. The store remembers a line anchor and the view per file in place of the pixel offset. A switch between the views keeps the topmost line, a line between two blocks lands on the next block, and a reopened file comes back in the view it was left in, at the same place. Each pane is mounted once per file and records the place when it leaves the file.
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: A markdown file can be reviewed in its rendered view. The view shows the comments and the changes per block, a tap on a block comments the block, and the reading position survives the switch of the view and a reopen.
Changes:
#### Line 10 to 14to REVIEW.md. The key stays the first line, a block of one line writes a line comment, and the context holds the block plus three lines on each side. The desktop review tool reads the file and drops the range when it writes it. The annotation API takes an optionalendLine.doc/review.mdanddoc/rest.mddescribe the block comments and the range heading.Notes for the review:
rowOffsets()measures rows against the scroller with bounding rectangles, because the block frames are positioned.Tests: store, route and unit tests for the range heading, the block context, the drift of a block comment, the plugin and the anchors. E2E tests for a block comment on a desktop and on a phone, the markers and steps in the rendered view, and the kept place across a switch and a reopen.