Skip to content

fix(ChatbotWelcomePrompt): Wrap text - #920

Open
rebeccaalpert wants to merge 1 commit into
patternfly:mainfrom
rebeccaalpert:prompt-wrap
Open

rebeccaalpert wants to merge 1 commit 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.

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.

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.

ChatbotWelcomePrompt: long prompt title and message overflow suggestion cards

3 participants