Skip to content

ChatbotWelcomePrompt: long prompt title and message overflow suggestion cards #910

Description

@its-mitesh-kumar

Description

When ChatbotWelcomePrompt renders welcome/suggested prompt cards with long title or message values, the text overflows horizontally outside the card boundary instead of truncating.

This is especially visible when consumers pass user-generated content (e.g. saved prompts with long names and bodies) as prompts[].title and prompts[].message.

Steps to reproduce

  1. Render ChatbotWelcomePrompt with a prompt like:
<ChatbotWelcomePrompt
  title="Hello"
  description="How can I help?"
  prompts={[
    {
      title: 'aDSFGGEWRTYUIOPASDFGHJKLZXCVBNMQWERTYUIOPASDFGHJKLZXCVBNM',
      message: 'QEWRETRTDYUIOPASDFGHJKLZXCVBNMQWERTYUIOPASDFGHJKLZXCVBNMQWERTY',
      onClick: () => {},
    },
  ]}
/>
  1. Observe the card title and body text extend past the card border.

Expected behavior

  • Prompt card title should truncate with ellipsis (single line).

  • Prompt card message/body should clamp to a reasonable number of lines (e.g. 2) with ellipsis.

Actual behavior

Title and message render as unbroken single-line strings that overflow the card container.

Component / version

  • Component: ChatbotWelcomePrompt (pf-chatbot__prompt-suggestion cards)

  • @patternfly/chatbot version observed: 6.9.0-prerelease.2

Suggested fix

Apply truncation styles in ChatbotWelcomePrompt (or underlying PF CardTitle / CardBody usage), e.g.:

  • CardTitle: overflow: hidden; text-overflow: ellipsis; white-space: nowrap

  • CardBody: multi-line clamp (-webkit-line-clamp: 2) for message

Optionally expose props to control clamp line count.

Workaround

Consumers currently override via CSS targeting .pf-chatbot__prompt-suggestion .pf-v6-c-card__title and .pf-v6-c-card__body.


Jira Issue: PF-4645

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions