Commit Graph

152 Commits (cb293a852dec1ba884ade960e65b9288f4039851)

Author SHA1 Message Date
Luke Barnard c8ccbed0b1
Merge pull request #1751 from matrix-org/luke/dnd-group-view-tag-panel
Implement GroupTile avatar dragging to TagPanel
2018-02-15 11:05:28 +00:00
Luke Barnard 389d96bc46 Use optimistic removedTagsAccountData state in TagOrderStore
when receiving TagOrderActions.moveTag.pending, which now exposes
this state.
2018-02-14 16:47:29 +00:00
Luke Barnard 3020c8cd94 Fix custom tags not being ordered manually
Actually fixes vector-im/riot-web#6135 unlike #1748, which
incorrectly assumed that custom tags would be included in
listOrders.

This fix makes sure that the `default` case in the `switch`
is actually used.
2018-02-14 11:23:29 +00:00
Luke Barnard c670b76ec8
Merge pull request #1743 from matrix-org/luke/feature-tag-panel-tile-context-menu
Add context menu to TagTile
2018-02-13 17:28:43 +00:00
Luke Barnard a34fea8af8 Merge branch 'develop' into luke/feature-tag-panel-tile-context-menu 2018-02-13 16:51:00 +00:00
Luke Barnard f16bc93fee If a tag is unrecognised, assume manual ordering
(as we did previously)

Fixes https://github.com/vector-im/riot-web/issues/6135
2018-02-13 16:09:17 +00:00
Luke Barnard 5af560f625 Make removedTags a Set for perf 2018-02-13 14:43:34 +00:00
Luke Barnard 322012cf88 Add comment to explain hacky optimism 2018-02-12 18:46:36 +00:00
Luke Barnard e3f68f12c8 Add context menu to TagTile
With two options: View Community and Remove, which
removes the tag from the panel.
2018-02-12 18:01:08 +00:00
lukebarnard 9b0df19149 Make RoomListStore aware of sub list orderings
so that it can do optimistic updates of ordered lists.
2018-02-08 16:20:37 +00:00
lukebarnard dd0e981d72 Handle indication from server that a room has no more tags 2018-02-06 12:00:23 +00:00
lukebarnard 8d0d0b43ff Handle first tag added/last tag removed
This is a special case because untagged rooms should
appear in im.vector.fake.recent and tagged rooms
should not.
2018-02-06 12:00:06 +00:00
lukebarnard c665c1170b Regenerate room lists when we get RoomMember.membership 2018-02-05 18:27:50 +00:00
lukebarnard 9982efbd8f Regenerate room lists when we get m.direct 2018-02-05 18:06:29 +00:00
lukebarnard 330ce0f02e On failure, regenerate state from sdk
Instead of using history, which could be unpredictable
2018-02-05 17:34:05 +00:00
lukebarnard 81eca49266 Merge branch 'luke/room-list-flux' of github.com:matrix-org/matrix-react-sdk into luke/room-list-flux 2018-02-05 11:40:42 +00:00
Luke Barnard ff8fcb3139
Merge branch 'develop' into luke/room-list-flux 2018-02-05 11:39:39 +00:00
David Baker cfd1f28258
Merge pull request #1722 from matrix-org/luke/load-tags-after-first-sync
Use correct condition for getting account data after first sync
2018-01-30 15:21:12 +00:00
lukebarnard 40907ecf29 Use correct condition for getting account data after first sync
so that we can get tags sooner.
2018-01-26 19:39:06 +01:00
lukebarnard 4820a195ab Remove logging 2018-01-26 09:15:03 +01:00
lukebarnard 701abb6a21 Move management of room lists to RoomListStore
this is part maintenance to make RoomList clearer and part
allowing room list state to be modified via a dispatch.
2018-01-25 22:16:03 +01:00
Michael Telatynski 37dcb33b15
Reset quotingEvent on Room Change because inideal UX
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-01-22 14:45:04 +00:00
lukebarnard 5f413ddf8b Do not fetch GroupStore resources if already fetching 2018-01-17 17:01:42 +00:00
lukebarnard 3ebf278cf3 Refactor GroupStore based on existing STATE_KEY concept
by factoring out a lot of repeated code.
2018-01-17 16:59:13 +00:00
lukebarnard 2a1f8bd394 Ignore remote echos caused by this client
by sending each tag_ordering with a _storeId and ignoring accout data
that has a matching _storeId.

This will tend to become out of sync with the server over time if
requests continually fail, but subsequent successful requests will
rectify any differences.
2018-01-17 10:51:28 +00:00
lukebarnard 16c13fb079 Replace TagPanel react-dnd with react-beautiful-dnd
This new library handles the simple case of an ordered vertical
(or horizontal) list of items that can be reordered.

It provides animations, handles positioning of items mid-drag
and exposes a much simpler API to react-dnd (with a slight loss
of potential function, but we don't need this flexibility here
anyway).

