Skip to content

feat(demo-schema-react): render the research card related documents - #8675

Open
dguerinCoveo wants to merge 8 commits into
feat/mock-research-related-documentsfrom
feat/research-card-related-documents
Open

dguerinCoveo wants to merge 8 commits into
feat/mock-research-related-documentsfrom
feat/research-card-related-documents

Conversation

@dguerinCoveo

@dguerinCoveo dguerinCoveo commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Jira

https://coveord.atlassian.net/browse/SVCC-6607

Motivation

Stacked on #8710, which adds the documents to the mock service and pins the schema.

The demo's Product Education answer now lists the product's related documents, such as manuals and installation guides, in a "Documentation & manuals" section under the research card. The agent sends them on the card state as relatedDocuments (agent-smith#988), and each client chooses how many to show.

Changes

  • ProductResearchCard renders the documents below the card, one row each: a file icon, the title, and the file type and size (PDF - 333.2 kB). The whole row opens the document in a new tab. The section is hidden when there are none.
  • New maxLinks option (default 10), set through createThermidorCatalog({productResearchCard: {maxLinks}}). The demo app shows 5.

Details

  • Only title is required on a document. File type and size show only when present, a document without a link renders as plain text, and one with neither a title nor a link is skipped.
  • createThermidorCatalog() without options behaves as before.
  • Documents carry no id, so the list is keyed by position.
  • The layout follows the product design; there is no download button. Sizes use decimal units (kB).
  • The section sits inside the card's component, so it needs no new Thermidor component and no agent change.

Validation

  1. pnpm --filter @coveo/thermidor run build, then in samples/thermidor/demo-schema-react run pnpm exec vitest run src/a2ui/ProductResearchCard. All 28 tests pass.
  2. In the same folder, pnpm exec tsc --noEmit -p .. No errors.
  3. In mock mode: pnpm dev:mock, then send tell me more about the thermoflex winter wetsuit. The card shows, then 5 of the 6 mock documents as rows.
  4. End to end through thermidor-stack on a dev org with agent-smith#988: a Product Education question shows the card, then 5 of the 10 documents the agent sent as rows.

Screenshots

image

Checklist

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a113755

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@svcsnykcoveo

svcsnykcoveo commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ 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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

commit: a113755

@chromatic-com

chromatic-com Bot commented Oct 14, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: 439 tests unchanged
🟢 UI Review: No changes
Storybook icon Storybook Publish: 471 stories published

@chromatic-com

chromatic-com Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: 439 tests unchanged
🟢 UI Review: No changes
Storybook icon Storybook Publish: 471 stories published

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🔗 Scratch Orgs ready to test this PR:

@fbeaudoincoveo fbeaudoincoveo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What this PR is currently lacking is adjustments in the mock service (based on the schema changes in https://github.com/coveo-platform/thermidor-schema/pull/152) to be able to test the feature before actually implementing it in the backend.

See for instance what I did in this PR stack to add breadbox support:

The ProductResearchCard lists the relatedDocuments the agent sends, with each
document's file type and size. createThermidorCatalog takes a
productResearchCard.maxLinks option (default 10) that caps the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dguerinCoveo and others added 6 commits October 16, 2026 13:30
Render a document without a link as plain text, drop the separator when the
file type or size is missing, label the section by its heading, and round the
size before choosing its unit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The demo creates its catalog with productResearchCard.maxLinks set to 5. The
component default stays 10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nentid

thermidor-schema#152 ships related documents without permanentid, and only
title is required, so file type and size are optional in the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The catalog builds the card through createProductResearchCard, so the
prebuilt ProductResearchCard and the exported default limit are unused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A document with neither a title nor a link no longer takes a maxLinks
slot. Tests cover negative, fractional and infinite maxLinks, as the
option's doc comment describes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…earch card

The documents move out of the card into a full-width "Documentation &
manuals" section: one row per document with a file icon, the title and
the file type and size. The whole row opens the document. Sizes use
decimal units, like 333.2 kB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dguerinCoveo
dguerinCoveo force-pushed the feat/research-card-related-documents branch from bb4a65a to 21fb08e Compare October 16, 2026 17:30
@dguerinCoveo
dguerinCoveo changed the base branch from main to feat/mock-research-related-documents October 16, 2026 17:30
@dguerinCoveo
dguerinCoveo added this pull request to stack #8711 October 16, 2026 17:48
@dguerinCoveo
dguerinCoveo marked this pull request as ready for review October 16, 2026 17:49
Copilot AI balanced review requested due to automatic review settings October 16, 2026 17:49
@dguerinCoveo

dguerinCoveo commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

What this PR is currently lacking is adjustments in the mock service (based on the schema changes in coveo-platform/thermidor-schema#152) to be able to test the feature before actually implementing it in the backend.

See for instance what I did in this PR stack to add breadbox support:

Added a mock server in pr1

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Document metadata contrast falls below WCAG AA requirements on both normal and hover/focus backgrounds.

1 open finding
What changed in this PR

Adds related documentation to the React demo’s product research cards, using documents supplied by the agent and mock service.

Changes:

  • Renders document rows with optional links, file types, and decimal file sizes.
  • Adds configurable document limits: 10 by default, 5 in the demo.
  • Extends tests and updates the component documentation.
File Description
samples/​thermidor/​demo-schema-react/​src/​components/​AppShell.tsx Limits displayed documents to five.
samples/​thermidor/​demo-schema-react/​src/​a2ui/​ProductResearchCard/​ProductResearchCard.tsx Renders documents and formats sizes.
samples/​thermidor/​demo-schema-react/​src/​a2ui/​ProductResearchCard/​ProductResearchCard.test.tsx Tests rendering, limits, and formatting.
samples/​thermidor/​demo-schema-react/​src/​a2ui/​ProductResearchCard/​ProductResearchCard.module.css Styles document rows and interaction states.
samples/​thermidor/​demo-schema-react/​src/​a2ui/​mount-surface.harness.tsx Supports catalog options in tests.
samples/​thermidor/​demo-schema-react/​src/​a2ui/​icons/​index.ts Exports the file icon.
samples/​thermidor/​demo-schema-react/​src/​a2ui/​icons/​FileIcon.tsx Adds a decorative document icon.
samples/​thermidor/​demo-schema-react/​src/​a2ui/​components.tsx Passes options to the research-card factory.
samples/​thermidor/​demo-schema-react/​README.md Documents the related-document input.

🧠 Review effort: Balanced

The file type and size line used the muted text colour, below WCAG AA
contrast on the row and its hover background. It now uses the secondary
text colour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

2 active deployments
PR Artifacts — a113755e Deployed Oct 16, 2026 by dguerinCoveo via Build & commit missing generated files #20113
pr-workflows — a113755e Deployed Oct 16, 2026 by dguerinCoveo via label #9747
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.

4 participants