AB#10000 bugfix(CSA-85062): moved the text from gallery card title into textbox#249
AB#10000 bugfix(CSA-85062): moved the text from gallery card title into textbox#249conner-nice wants to merge 4 commits into
Conversation
…xt box instead of on top of the image itself
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
This PR fixes the gallery card layout so slide titles no longer overlay the image; instead, the title is rendered in the text/content block beneath the image (matching the older/C26 behavior described in the PR).
Changes:
- Updated
GalleryItemrendering logic so the content block is shown when a title exists, and moved the title<h4>into that content block. - Updated gallery CSS to remove the absolute-positioned overlay title styling and normalize title/subtitle spacing in the bottom content area.
- Added tests to assert the title is rendered beneath the image (including a case with no subtitle/buttons), and bumped the package version.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
test/Gallery.spec.tsx |
Adds assertions ensuring gallery titles are rendered in the content area below the image. |
src/messages/Gallery/GalleryItem.tsx |
Moves title rendering into the content block and adjusts when the content block is rendered. |
src/messages/Gallery/Gallery.module.css |
Removes overlay title positioning and normalizes bottom content typography spacing. |
package.json |
Bumps library version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "name": "@cognigy/chat-components", | ||
| "version": "0.72.0", | ||
| "version": "0.74.1", | ||
| "type": "module", |
There was a problem hiding this comment.
Synced in 25943ba — package-lock.json's root version is now 0.74.1 to match package.json.
- tighten gallery title test assertion: scope the "not in content block" check to the slide image (selected by alt text) instead of any <img>, so the test survives ActionButtons rendering images later - sync package-lock.json root version to 0.74.1 to match package.json
…1 baseline
The Gallery title relocation in this PR is an intentional DOM contract
change, so the three gallery cases ('bot gallery (generic template)',
'demo: gallery', 'demo: gallery (null buttons)') diverge from the baseline
the install script resolves (currently 0.72.0). Skip them with `it.skip.each`
so they still appear in the report, with a TODO to remove once 0.74.1
publishes and the baseline auto-catches-up via the version-min policy in
scripts/install-dom-compat-baseline.mjs.
The other 37 cases still guard the Message DOM contract.
|
This change also affects Webchat v3 and needs to be discussed with our PO first. We previously agreed to introduce a dedicated endpoint setting so customers can choose themselves whether the title appears inside or below the image. We need to make sure this change doesn't conflict with or silently override that decision. (AB#63575) |
Rework to add a new setting to descide the title positon
|
What
Fixes CSA-85062. The Gallery card title was rendered as an absolutely-positioned overlay on top of the image, leaving it unreadable on light-background images. Moves the title into the text content block beneath the image, restoring the pre-C26 behavior.
Visual comparison
Left: previous version. Right: C26. After this fix, C26 matches the previous version.
Changes
src/messages/Gallery/GalleryItem.tsx— moved the title<Typography component="h4">out of the.top(image) container and into the.bottom(content) block alongsidesubtitleandbuttons. Title is now gated ontitle &&so cards without one render cleanly. RenamedhasExtraInfo→hasContentand foldedtitleinto the gate so a title-only card still gets a content block.src/messages/Gallery/Gallery.module.css— removed the absolute-positioned overlay rule for.slideItem .top h4; addedh4to the same margin/padding reset aspinside.slideItem .bottom.test/Gallery.spec.tsx— two new tests verifying the title lives inside.webchat-carousel-template-content(i.e. below the image, not overlaying it), including the title-only-card edge case.package.json— version bump0.72.0→0.74.1.How to test
npm test— the Gallery suite now asserts the title is in the content block and not the image container.Downstream
Cognigy.AI monorepo will bump
@cognigy/chat-componentsinmicrofrontends/interaction-panel/package.jsononce this is released.