Skip to content

fix(ChatbotWelcomePrompt): Wrap text - #920

Merged
rebeccaalpert merged 2 commits into
patternfly:mainfrom
rebeccaalpert:prompt-wrap
Oct 13, 2026
Merged

rebeccaalpert merged 2 commits into
patternfly:mainfrom
rebeccaalpert:prompt-wrap

Conversation

@rebeccaalpert

@rebeccaalpert rebeccaalpert commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Text was not wrapping properly; added additional CSS to make sure Flex layout functions as desired.

The ticket asks for truncation. In talking to other folks, I don't think we want to do this right now, but we shouldn't be breaking the default Card text wrap with our flex layout. I am adding classes you can target if you want to wrap the text differently instead.

You can reproduce/test at https://chatbot-pr-chatbot-920.surge.sh/extensions/chatbot/ui#welcome-prompt.

Addresses #910

@rebeccaalpert
rebeccaalpert force-pushed the prompt-wrap branch 2 times, most recently from 1773c21 to c25017c Compare October 8, 2026 19:11
@patternfly-build

patternfly-build commented Oct 8, 2026 •

Copy link
Copy Markdown

@patternfly-build

Copy link
Copy Markdown

Text was not wrapping properly; added additional CSS to make sure Flex layout functions as desired.

Fixes patternfly#910

@mcoker mcoker 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.

LGTM. Left a couple of nits, but it's 👍 as is.

overflow: visible;
height: 100%;
min-width: 0;
overflow-wrap: anywhere;

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.

I would only apply it to the whole element like this if you're 100% the children (always cards I'm assuming?) only have text. Otherwise I would target the text parts of the children specifically. Applying overflow-wrap: anywhere; on containers with lots of children and layouts can have adverse effects.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Moved to body; thank you!

Comment on lines +37 to +38
.pf-chatbot__prompt-suggestion-title {
overflow-wrap: anywhere;

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.

This is fine but just a nit - to avoid specificity issues in the future, since there is a var for this style, I would use the var and apply it to the card wrapper. --pf-v6-c-card__title-text--OverflowWrap: anywhere;

If you wanted to do that, looks like you could apply it to .pf-chatbot__prompt-suggestions > * above.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adjusted this here - the variable doesn't work on the body section for whatever reason.

@rebeccaalpert
rebeccaalpert merged commit ac31285 into patternfly:main Oct 13, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 6.9.0-prerelease.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

ChatbotWelcomePrompt: long prompt title and message overflow suggestion cards

4 participants