Skip to content

Add support for SmartConversation::Message component#464

Open
phndiaye wants to merge 6 commits into
masterfrom
pn/vel-7659
Open

Add support for SmartConversation::Message component#464
phndiaye wants to merge 6 commits into
masterfrom
pn/vel-7659

Conversation

@phndiaye
Copy link
Copy Markdown
Member

@phndiaye phndiaye commented May 5, 2026

What does this PR do?

Add support for SmartConversation::Message component, to be used in Chat-like UIs w/ our LLM provider backed.

The message is properly styled depending on whether it's a user prompt or a reply from the system, with replies being also collapsible (collapsed by default)

What are the observable changes?

Screenshot 2026-05-05 at 13 13 37 Screenshot 2026-05-05 at 13 13 32

🧑‍💻 Developer Heads Up

⚡ Since we are using Ember Octane now:

  • Feel free to migrate existing components to Glimmer Components.
  • Write new ones exclusively in it.

Useful Resource : Ember Octane vs Classic Cheat Sheet

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Migrated touched components to Glimmer Components
  • Properly labeled

@phndiaye phndiaye requested a review from a team as a code owner May 5, 2026 11:14
@phndiaye phndiaye requested review from aprentout, edouardmisset and olxmpe and removed request for a team May 5, 2026 11:14
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

@Elodie-DeMatteis-Upf Elodie-DeMatteis-Upf left a comment

Choose a reason for hiding this comment

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

A few nitpicks. Otherwise LGTM!

@tracked collapsed: boolean = true;

get collapsible(): boolean {
return this.args.type === 'smart_reply';
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.

Product nit: User prompts are not collapsible? Even if they are very long? 🤔

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.

actually, nothing actually says it in the spec so i'll rollback this change. I just didn't see how it could naturally be that long unless someone drops a lorem ipsum in the prompt 😅

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.

@Miexil following our discussion yesterday, do you think it's worth having collapsible as an arg (default: true) for potential future uses?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can make a mini update here in the future if needed 🙏

Comment thread addon/components/utils/smart-conversation/message.ts Outdated
setupRenderingTest(hooks);

hooks.beforeEach(function () {
this.timestamp = moment('2026-05-05').valueOf();
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.

It may be better to test it with different day/month values, just to be sure

Comment thread tests/integration/components/utils/smart-conversation/message-test.ts Outdated
gap: var(--spacing-px-18);
padding: var(--spacing-px-12) var(--spacing-px-18);
font-size: var(--font-size-md);
font-family: 'Reddit Sans', sans-serif;
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.

New font?

class={{this.computedClasses}}
role="button"
data-control-name="smart-conversation-message"
{{on "click" this.toggleCollapsed}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe we can add in the splattributes just-in-case

@tracked collapsed: boolean = true;

get collapsible(): boolean {
return this.args.type === 'smart_reply';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can make a mini update here in the future if needed 🙏

export default class UtilsSmartConversationMessageComponent extends Component<UtilsSmartConversationMessageComponentSignature> {
@tracked collapsed: boolean = true;

get collapsible(): boolean {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this one is private 🙈

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.

7 participants