Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Preview Title not showing up in preview component

Open AmanNegi opened this issue 1 year ago • 1 comments

Description:

When we implement RC Slash Command, we can either use the previewer function or the executor function. The previewer function allows the return type as ISlashCommandPreview, which is essentially a list of preview items and a title(i18n).

The preview items, do render as expected however the i18nTitle doesn't render and doesn't show up anywhere.

Steps to reproduce:

  1. Generate a RC App.
  2. Implement ISlashCommand, and create a simple preview function that returns a valid ISlashCommandPreview item, with a title.
  3. Try the command on your local instance, and you'll notice no title shows up. (no items will show up as well, because we don't return any).

Alternatively, you could use the gist provided below, it's a basic implementation of ISlashCommand with a preview function that returns a list of text items and a title.

https://gist.github.com/AmanNegi/edea0ae7e7033493f5132d78ff01e29e

Expected behavior:

The i18nTitle should show up above the list of items, acting as an helping text/context for users to understand the command preview palette better.

Actual behavior:

Currently, it doesn't show the text provided anywhere. I've tried providing plain text as well as providing i18n text, by creating and utilizing the en.json file.

I know that, i18n is implemented correctly as it does work correctly in the ISlashCommand where we have to provide the i18nDescription.

Screenshot from 2024-07-03 11-33-46

Server Setup Information:

  • Version of Rocket.Chat Server: Latest & Develop tested
  • Operating System: Linux
  • Deployment Method: Docker

Client Setup Information

  • Desktop App or Browser Version: Firefox 127.0
  • Operating System: Ubuntu 22.04

AmanNegi avatar Jul 07 '24 05:07 AmanNegi

Thanks for reporting.

I'ñl ask someone to take a look.

reetp avatar Jul 07 '24 19:07 reetp

Indeed this title is not being used...

To add the title we need to add it here: https://github.com/RocketChat/Rocket.Chat/blob/ee43f2c57c87a6dda64b3250bfb3cc04caa8bda2/apps/meteor/client/views/room/providers/ComposerPopupProvider.tsx#L353

The same way it's being used in the slash commands previews here : https://github.com/RocketChat/Rocket.Chat/blob/ee43f2c57c87a6dda64b3250bfb3cc04caa8bda2/apps/meteor/client/views/room/providers/ComposerPopupProvider.tsx#L280

I'm going to send this to our design team, because we don't have a clear guideline on our Design system - Web & desktop (Community) – Figma

hugocostadev avatar Jul 31 '24 14:07 hugocostadev

@hugocostadev Any updates on this? ☺️ We're also looking at using this title in order to pay attributions to services our apps are using in order to adhere to ToS.

Wholteza avatar Jan 27 '25 19:01 Wholteza

You don't need to @ people.

In any event Hugo is no longer at Rocket.

I'll pass it to the team for review but might take a while.

reetp avatar Jan 28 '25 00:01 reetp

Folks, I'll be placing this on engineering queue, but might be a while before it gets more attention.

casalsgh avatar Jan 28 '25 14:01 casalsgh