Skip to content

Conversation

@hiroyannnn
Copy link

Summary

I noticed that annotating on rendered markdown could improve the review workflow, so I tried implementing it.

This adds a "Rendered / Source" toggle in Annotate mode, allowing annotation on either view.

If this seems useful, feel free to merge. If not, no worries at all — happy to close this.

Closes #179

Changes

File Change
ApprovalsAnnotator.tsx Added view toggle and rendered view selection handler
annotationUtils.ts (new) Text matching utilities to locate selections in markdown source

Screenshots

image

Testing

  • Select text on rendered view → annotation modal opens
  • Toggle to Source view → works as before
  • Build passes

Implement the ability to select text and add annotations directly
on rendered markdown content.

Changes:
- Add annotationUtils.ts (fuzzy matching & context extraction)
- Update ApprovalsAnnotator to use rendered view in Annotate mode
- Add handleRenderedSelectionMouseUp for text selection on rendered content
- Extend ApprovalComment type with textSelector field

Technical approach:
- Text-based fuzzy matching with context (prefix/suffix)
- Map selected text position to markdown source offsets
- Maintain backward compatibility with existing ApprovalComment data
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.

[Dashboard]: Allow annotation on rendered markdown preview

1 participant