Repository navigation
fix(chat): Stick message toolbar to the message content and display message time on hover - #21583
Conversation
…essage time on hover
WalkthroughThe pull request introduces several modifications to the Styling updates in the Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (3)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/styles.ts (2)
92-102: Consider removing !important flag from hover styles.The use of
!importantin hover styles might indicate specificity issues. Consider restructuring the CSS selectors to achieve the same effect without forcing specificity.- &:hover { - background-color: ${colorBlueLightest} !important; - } + &:hover { + background-color: ${colorBlueLightest}; + }
115-135: Consider using CSS variables for magic numbers in calculations.The
bottom: calc(${lgPadding} + 2px)uses a hard-coded 2px value. Consider extracting this to a CSS variable for better maintainability.+const toolbarOffset = '2px'; export const ChatContentFooter = styled.div` ... - bottom: calc(${lgPadding} + 2px); + bottom: calc(${lgPadding} + ${toolbarOffset}); ... `;bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/component.tsx (1)
488-509: Consider adding accessibility attributesThe ChatMessageToolbar implementation looks good and aligns with the PR objective. However, consider enhancing keyboard accessibility by adding appropriate ARIA attributes.
Add these attributes to improve accessibility:
<ChatMessageToolbar + role="toolbar" + aria-label={`Message actions for ${username}`} keyboardFocused={keyboardFocused} hasToolbar={hasToolbar && messageContent.showToolbar} // ... other props />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/component.tsx(2 hunks)bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-toolbar/styles.ts(2 hunks)bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/styles.ts(6 hunks)bigbluebutton-html5/private/config/settings.yml(1 hunks)
🔇 Additional comments (7)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-toolbar/styles.ts (2)
8-8: LGTM: Import addition is appropriate.
The addition of smPadding to the imports is necessary for the new padding implementation in the Root component.
18-23: LGTM: Style changes effectively implement the toolbar positioning requirement.
The changes work together to achieve the desired toolbar positioning:
- Standardized padding using
smPadding - Vertical centering with
transform: translateY(50%) - Updated selectors to target
.chat-message-contentfor proper attachment
These modifications align well with the PR objective of sticking the message toolbar to the message content.
Also applies to: 34-35
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/styles.ts (2)
11-11: LGTM!
The new import is properly organized with other spacing imports and is used in the ChatContentFooter component.
264-267: LGTM!
The ChatTime component is well-implemented, extending the base component with appropriate styling and using the color palette correctly.
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/component.tsx (2)
25-25: LGTM: ChatTime component import
The addition of ChatTime styled component aligns with the PR objective of displaying message timestamps.
488-509: 🛠️ Refactor suggestion
Consider reordering toolbar placement
The toolbar is currently rendered before the message content within ChatContent. Consider moving it after the MessageItemWrapper to maintain a logical DOM order that matches the visual order.
Move the toolbar after the message content:
<ChatContent>
- <ChatMessageToolbar ... />
{message.replyToMessage && !deleteTime && (
<ChatMessageReplied ... />
)}
{!deleteTime && (
<MessageItemWrapper>
{messageContent.component}
{messageReadFeedbackEnabled && (
<MessageReadConfirmation ... />
)}
</MessageItemWrapper>
)}
+ <ChatMessageToolbar ... />
{sameSender && (
<ChatContentFooter>
...
)}
</ChatContent>Likely invalid or redundant comment.
bigbluebutton-html5/private/config/settings.yml (1)
776-776: LGTM! Configuration updated to enable chat message toolbar options.
The toolbar configuration now includes all available options ('reply', 'edit', 'delete', 'reactions') which aligns with the PR objective to enhance the message toolbar functionality.
Let's verify that these toolbar options are properly handled in the chat components:
✅ Verification successful
Configuration change is properly implemented in the codebase
The toolbar configuration is correctly supported by the implementation:
- The message toolbar component (
message-toolbar/component.tsx) handles all specified options:- Reply: Dispatches
CHAT_REPLY_INTENTIONevent - Edit: Dispatches
CHAT_EDIT_REQUESTevent - Delete: Shows confirmation modal before deletion
- Reactions: Opens emoji picker popover
- Reply: Dispatches
- Each feature has corresponding components:
message-replied/component.tsxfor reply functionalitymessage-reactions/component.tsxfor reactions support
- The toolbar is conditionally rendered based on configuration flags:
chatReplyEnabled,chatReactionsEnabled,chatEditEnabled,chatDeleteEnabled
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if all toolbar options are properly implemented in chat components
# Test: Search for toolbar option handlers in chat-related components
rg -A 5 "('reply'|'edit'|'delete'|'reactions')" --type ts --type tsx
Length of output: 122
Script:
#!/bin/bash
# Let's try a different approach to search for toolbar options in the codebase
# First, let's find relevant files
fd -e jsx -e js -e ts "chat|message" bigbluebutton-html5/imports/ui/components/
# Then search for toolbar-related code and handlers
rg -l "(reply|edit|delete|reactions)" bigbluebutton-html5/imports/ui/components/
# Also search specifically in the chat components directory if it exists
rg -l "(reply|edit|delete|reactions)" bigbluebutton-html5/imports/ui/components/chat/
# Look for any message toolbar component
fd "toolbar|message-actions" bigbluebutton-html5/imports/ui/components/
Length of output: 6882
Script:
#!/bin/bash
# Let's examine the message toolbar component implementation
cat bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-toolbar/component.tsx
# Also check the related components for each toolbar action
cat bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-replied/component.tsx
cat bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/message-reactions/component.tsx
Length of output: 14496
| display: flex; | ||
| flex-direction: row; | ||
| padding: ${lgPadding} ${$3xlPadding}; | ||
| padding: calc(${lgPadding} + 2px) ${$3xlPadding}; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Coordinate spacing variables between related components.
The padding calculation calc(${lgPadding} + 2px) matches the footer positioning. These related values should share a common variable to maintain consistency when changes are needed.
+const messageSpacing = '2px';
export const MessageItemWrapper = styled.div`
- padding: calc(${lgPadding} + 2px) ${$3xlPadding};
+ padding: calc(${lgPadding} + ${messageSpacing}) ${$3xlPadding};
`;Committable suggestion was skipped due to low confidence.
|
Automated tests Summary✅ All the CI tests have passed! |



What does this PR do?
Changes message toolbar positioning and display same sender message time on hover.
Closes Issue(s)
Closes n/a