fix: remove trailing space in formatting toolbar tooltips#1312
Open
yash113gadia wants to merge 1 commit into
Open
fix: remove trailing space in formatting toolbar tooltips#1312yash113gadia wants to merge 1 commit into
yash113gadia wants to merge 1 commit into
Conversation
The Tooltip text template literal unconditionally inserted a space between the formatter name and the (optional) shortcut. For formatters without a keyboard shortcut (strike, code, multiline), `item.shortcut` is an empty string, so the tooltip rendered as "strike ", "code ", "multiline " with a trailing space. Made the space conditional so it only appears alongside an actual shortcut. Applied to both the main toolbar and the small-screen toolbar. Closes RocketChat#1280
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix trailing space in formatting toolbar tooltips
Acceptance Criteria fulfillment
name (shortcut)name— no trailing spaceFixes #1280
Description
The
Tooltiptext template literal inChatInputFormattingToolbar.jsunconditionally inserted a space between the formatter name and the optional shortcut:When
item.shortcutis an empty string (formatters likestrike,code,multiline),item.shortcut && ...evaluates to'', but the leading space in the template was still included — so the tooltip rendered as"strike ","code ","multiline "with a trailing space.The space is now part of the conditional, so it only appears when there is an actual shortcut:
The same pattern existed in the small-screen toolbar block, so it was fixed there too.
PR Test Details
name (shortcut).Lint passes on the changed file (
eslintclean; pre-existing unrelated warnings untouched).