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 808
Threading exploration work #6658
Merged
Merged
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
6868478
Add threaded messaging feature flag
germain-gg cf3117b
Migrate ViewSourceEvent to TypeScript
germain-gg 92394da
Merge branch 'develop' into gsouquet/threaded-messaging-2349
germain-gg 7d4698d
Merge branch 'develop' into gsouquet/threaded-messaging-2349
germain-gg d971802
Create ThreadView phase in RightPanel
germain-gg e5024c4
Adapt threading UI to new backend
germain-gg d1dbfbd
hide thread events from the timeline
germain-gg 458f860
Merge branch 'develop' into gsouquet/threaded-messaging-2349
germain-gg 95f4513
Make UI respond to thread events
germain-gg ffc7326
Merge branch 'develop' into gsouquet/threaded-messaging-2349
germain-gg ac0412d
rename feature flag for Threads
germain-gg d535636
Hide thread UI behind experimentalThreadSupport flag
germain-gg 30a7629
Implement a very low fidelity UI for threads
germain-gg 393bd48
Merge branch 'develop' into gsouquet/threaded-messaging-2349
germain-gg 9facb0d
Polish UI
germain-gg ef51a46
Fix linting
germain-gg 34da07f
Pass room to ThreadView over roomId
edd4d42
Merge branch 'develop' into gsouquet/threaded-messaging-2349
54a0a86
PR feedback
77a463e
Merge branch 'develop' into gsouquet/threaded-messaging-2349
bd1aa01
Update copyright and method accessors
f0a4225
Remove unused renderEventTile method
bf3c8e5
Fix imports
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
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
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
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
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,99 @@ | ||
| /* | ||
| Copyright 2016 OpenMarket Ltd | ||
| Copyright 2019 The Matrix.org Foundation C.I.C. | ||
|
germain-gg marked this conversation as resolved.
Outdated
|
||
|
|
||
| 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 { MatrixEvent, Room } from 'matrix-js-sdk/src'; | ||
|
|
||
| import BaseCard from "../views/right_panel/BaseCard"; | ||
| import { RightPanelPhases } from "../../stores/RightPanelStorePhases"; | ||
| import { replaceableComponent } from "../../utils/replaceableComponent"; | ||
| import { MatrixClientPeg } from '../../MatrixClientPeg'; | ||
|
|
||
| import ResizeNotifier from '../../utils/ResizeNotifier'; | ||
| import EventTile from '../views/rooms/EventTile'; | ||
| import { Thread } from '../../../../matrix-js-sdk/src/models/thread'; | ||
|
|
||
| interface IProps { | ||
| roomId: string; | ||
| onClose: () => void; | ||
| resizeNotifier: ResizeNotifier; | ||
| } | ||
|
|
||
| interface IState { | ||
| threads?: Thread[]; | ||
| } | ||
|
|
||
| /* | ||
| * Component which shows the filtered file using a TimelinePanel | ||
| */ | ||
| @replaceableComponent("structures.ThreadView") | ||
| class ThreadView extends React.Component<IProps, IState> { | ||
|
germain-gg marked this conversation as resolved.
Outdated
|
||
| private room: Room; | ||
|
|
||
| constructor(props: IProps) { | ||
| super(props); | ||
| this.room = MatrixClientPeg.get().getRoom(this.props.roomId); | ||
| } | ||
|
|
||
| public componentDidMount(): void { | ||
| this.room.on("Thread.update", this.onThreadEventReceived); | ||
| this.room.on("Thread.ready", this.onThreadEventReceived); | ||
| } | ||
|
|
||
| public componentWillUnmount(): void { | ||
| this.room.removeListener("Thread.update", this.onThreadEventReceived); | ||
| this.room.removeListener("Thread.ready", this.onThreadEventReceived); | ||
| } | ||
|
|
||
| public onThreadEventReceived = () => this.updateThreads(); | ||
|
germain-gg marked this conversation as resolved.
Outdated
|
||
|
|
||
| public updateThreads = (callback?: () => void): void => { | ||
|
germain-gg marked this conversation as resolved.
Outdated
|
||
| this.setState({ | ||
| threads: this.room.getThreads(), | ||
| }, callback); | ||
| }; | ||
|
|
||
| public renderEventTile(event: MatrixEvent): JSX.Element { | ||
|
germain-gg marked this conversation as resolved.
Outdated
|
||
| return <EventTile | ||
| key={event.getId()} | ||
| mxEvent={event} | ||
| enableFlair={false} | ||
| showReadReceipts={false} | ||
| as="div" | ||
| />; | ||
| } | ||
|
|
||
| public render() { | ||
| return ( | ||
| <BaseCard | ||
| className="mx_ThreadPanel" | ||
| onClose={this.props.onClose} | ||
| previousPhase={RightPanelPhases.RoomSummary} | ||
| > | ||
| { | ||
| this.state?.threads.map((thread: Thread) => { | ||
| if (thread.ready) { | ||
| return this.renderEventTile(thread.rootEvent); | ||
| } | ||
| }) | ||
| } | ||
| </BaseCard> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default ThreadView; | ||
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.