This repository was archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 807
Include thread replies in message previews #10631
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4b0159c
Include thread replies to message previews
weeman1337 fa78ad5
Extend tests
weeman1337 0eb978d
Fix type issue
weeman1337 19dce39
Use currentColor for thread icon
weeman1337 f0c99bb
Fix long room name overflow
weeman1337 3adffec
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 0d5e8a4
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 49f6ef1
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 d8edf13
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 3fc7288
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 a65969e
Update snapshots
weeman1337 db42b6b
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 b13bbd6
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 6eceeaa
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 7d50bb4
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 ee917c3
Fix preview
weeman1337 e532d8b
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 cc2741a
Fix typing issue
weeman1337 b560c8e
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 cd15bf7
Fix type issues
weeman1337 c53e950
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 821f49a
Tweak thread reply detection
weeman1337 537ae6d
Extend tests
weeman1337 e006fe9
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 3f41809
Fix type issue
weeman1337 12b7b57
Fix test
weeman1337 eaf7e58
Merge branch 'develop' into weeman1337/thread-reply-preview
weeman1337 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 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| /* | ||
| Copyright 2023 The Matrix.org Foundation C.I.C. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| import React from "react"; | ||
| import classNames from "classnames"; | ||
|
|
||
| import { MessagePreview } from "../../../stores/room-list/MessagePreviewStore"; | ||
| import { Call } from "../../../models/Call"; | ||
| import { RoomTileCallSummary } from "./RoomTileCallSummary"; | ||
| import { VoiceBroadcastRoomSubtitle } from "../../../voice-broadcast"; | ||
| import { Icon as ThreadIcon } from "../../../../res/img/compound/thread-16px.svg"; | ||
|
|
||
| interface Props { | ||
| call: Call | null; | ||
| hasLiveVoiceBroadcast: boolean; | ||
| messagePreview: MessagePreview | null; | ||
| roomId: string; | ||
| showMessagePreview: boolean; | ||
| } | ||
|
|
||
| const messagePreviewId = (roomId: string): string => `mx_RoomTile_messagePreview_${roomId}`; | ||
|
|
||
| export const RoomTileSubtitle: React.FC<Props> = ({ | ||
| call, | ||
| hasLiveVoiceBroadcast, | ||
| messagePreview, | ||
| roomId, | ||
| showMessagePreview, | ||
| }) => { | ||
| if (call) { | ||
| return ( | ||
| <div className="mx_RoomTile_subtitle"> | ||
| <RoomTileCallSummary call={call} /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| if (hasLiveVoiceBroadcast) { | ||
| return <VoiceBroadcastRoomSubtitle />; | ||
| } | ||
|
|
||
| if (showMessagePreview && messagePreview) { | ||
| const className = classNames("mx_RoomTile_subtitle", { | ||
| "mx_RoomTile_subtitle--thread-reply": messagePreview.isThreadReply, | ||
| }); | ||
|
|
||
| const icon = messagePreview.isThreadReply ? <ThreadIcon className="mx_Icon mx_Icon_16" /> : null; | ||
|
|
||
| return ( | ||
| <div className={className} id={messagePreviewId(roomId)} title={messagePreview.text}> | ||
| {icon} | ||
| <span className="mx_RoomTile_subtitle_text">{messagePreview.text}</span> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| return null; | ||
| }; |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.