Add prosemirror package for JSON parsing and HTML rendering#938
Closed
codenem wants to merge 12 commits intoepic/rich-editorfrom
Closed
Add prosemirror package for JSON parsing and HTML rendering#938codenem wants to merge 12 commits intoepic/rich-editorfrom
codenem wants to merge 12 commits intoepic/rich-editorfrom
Conversation
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: 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg/prosemirrorwith Go structs to unmarshal ProseMirror/Tiptap JSON documents (Node,Mark, and type-specific attribute structs usingjson.RawMessagefor strict typing)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)Test plan
make test MODULE=./pkg/prosemirror— all tests passmake lint— clean🤖 Generated with Claude Code
Summary by cubic
Adds
pkg/prosemirrorto 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 andRenderHTML(Node)supporting standard nodes/marks; golden tests included.github.com/vikstrous/dataloadgen; addsLoadByIDs(e.g., controls) and switches resolvers to batched fetches.Bug Fixes
rankfrom item fragment and passrankto the edit dialog.documentTypeFilterto refetch deps and wrap refetch instartTransitionto avoid stale data.Written for commit ebc71b7. Summary will update on new commits.