Commit Graph

51 Commits (24f2aed45f890a630a9c095e44c7f86d57ffe32e)

Author SHA1 Message Date
Matthew Hodgson 24f2aed45f summarise profile changes in MELS
fixes https://github.com/vector-im/riot-web/issues/3463
2017-04-23 04:05:50 +01:00
Luke Barnard e75c21e9f9 Merge pull request #683 from matrix-org/luke/mels-xor
MELS: either expanded or summary, not both
2017-03-02 14:08:06 +00:00
Luke Barnard 6fead66f89 MELS: check scroll on load + use mels-1,-2,... key
To fix https://github.com/vector-im/riot-web/issues/2916, force the checking of scroll position by calling _onWidgetLoad (might need renaming...) when a MELS is expanded/contracted.

Also use an keying scheme for MELS that doesn't depend on the events contained, but rather a simple incrementing index based on the order of the MELS as it appears amongst all MELS.
2017-02-20 10:59:11 +00:00
David Baker b18473ccb2 Handle there being no member event when banned
Here, and also in MemberEventListSummary where this also broke.
2017-02-17 16:35:18 +00:00
Luke Barnard 8d3876c7d0 MELS: either expanded or summary, not both
Fixes vector-im/riot-web#3097
2017-02-09 15:14:16 +00:00
Matthew Hodgson 8fea4c27cb fix NPE 2017-02-07 22:00:56 +00:00
Luke Barnard f9ca2a8e59 Fix _renderCommaSeparatedList 2017-01-25 11:28:12 +00:00
Luke Barnard b887d5b823 Much linting 2017-01-25 11:05:45 +00:00
Luke Barnard 8091cf7df8 Enumerate->label 2017-01-25 09:32:28 +00:00
Luke Barnard f8e46819c5 Rename truncated->coalesced 2017-01-25 09:28:26 +00:00
Luke Barnard 3b8b2cf500 Document _getCanonicalTransitions 2017-01-25 09:18:47 +00:00
Luke Barnard d690677bde Merge branch 'luke/fix-join-part-collapsing-causality' of github.com:matrix-org/matrix-react-sdk into luke/fix-join-part-collapsing-causality
Conflicts:
	src/components/views/elements/MemberEventListSummary.js
2017-01-24 14:17:11 +00:00
lukebarnard 5dd1512ff2 Move aggregation code to dedicated function 2017-01-18 10:59:19 +01:00
lukebarnard 484549e50b Refactor a few things and document everything 2017-01-18 10:26:25 +01:00
lukebarnard 3ba9f50873 Move functions around, remove redundancies, add docs 2017-01-17 19:07:45 +01:00
lukebarnard 9574a0b663 Remove pointless length guard 2017-01-17 18:56:57 +01:00
lukebarnard 45655f4de3 Modified desc for invitation rejections, withdrawals 2017-01-17 12:01:19 +01:00
lukebarnard aa6e168505 Remove comment 2017-01-16 18:58:53 +01:00
lukebarnard 5ab287fa1a Use pre-calculated displaynames to handle dupes 2017-01-16 18:57:49 +01:00
lukebarnard a79dc886ba Order sequences by occurance of the first event in each sequence 2017-01-16 18:46:17 +01:00
lukebarnard 4be444d524 Move shouldComponentUpdate 2017-01-16 15:12:00 +01:00
lukebarnard 82d6805a71 Canonicalise certain transition pairs, handle arbitrary consecutive transitions
Transition pairs joined,left and left,joined are now transformed into single meta-transitions "joined_and_left" and "left_and_joined" respectively. These are described as "joined and left", "left and rejoined".

Treat consecutive sequences of transitions as repetitions, and handle any arbitrary repetitions of transitions:

...,joined,left,joined,left,joined,left,...

is canonicalised into
...,joined_and_left, joined_and_left, joined_and_left,...

which is truncated and described as
... , joined and left 3 times, ...

This also works if there are multiple consecutive sequences separated by other transitions:

..., banned, banned, banned, joined, unbanned, unbanned, unbanned,...

becomes
... was banned 3 times, joined, was unbanned 3 times ...
2017-01-16 14:49:07 +01:00
lukebarnard fb68fff536 Refactor renderCommaSeparated for reuse 2017-01-16 13:45:42 +01:00
Luke Barnard 77ae041407 Order names by order of first events for users 2017-01-13 16:40:33 +00:00
Luke Barnard d2d78919ce Overhaul MELS to deal with causality, kicks, etc.
The MELS can now deal with arbitrary sequences of transitions per user, where a transition is a change in membership. A transition can be joined, left, invite_reject, invite_withdrawal, invited, banned, unbanned or kicked.

