ChatbotWelcomePrompt: long prompt title and message overflow suggestion cards

Open Beginner friendly
#910 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start with the ChatbotWelcomePrompt implementation and its pf-chatbot__prompt-suggestion cards, then reproduce the issue using the long title and message from the report. Done means titles truncate to a single ellipsis line and messages clamp to a reasonable number of lines without overflowing the card boundary.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
6
Forks
37
Avg merge
3d 19h
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from patternfly/chatbot

All issues in patternfly/chatbot

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.