This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 833
Fix: No way to open chat in video rooms with new header. #11752
Closed
manancodes
wants to merge
1
commit into
matrix-org:develop
from
manancodes:manancodes/Chat_icon_in_new_header
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ import RoomAvatar from "../avatars/RoomAvatar"; | |
import { formatCount } from "../../../utils/FormattingUtils"; | ||
import RightPanelStore from "../../../stores/right-panel/RightPanelStore"; | ||
import { Linkify, topicToHtml } from "../../../HtmlUtils"; | ||
import { Icon as ChatIcon } from "../../../../res/img/element-icons/feedback.svg"; | ||
import { isVideoRoom as calcIsVideoRoom } from "../../../utils/video-rooms"; | ||
|
||
/** | ||
* A helper to transform a notification color to the what the Compound Icon Button | ||
|
@@ -74,6 +76,7 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element { | |
const memberCount = useRoomMemberCount(room, { throttleWait: 2500 }); | ||
|
||
const { voiceCallDisabledReason, voiceCallClick, videoCallDisabledReason, videoCallClick } = useRoomCall(room); | ||
const isVideoRoom = useFeatureEnabled("feature_video_rooms") && calcIsVideoRoom(room); | ||
richvdh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const groupCallsEnabled = useFeatureEnabled("feature_group_calls"); | ||
/** | ||
|
@@ -189,6 +192,21 @@ export default function RoomHeader({ room }: { room: Room }): JSX.Element { | |
<VideoCallIcon /> | ||
</IconButton> | ||
</Tooltip> | ||
{/* Ensure that the chat button is only visible in video rooms */} | ||
{isVideoRoom && ( | ||
<Tooltip label={_t("right_panel|video_room_chat|title")}> | ||
<IconButton | ||
// indicator={notificationColorToIndicator(threadNotifications)} TODO: This still needs work | ||
richvdh marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you plan to implement this as part of this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. But I need some help with this part. I'm not able to figure out what to pass in this argument. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok leave it for now and we can open a follow-up issue. |
||
onClick={(evt) => { | ||
evt.stopPropagation(); | ||
RightPanelStore.instance.showOrHidePanel(RightPanelPhases.Timeline); | ||
}} | ||
aria-label={_t("right_panel|video_room_chat|title")} | ||
> | ||
<ChatIcon className="mx_RoomHeader_ChatIcon" /> | ||
</IconButton> | ||
</Tooltip> | ||
)} | ||
<Tooltip label={_t("common|threads")}> | ||
<IconButton | ||
indicator={notificationColorToIndicator(threadNotifications)} | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like it would be better to update the SVG to have
fill="currentColor"
than to forcibly override it here. Generally, I don't think it should be necessary to have a dedicated CSS class. (There isn't one for the "threads" button, for example.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into this and try to implement your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manancodes have you had a chance to look at this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into it again. The other icons being used are imported from the vector-im/compound-design-tokens library. Which is why it does not require any additional css.
And the chat icon present there is an outline icon, which does not go well with the other icons.
https://github.com/vector-im/compound-design-tokens/blob/main/icons/chat.svg
In the legacy header, the SVG is used as a mask and background color property is added to the icon.
matrix-react-sdk/res/css/views/rooms/_LegacyRoomHeader.pcss
Line 187 in 6ae7c03
So I used that Icon and applied css to have dynamic colors according to the selected theme. What is the right way to tackle this? Should the filled chat icon be added in the Library? What is the procedure for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Yes, it definitely looks like we should be using a Compound design icon here, since all the other buttons in the header use one. And you're right that there only seems to be an outline icon there at the moment.
@kerryarchibald as our Compound Champion, can you advise on the best approach here?