Apart from this, TagOrderStore had to be changed in a highly
coupled way, but arguably for the better. Instead of being
updated incrementally every time an item is dragged over
another and having a separate "commit" action, the
asyncronous action `moveTag` is used to reposition the tag in
the list and both dispatch an optimistic update and carry out
the request as before. (The MatrixActions.accountData is still
used to indicate a successful reordering of tags).

The view is updated instantly, in an animated way, and this
is handled at the layer "above" React by the DND library.
2018-01-15 18:12:27 +00:00
Michael Telatynski 1bc9d344ae
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/nvl/rich_quoting
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

# Conflicts:
#	src/components/views/messages/TextualBody.js
2018-01-10 11:54:58 +00:00
lukebarnard 85cdd888e8 Combine TagOrderStore and FilterStore
so that shift-click semantics can work. The store that computes the shift-click
rules has to be aware of the actual order of tags displayed, so they must be done
in the same store.
2018-01-03 11:33:59 +00:00
Luke Barnard 5abf0440c6
Merge pull request #1666 from matrix-org/luke/fix-duplicate-group-profile-requests
Dedupe requests to fetch group profile data
2018-01-02 19:02:50 +00:00
lukebarnard 479e88cff7 Log an error to get group profile data 2018-01-02 18:55:50 +00:00
lukebarnard 45e860de7a Document GroupStore.registerListener 2018-01-02 18:12:08 +00:00
lukebarnard 3947a72d1b Fix to allow subsequent group profile requests if one fails
Also, delete the groupProfilePromise immediately after setting
the group profile (the first if-statement will prevent a new
request from being started).
2018-01-02 10:42:48 +00:00
Luke Barnard 71740cc176 Merge branch 'develop' into luke/fix-room-list-group-store-leak 2017-12-15 17:36:36 +00:00
Luke Barnard 6e832c7d73 Dedupe requests to fetch group profile data 2017-12-15 16:28:50 +00:00
Luke Barnard 34e455c6fc Fix leaking of GroupStore listeners in RoomList 2017-12-15 14:12:21 +00:00
lukebarnard e1ea8f0a78 Copy state when initialisng, reset state when logging out 2017-12-13 10:57:47 +00:00
lukebarnard d5534a9ece Copyright 2017-12-13 10:17:38 +00:00
Luke Barnard 60d8ebb914 Refactor MatrixActions to something much easier to grok. 2017-12-12 16:05:18 +00:00
Luke Barnard 3e532e3722 Use consistent indentation and break;s in TagOrderStore switch 2017-12-12 14:10:39 +00:00
Luke Barnard a120335130 Handle groups being joined and left 2017-12-11 18:03:19 +00:00
Luke Barnard 0b38bf5e7b Do not allow ordering until TagOrderStore has loaded 2017-12-11 17:24:33 +00:00
Luke Barnard aa914098dc Return null if TagOrderStore is loading
The view should decide the default state.
2017-12-11 17:19:29 +00:00
Luke Barnard 991ea4ebe5 Fix a few bugs with TagOrderStore:
- Have TagOrderStore listen for MatrixSync actions so that it can initialise
   tag ordering state.
 - Expose an empty list until the client has done its first sync and has
   fetched list of joined groups
2017-12-11 17:17:05 +00:00
Michael Telatynski 0f85391587
Implement Rich Quoting/Replies
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-12-10 12:50:41 +00:00
Luke Barnard 72550961e5 Move 'commit_tags' to action creator 2017-12-08 10:52:20 +00:00
Luke Barnard 12515441cd Handle accountData events from TagOrderStore
This introduces a generic way to register certain events emitted by
the js-sdk as those that should be propagated through as dispatched
actions.

This allows the store to treat the js-sdk as the "Server" in the
Flux data flow model. It also allows for stores to not be aware
specifically of the matrix client if they are only reading from it.
2017-12-08 10:05:18 +00:00
Luke Barnard ee6df105fe Introduce action creators
These can be used to dispatch actions immediately, or after some asynchronous
work has been done. Also, create GroupActions.fetchJoinedGroups as an example.

The concept of async action creators can be used in the following cases:
 - stores or views that do async work, dispatching based on the results
 - actions that have complicated payloads, would make more sense as functions
   with documentation that dispatch created actions.
2017-12-07 14:17:32 +00:00
Luke Barnard 8f88995b3d Add analytics to TagOrderStore 2017-12-06 14:22:11 +00:00
Luke Barnard 4af7def20e Use AccountData im.vector.web.tag_ordering
Also, make defaults sensible
2017-12-06 14:13:08 +00:00
Luke Barnard 82a95f0793 Simplify order_tag in TagOrderStore
such that:
 - it takes a targetTag to be replaced instead the previous tag to insert after
 - it optionally displaces the targetTag before or after the inserted tag
2017-12-06 11:22:06 +00:00