Skip to content

Add prosemirror package for JSON parsing and HTML rendering#938

Closed
codenem wants to merge 12 commits intoepic/rich-editorfrom
codenem/prosemirror-structs
Closed

Add prosemirror package for JSON parsing and HTML rendering#938
codenem wants to merge 12 commits intoepic/rich-editorfrom
codenem/prosemirror-structs

Conversation

@codenem
Copy link
Copy Markdown
Contributor

@codenem codenem commented Mar 26, 2026

Summary

  • Adds pkg/prosemirror with Go structs to unmarshal ProseMirror/Tiptap JSON documents (Node, Mark, and type-specific attribute structs using json.RawMessage for strict typing)
  • Implements RenderHTML(node Node) (string, error) to convert parsed document trees to HTML, supporting all standard node types (headings, paragraphs, lists, tables, code blocks, images, blockquotes) and mark types (bold/strong, italic/em, underline, strike, code, link)
  • Includes comprehensive test suite with a golden test against a full document fixture

Test plan

  • make test MODULE=./pkg/prosemirror — all tests pass
  • make lint — clean

🤖 Generated with Claude Code


Summary by cubic

Adds pkg/prosemirror to parse ProseMirror/Tiptap JSON and render HTML, and introduces GraphQL dataloaders for faster, batched by-ID lookups in resolvers.

  • New Features

    • pkg/prosemirror: Go structs for Node/Mark with strict attributes and RenderHTML(Node) supporting standard nodes/marks; golden tests included.
    • GraphQL dataloaders via github.com/vikstrous/dataloadgen; adds LoadByIDs (e.g., controls) and switches resolvers to batched fetches.
  • Bug Fixes

    • Trust Center references: remove unused rank from item fragment and pass rank to the edit dialog.
    • DocumentList: add documentTypeFilter to refetch deps and wrap refetch in startTransition to avoid stale data.
    • Signature dialog copy: “Request signatures” and “requests created.”

Written for commit ebc71b7. Summary will update on new commits.

gearnode and others added 12 commits March 26, 2026 17:43
Introduce dataloadgen-based dataloaders to batch individual
record-by-ID fetches in GraphQL resolvers into single SQL
queries. Each entity type (organization, framework, control,
vendor, document, risk, measure, task, file, report, profile)
gets a LoadByIDs method in coredata and a GetByIDs service
method with variadic arguments and dedicated collection return
types. Resolvers now use dataloader.FromContext instead of
direct service calls for single-record lookups.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
Trust centers were created without setting SearchEngineIndexing,
defaulting to an empty string in the database. This caused scan
errors when loading trust centers.

Add a migration to fix corrupted rows, set a DEFAULT on the
column, and add a CHECK constraint. Also set the field explicitly
when creating new trust centers.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
- Remove unused `rank` field from CompliancePageReferenceListItemFragment;
  the parent list fragment already fetches it for drag-and-drop reordering.
  Thread `rank` through the onEdit call chain so the edit dialog can still
  pre-populate the field via a dedicated parameter instead of the fragment.
- Add missing `documentTypeFilter` dependency to the refetch useEffect in
  DocumentList so stale closure values are never used on tab change.
- Break overlong line in DocumentList (canSendAnySignatureNotifications).

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
Add --max-warnings 0 to every eslint lint script so that any warning
causes a non-zero exit code. This makes `make lint` and CI fail on
warnings, not just hard errors.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Introduces pkg/prosemirror with Go structs to unmarshal ProseMirror/Tiptap
JSON documents and an HTML renderer. Supports all standard node types
(headings, paragraphs, lists, tables, code blocks, images, blockquotes)
and mark types (bold, italic, underline, strike, code, link).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codenem codenem closed this Mar 26, 2026
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