Skip to content

Switch evaluator long descriptions to be rich text editable#70

Merged
schbetsy merged 7 commits into
mainfrom
richtext
Jun 25, 2026
Merged

Switch evaluator long descriptions to be rich text editable#70
schbetsy merged 7 commits into
mainfrom
richtext

Conversation

@schbetsy

@schbetsy schbetsy commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • Make the long_description field on the EvaluatorMetadata model (which describes the full logic of an evaluator) editable with rich text in the Django Admin

Testing

  1. docker compose build and docker compose up
  2. Log in to the Django admin site (localhost:8000/admin) and sign in (admin/admin)
  3. Visit localhost:3000 and browse to an evaluator that has hits
  4. Under "how to evaluate these results", click on "add information directly to this evaluator"
  5. Use the rich text editor to modify the long description of the evaluator
  6. Go back to the evaluator page to view the changes; they should appear with the styling and edits you applied in the admin page.

Todos

  • Consider how to handle the metadata export
  • We will need to manually update each evaluator's long description with our custom styling in order for them to appear correctly in the UI.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices
  • Project documentation has been updated
  • Reviewers requested with the Reviewers tool ➡️

@schbetsy schbetsy closed this Jun 5, 2026
@schbetsy schbetsy reopened this Jun 8, 2026
<Accordion header='Criteria evaluated'>
<div className='long-description'>
<EvaluatorLongDescription content={metadata.long_description} />
<div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(metadata.long_description) }}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love setting inner HTML dangerously.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😈

@schbetsy schbetsy marked this pull request as ready for review June 25, 2026 16:43
@schbetsy schbetsy merged commit 4c98d5d into main Jun 25, 2026
6 of 7 checks passed
@schbetsy schbetsy deleted the richtext branch June 25, 2026 16:43
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.

3 participants