Skip to content

fix(atomic): exportparts added to export parts from atomic-generated-answer sub-components#7619

Open
mmitiche wants to merge 4 commits into
mainfrom
SFINT-6764
Open

fix(atomic): exportparts added to export parts from atomic-generated-answer sub-components#7619
mmitiche wants to merge 4 commits into
mainfrom
SFINT-6764

Conversation

@mmitiche
Copy link
Copy Markdown
Contributor

@mmitiche mmitiche commented May 21, 2026

SFINT-6764

Summary

This PR makes generated-answer parts consistently style-able from atomic-generated-answer.

Changes

  • Added missing exportparts attributes across nested generated-answer components.
  • Exposed inline link parts and allowed exportparts in markdown sanitization for atomic-generated-answer-inline-link
  • Documented follow-up input parts in atomic-generated-answer JSDoc.
  • Added/updated tests for part exporting and sanitizer config.

Demo

The following example is created after targeting multiple parts with a style tag in genqa.html, the parts are successfully styles now that the parts are correctly exported:

Screen.Recording.2026-05-21.at.4.34.11.PM.mov

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

🦋 Changeset detected

Latest commit: 59129ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@coveo/atomic Patch
@coveo/atomic-react Patch
@coveo/atomic-angular Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@svcsnykcoveo
Copy link
Copy Markdown

svcsnykcoveo commented May 21, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@chromatic-com
Copy link
Copy Markdown

chromatic-com Bot commented May 21, 2026

Tip

All tests passed and all changes approved!

🟢 UI Tests: 366 tests unchanged
🟢 UI Review: 366 stories published -- no changes
Storybook icon Storybook Publish: 366 stories published

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 21, 2026

@coveo/atomic

npm i https://pkg.pr.new/@coveo/atomic@7619

@coveo/atomic-hosted-page

npm i https://pkg.pr.new/@coveo/atomic-hosted-page@7619

@coveo/atomic-legacy

npm i https://pkg.pr.new/@coveo/atomic-legacy@7619

@coveo/atomic-react

npm i https://pkg.pr.new/@coveo/atomic-react@7619

@coveo/auth

npm i https://pkg.pr.new/@coveo/auth@7619

@coveo/bueno

npm i https://pkg.pr.new/@coveo/bueno@7619

@coveo/create-atomic

npm i https://pkg.pr.new/@coveo/create-atomic@7619

@coveo/create-atomic-component

npm i https://pkg.pr.new/@coveo/create-atomic-component@7619

@coveo/create-atomic-component-project

npm i https://pkg.pr.new/@coveo/create-atomic-component-project@7619

@coveo/create-atomic-result-component

npm i https://pkg.pr.new/@coveo/create-atomic-result-component@7619

@coveo/create-atomic-rollup-plugin

npm i https://pkg.pr.new/@coveo/create-atomic-rollup-plugin@7619

@coveo/headless

npm i https://pkg.pr.new/@coveo/headless@7619

@coveo/headless-react

npm i https://pkg.pr.new/@coveo/headless-react@7619

@coveo/shopify

npm i https://pkg.pr.new/@coveo/shopify@7619

commit: 59129ed

@mmitiche mmitiche marked this pull request as ready for review May 21, 2026 22:50
@mmitiche mmitiche requested review from a team, Copilot, fbeaudoincoveo and y-lakhdar May 21, 2026 22:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes atomic-generated-answer styling more consistent by ensuring important shadow parts from nested generated-answer sub-components are re-exported and therefore styleable from the top-level component.

Changes:

  • Added exportparts propagation for generated answer thread content and follow-up input so consumers can style deeper parts from atomic-generated-answer.
  • Exposed inline-link parts by adding exportparts to generated markdown link output, and updated markdown sanitization to allow the exportparts attribute.
  • Added/updated unit tests validating exportparts propagation and sanitizer configuration.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/atomic/src/components/search/atomic-generated-answer/atomic-generated-answer.ts Adds exportparts for thread + follow-up input, and documents follow-up input parts in JSDoc.
packages/atomic/src/components/search/atomic-generated-answer/atomic-generated-answer.spec.ts Adds assertions for exportparts on thread and follow-up input.
packages/atomic/src/components/common/generated-answer/generated-content/markdown-utils.ts Adds exportparts attribute to rendered <atomic-generated-answer-inline-link> markup.
packages/atomic/src/components/common/generated-answer/generated-content/markdown-utils.spec.ts Updates expected HTML output to include exportparts on inline links.
packages/atomic/src/components/common/generated-answer/generated-content/generated-markdown-content.ts Allows exportparts through sanitizer config for atomic-generated-answer-inline-link.
packages/atomic/src/components/common/generated-answer/generated-content/generated-markdown-content.spec.ts Updates sanitizer config expectation to include exportparts.
packages/atomic/src/components/common/atomic-generated-answer-thread/atomic-generated-answer-thread.ts Re-exports generated answer content parts from nested atomic-generated-answer-content.
packages/atomic/src/components/common/atomic-generated-answer-thread/atomic-generated-answer-thread.spec.ts Adds a test ensuring nested answer-content receives the expected exportparts.
.changeset/gentle-cats-knock.md Adds a patch changeset for the Atomic package.

Comment on lines +46 to +50
const GENERATED_ANSWER_THREAD_EXPORT_PARTS = [
'feedback-and-copy-buttons',
'feedback-button',
'copy-button',
'citations-label',
Copy link
Copy Markdown
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.

As long as we are sure all those parts need to be exported as part im fine with this. This is a lot of customization though XD

@mmitiche
Copy link
Copy Markdown
Contributor Author

mmitiche commented May 22, 2026

As long as we are sure all those parts need to be exported as part im fine with this. This is a lot of customization though XD

This PR does not export additional parts,
All these parts were previously exported. however when we created new custom elements, we broke these exposure so these parts became no longer customizable.

This PR simply restores, this exposure to allow parts to be customizable again.

The only parts that this PR adds are the 3 inline link parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants