fix(atomic) issue with the Atomic-generated-answer collapsible parameter is not working as expected#7240
Merged
SimonMilord merged 1 commit intomainfrom Mar 18, 2026
Merged
fix(atomic) issue with the Atomic-generated-answer collapsible parameter is not working as expected#7240SimonMilord merged 1 commit intomainfrom
SimonMilord merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the initialization logic for the generated answer’s collapsible behavior so height measurement can run when collapsible is enabled, and updates unit tests to reflect the intended collapsible enable/disable semantics.
Changes:
- Initialize the
ResizeObserverwhen thecollapsibleprop is enabled (instead of gating onisCollapsibleEnabled, which depends on an already-measured height). - Adjust and rename tests to validate
renderAnswerContentreceives the correctcollapsiblevalue when the feature is disabled/enabled. - Update test height values to ensure “tall content” reliably exceeds
maxCollapsedHeight.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/atomic/src/components/search/atomic-generated-answer/atomic-generated-answer.ts | Fixes ResizeObserver initialization gating to allow measuring height when collapsible is enabled. |
| packages/atomic/src/components/search/atomic-generated-answer/atomic-generated-answer.spec.ts | Updates collapsible-related assertions and test setup to match the corrected initialization behavior. |
louis-bompart
approved these changes
Mar 16, 2026
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.
SFINT-6691
This is following a support case from a client, the issue was introduced in v3.52.1
ISSUE:
The answer collapse behaviour was inconsistent because the collapsibility of the answer depended on measured content height too early in the lifecycle. This could prevent long answers from appearing collapsible even when
collapsiblewas enabled.SOLUTION:
The fix ensures resize observation starts whenever
collapsibleis enabled, so answer height is measured and updated reliably after render. Collapsibility is then applied only when all required conditions are met:collapsible=true, follow-ups are not enabled, and content height exceeds the configured collapsed height. This guarantees that follow-up mode is never collapsible while preserving correct collapse/expand behaviour for long single answers.Why not just change the
isCollapsibleEnabled?Because they solve different problems.
isCollapsibleEnabled is :
The initialization condition controls whether measurement starts at all ( ResizeObserver setup)
If that condition depends on isCollapsibleEnabled, it creates a problem: height is unknown before observing, so isCollapsibleEnabled is initially false, so observer never starts, so height never updates.
So the observer condition should stay broad (this.collapsible) to start measuring, while isCollapsibleEnabled should stay strict to decide when collapse UI is actually enabled.