databrickslabs / databrickslabs/ontos

[Improvement]: Comments: rich-text (Markdown) bodies

Open
#786 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/improvement
Dominant language
Python
Stars
212
Forks
71
Avg merge
4d 10h
Merged PRs (30d)
43

Description

Parent PRD

#783

What to build

Make comment bodies Markdown. Keep the existing comment text column unchanged (raw text interpreted as Markdown) so existing comments render unchanged with zero migration. Render through the app's existing MarkdownViewer (react-markdown + remark-gfm), extended with rehype-sanitize using a conservative schema (no raw HTML, safe URL protocols only) applied to comment rendering — this is mandatory to prevent stored XSS on user-authored bodies. Composer is a Markdown textarea (not WYSIWYG) with a preview toggle. GitHub-flavoured Markdown only — emphasis, lists, quotes, fenced code/SQL, tables, external links. Slash-commands, glossary-term insertion, and internal application-entity links are out of scope. Gate the whole capability behind a comments.rich_text feature flag; with the flag off, composer is plain textarea and rendering is plain text (today's behaviour). Wire both sidebar and embedded variants through the shared render/compose components.

See PRD sections "Solution" (rich text), "Implementation decisions" (rich text model), "Further notes" (sanitisation), and user stories 18–21.

Acceptance criteria

  • Comment bodies render as GFM via MarkdownViewer on sidebar and embedded variants
  • rehype-sanitize applied to comment rendering: a script/HTML-injection payload renders sanitised (no script, no raw HTML)
  • Pre-existing plain-text comments render unchanged (no migration)
  • Composer is a Markdown textarea with a preview toggle
  • GFM constructs (list, code fence, table, external link) render; slash-commands / glossary / internal links absent
  • comments.rich_text flag gates the feature; flag off ⇒ plain textarea + plain-text render
  • Tests: frontend component test for sanitised render of a malicious payload + GFM render; a render/unit test confirming legacy plain-text comment renders unchanged

Blocked by

None — can start immediately (independent of threading/resolve).

User stories addressed

18, 19, 20, 21

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing MarkdownViewer and the shared comment render/compose components used by the sidebar and embedded variants. Add the requested frontend component test for sanitized malicious input and GFM, plus a render/unit test proving legacy plain-text comments are unchanged. Done means the feature flag gates the Markdown textarea, preview, and rendering, with plain-text behavior when disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, markdown, react
Domain
frontend, security, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.