Skip to content

✨ Allow Compact Starters to Be Dismissed and Mirror bottom-left Layout#107

Merged
cristiantela merged 4 commits intov3-mainfrom
feat/close-suggested-questions
May 7, 2026
Merged

✨ Allow Compact Starters to Be Dismissed and Mirror bottom-left Layout#107
cristiantela merged 4 commits intov3-mainfrom
feat/close-suggested-questions

Conversation

@cristiantela
Copy link
Copy Markdown
Collaborator

Description

Type of Change

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Tests
  • Other

Motivation and Context

The compact conversation starters lacked a way to be dismissed by the user, and its layout was hardcoded for right-side placement. This PR adds a close button so users can dismiss the starters panel, adds a position prop to mirror the layout correctly when the widget is anchored to bottom-left, and introduces unit tests for both changes as well as for FSButton's new onlyIcon behaviour.

Summary of Changes

  • ConversationStartersCompact — close button: Added an FSButton close button inside the compact starters panel. It calls an onClose callback (passed from Widget, wired to clearStarters) when clicked. Widget was updated to destructure clearStarters from useConversationStarters and forward it as onClose.

  • ConversationStartersCompactposition prop: Added a position prop ('bottom-right' | 'bottom-left', both in PropTypes). The value is applied as a BEM modifier class (weni-starters-compact--bottom-right / weni-starters-compact--bottom-left). The --bottom-left variant flips alignment, margin, and close-button corner in SCSS. Widget forwards config.position to keep layout and widget position in sync.

  • FSButtononlyIcon prop: Added an onlyIcon boolean prop. When true, it appends the weni-fs-button--only-icon class and forces the icon size to 'medium' regardless of the size prop, ensuring consistent icon sizing for icon-only buttons.

  • Tests: Added ConversationStarters.test.jsx coverage for the close button (renders, calls onClose, safe without onClose, does not fire onStarterClick) and for both position modifier classes. Created FSButton.test.jsx covering rendering, all variant/size/modifier classes, onlyIcon class and icon-size behaviour, icon rendering, loading state, and disabled state.

Design Files

Shopping assistant – Suggested questions

Demonstration

image

@cristiantela cristiantela merged commit c14c8a6 into v3-main May 7, 2026
2 checks passed
@cristiantela cristiantela deleted the feat/close-suggested-questions branch May 7, 2026 20:15
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.

2 participants