Repeated segments (modulo 1 and 2), such as joined,left,joined,left,joined will be handled and will be rendered as " ... and 10 others joined and left 2 times and then joined". The repeated segments are assumed to be at the beginning of the sequence. This could be improved to handle arbitrary repeated sequences.
2017-01-12 18:55:53 +00:00
Luke Barnard baaf827c48 Use `getStateKey` instead of `getSender`
This makes sure that the kickee is not the user used for the MemberEventListSummary
2017-01-11 17:03:14 +00:00
Luke Barnard 7475056bb4 MELS component should update if there are fewEvents, effectively expanding the summary 2016-12-15 18:33:13 +00:00
Luke Barnard 55f85befc1 Allow component to update if currently expanded or if about to collapse 2016-12-15 14:43:59 +00:00
Luke Barnard 86739e7d1e Simplify handling of only one member event 2016-12-15 13:15:00 +00:00
Luke Barnard c07e5d4992 Improve the performance of MemberEventListSummary
- The MessagePanel now uses the same key for the MELS instances rendered so that entirely new instances are not created, they are simply passed new props (namely when new events arrive).
- MELS itself now uses `shouldComponentUpdate` so that it only updates if it is given a different number of events to previous or if it is toggled to expand.
2016-12-14 15:31:35 +00:00
Luke Barnard 7e88f0083d Fix more join-part collapsing regressions
Use the previous content of the first event known for a user in a block of membership changes. This means single events are not special cased.
2016-11-16 16:26:24 +00:00
Luke Barnard 324448563a If only one mevent, return than one
Also, the net change of nil is detected as having the first and last events being _different_. The summary should only include those that have their first and last events being the _same_ because that is a net change (within the block of member events).
2016-11-16 16:07:19 +00:00
Luke Barnard beecbc7cd7 Fix join/part collapsing regressions (#553)
* Fix join/part collapsing regressions

* Simplify loop

* Explain e,e

* Explain return null in _renderSummary

* Kill it properly

* Move . to _renderSummary

* Only use the first and last events to decide whether a net change has occured

* Do not sort events by TS before summarising

* fix loop and comment

* remove data-number-events

* Better explanation comment in _renderSummary

* Less tortuous comment
2016-11-16 14:42:30 +00:00
Luke Barnard d3a548773a Remove redundant lines 2016-11-10 18:01:34 +00:00
Luke Barnard 3d7f6919cf Refactor renderNameList (thanks, @richvdh) 2016-11-10 17:36:22 +00:00
Luke Barnard b11dd9542f Add class to expand link for pointer and colour 2016-11-10 17:09:18 +00:00
Luke Barnard e05aeb35a1 npm run reskindex 2016-11-10 17:03:24 +00:00
Luke Barnard f71ac93946 Prefer null to falsy, use correct plural 2016-11-10 15:38:20 +00:00
Luke Barnard 1a4df38500 remove href 2016-11-10 15:20:53 +00:00
Luke Barnard d8bc4d9a6f Factor out avatar click leads to view_user 2016-11-10 15:18:59 +00:00
Luke Barnard 6b2aa43b71 Factor out "and others" 2016-11-10 14:33:41 +00:00
Luke Barnard d6b74becfc Children are required 2016-11-10 14:12:45 +00:00
Luke Barnard 370f5f0a11 Use _ prefix for private methods 2016-11-10 14:12:05 +00:00
Luke Barnard 8422017827 events are required 2016-11-10 14:09:40 +00:00
Luke Barnard dcbb31279f Prefer import React, set prevEvent to last MemberhsipChange 2016-11-10 14:08:11 +00:00
Luke Barnard e2936376b6 Unnecessary props 2016-11-10 13:26:27 +00:00
Luke Barnard 566034cf2b Render children EventTiles before passing to summary element 2016-11-10 13:25:48 +00:00
Luke Barnard 79c01fa1a4 Remove empty lines 2016-11-10 11:03:43 +00:00
Luke Barnard f5bc8d1fe0 Removed logs, updated phrasing on 'others joined'
Now it's:
 1 user joined and left
 >1 others joined and left
2016-11-10 10:42:33 +00:00
Luke Barnard 5f0b891d47 Add date seperator to the expanded events
netsplits across midnight is not handled, and @richvdh suggested splitting the list in two
2016-11-09 17:44:43 +00:00