Preview Title not showing up in preview component
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:
- Generate a RC App.
- Implement ISlashCommand, and create a simple preview function that returns a valid
ISlashCommandPreviewitem, with a title. - 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,
i18nis implemented correctly as it does work correctly in theISlashCommandwhere we have to provide thei18nDescription.
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
Thanks for reporting.
I'ñl ask someone to take a look.
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 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.
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.
Folks, I'll be placing this on engineering queue, but might be a while before it gets more attention.