RocketChat / RocketChat/EmbeddedChat
bug: Tooltip shows trailing space for formatters without keyboard shortcut
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 165
- Forks
- 381
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Description
Description
Template literal always inserts a space between item.name and the shortcut expression, even when shortcut is empty string
Steps to reproduce
- Open
packages/react/src/views/ChatInput/ChatInputFormattingToolbar.jsaround line 219 - Tooltip text for 'strike', 'code', and 'multiline' renders as 'strike ', 'code ', 'multiline ' (with trailing space) instead of the bare name
Expected behavior
item.shortcut && (${item.shortcut}) evaluates to '' (empty string) when shortcut is '', but the space separator ${...} is unconditionally included in the template literal, producing a trailing space should be handled correctly.
Actual behavior
Tooltip text for 'strike', 'code', and 'multiline' renders as 'strike ', 'code ', 'multiline ' (with trailing space) instead of the bare name
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/react/src/views/ChatInput/ChatInputFormattingToolbar.js around line 219, where the tooltip text for formatting items is assembled. Check the output for strike, code, and multiline with empty shortcuts; done means each shows only its bare name without a trailing space, while items with shortcuts retain their shortcut text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100