5
11
Fork
You've already forked tomato
1

Add WYSIWYG notes to site instructions #48

Merged
edwardloveall merged 3 commits from el-wysiwyg-notes into main 2025年11月17日 17:15:33 +01:00

A great deal of information needs to be communicated to volunteers via the instructions in particular. Volunteers take in a lot of new information in their initial training's and often need notes on shifts to help remind them of all the nuances. Readable, organized notes go a long way to ensuring a shift is completed in the full context of what's needed. Currently Rootable notes are lengthy and have no formatting. Volunteers can miss information or don't bother reading it. Our current notes are not readable: they are just plain text with newlines.

Sites have "admin notes" and "instructions". Volunteers see the instructions, and org admins see both. These are now able to be saved as rich text via Trix.

Converting old notes

Trix saves data via action text as HTML in the database. Each rich text field on a model is stored as an ActionText::RichText record. To convert existing notes, I took a very simple approach of replacing newlines with <br> tags. It's not perfect, but it should give reasonable output from the existing text.

This also converts notes when converting from the old site.

Trix customization

Trix is kind of annoying to customize, but I wanted the formatting to stay simple. I hid some toolbar buttons like adding a codeblock or indentations, and made the heading h3 instead of h1 since semantically it fits in better with the page.

A great deal of information needs to be communicated to volunteers via the instructions in particular. Volunteers take in a lot of new information in their initial training's and often need notes on shifts to help remind them of all the nuances. Readable, organized notes go a long way to ensuring a shift is completed in the full context of what's needed. Currently Rootable notes are lengthy and have no formatting. Volunteers can miss information or don't bother reading it. Our current notes are not readable: they are just plain text with newlines. Sites have "admin notes" and "instructions". Volunteers see the instructions, and org admins see both. These are now able to be saved as rich text via [Trix](https://trix-editor.org/). ## Converting old notes Trix saves data via action text as HTML in the database. Each rich text field on a model is stored as an `ActionText::RichText` record. To convert existing notes, I took a very simple approach of replacing newlines with `<br>` tags. It's not perfect, but it should give reasonable output from the existing text. This also converts notes when converting from the old site. ## Trix customization Trix is kind of annoying to customize, but I wanted the formatting to stay simple. I hid some toolbar buttons like adding a codeblock or indentations, and made the heading h3 instead of h1 since semantically it fits in better with the page.
thetizzo left a comment
Copy link

This looks good. The simple form upgrade is really paying dividends on the simplicity of the view files in this PR!

This looks good. The simple form upgrade is really paying dividends on the simplicity of the view files in this PR!
edwardloveall force-pushed el-wysiwyg-notes from fb13051fe1
Some checks failed
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Failed
to ee88d66686
Some checks failed
Setup Successful
Jest Successful
Static Analysis Successful
RSpec Failed
2025年11月17日 17:04:05 +01:00
Compare
Author
Owner
Copy link

RSpec tests are flaky and pass locally

RSpec tests are flaky and pass locally
edwardloveall deleted branch el-wysiwyg-notes 2025年11月17日 17:15:33 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rootable/tomato!48
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-wysiwyg-notes"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?