# Rich record editing Active contributors: Douwe de Vries, vriesd ## Purpose Rich record editing powers Notes, Testware Drafts, and Findings. It stores editor content safely, converts between TipTap JSON, HTML, and plain text, and supports copy workflows for Jira-style handoff. ## Key source files | File | Purpose | | --- | --- | | `frontend/src/editor/RichTextEditor.tsx` | TipTap editor component. | | `frontend/src/editor/editorDocument.ts` | Stored document model and conversions. | | `frontend/src/editor/editorHtml.ts` | HTML normalization, sanitizer, and managed image hydration. | | `frontend/src/editor/editorExtensions.ts` | Editor extension setup. | | `frontend/src/editor/clipboardExport.ts` | Copy/export helpers for rich records and screenshots. | | `frontend/src/views/RichRecordView.tsx` | Shared editable record UI. | | `frontend/src/views/RecordCollectionView.tsx` | Shared Draft/Finding collection behavior. | | `crates/qa-scribe-core/src/generation/html.rs` | Backend HTML handling for generated content. | | `crates/qa-scribe-core/src/generation/response.rs` | Response repair and managed image preservation. | ## How it works `frontend/src/editor/editorDocument.ts` is the conversion boundary between stored rich body values and UI/editor representations. `frontend/src/editor/editorHtml.ts` constrains editor HTML and validates links and image sources. Managed attachments are represented with the `qa-scribe-attachment://` protocol exported from `src-tauri/src/specta_bindings.rs`. ## Integration points Rich editing is used by [Session capture](features--session-capture.md), [AI-assisted Testware](features--ai-assisted-testware.md), and [Managed attachments](features--managed-attachments.md). Shared record components are used by `frontend/src/views/TestwareView.tsx` and `frontend/src/views/FindingsView.tsx`. ## Entry points for modification Start in `frontend/src/editor/RichTextEditor.tsx` for editor UI, `frontend/src/editor/editorHtml.ts` for sanitizer rules, and `frontend/src/views/RichRecordView.tsx` for shared Draft/Finding controls.