Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(quantic): rich text formatting for quantic RGA #4015

Merged
merged 22 commits into from
Jun 25, 2024
Merged

Conversation

erocheleau
Copy link
Collaborator

@erocheleau erocheleau commented May 27, 2024

SFINT-5459

Rich Text Formatting supported within the Quantic RGA component.

Very similar in essence to what @lbergeron did.

Some tweaks and changes were made to the styling of the rendered HTML based on Salesforce design system.

Unit tests were made for the new components and code, but i can't find a good way to create e2e tests for this feature.
It heavily depends on first receiving an EventStream message to set the answerType, and THEN renders markdown as HTML. We don't have the setup to be able to mock two consecutive RGA EventStream events, only one.

Some examples of rendered HTML:

Code blocks
image

Table: has a maximum height and is scrollable horizontally and vertically
image

Different levels of headers, all headers are repleaced with

elements instead of using h1,h2,h3,etc. elements in order to not break headings hierarchy in the page and break accessibility rules:
image

Inline code
image

With Collapse = true
image

Added some Cypress tests too!

I am covering most of the "irregular" cases where we differ from the simple behavior of the marked library.

image

added marked as static resource
fixed build warning in quanticCitation.js
modified quanticGeneratedAnswer to specify it supports markdown
Styling added for the new markdown answer
Copy link
Contributor

@lbergeron lbergeron left a comment

Choose a reason for hiding this comment

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

That's very nice!

@erocheleau erocheleau marked this pull request as ready for review June 13, 2024 00:59
@erocheleau erocheleau requested review from a team as code owners June 13, 2024 00:59
@developer-experience-bot
Copy link
Contributor

developer-experience-bot bot commented Jun 13, 2024

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Live demo links

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 204.9 204.9 0
commerce 293.1 293.1 0
search 372.4 372.4 0
insight 352.4 352.4 0
product-listing 267 267 0
product-recommendation 170.8 170.8 0
recommendation 217.8 217.8 0
ssr 365.2 365.2 0

SSR Progress

Use case SSR (#) CSR (#) Progress (%)
search 39 44 89
recommendation 0 4 0
product-recommendation 0 10 0
product-listing 0 13 0
case-assist 0 6 0
insight 0 27 0
commerce 0 15 0
Detailed logs search : buildInteractiveResult
search : buildInteractiveInstantResult
search : buildInteractiveRecentResult
search : buildInteractiveCitation
search : buildGeneratedAnswer
recommendation : missing SSR support
product-recommendation : missing SSR support
product-listing : missing SSR support
case-assist : missing SSR support
insight : missing SSR support
commerce : missing SSR support

Copy link
Contributor

@mmitiche mmitiche left a comment

Choose a reason for hiding this comment

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

Nice job 👍

Copy link
Contributor

@SimonMilord SimonMilord left a comment

Choose a reason for hiding this comment

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

Nice job on the tests!

Copy link
Contributor

@mmitiche mmitiche left a comment

Choose a reason for hiding this comment

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

Nice job 👍
It would be nice if we could have a test covering the DOM purification logic.

Copy link
Collaborator

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

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

RSLGTM: @coveo/search was included 'cause of the lockfile, so I did not review the code.

@erocheleau erocheleau added this pull request to the merge queue Jun 25, 2024
Merged via the queue into master with commit bb4f76a Jun 25, 2024
86 of 89 checks passed
@erocheleau erocheleau deleted the SFINT-5459 branch June 25, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants