Commit Graph

12 Commits (55dc49f4ffd0350a6c6947652905fcbd4eeb2ed6)

Author SHA1 Message Date
Luke Barnard db4f0cb0bf Handle adding previously removed tags 2018-02-14 16:40:24 +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 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 d2e5b12271 Update jsdoc for moveTag 2018-01-16 09:46:48 +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
Luke Barnard 629cd13319 Even better docs 2017-12-13 18:28:43 +00:00
Luke Barnard 6b02f59fb7 Spelling 2017-12-13 17:32:46 +00:00
lukebarnard a653ece99e Doc commitTagOrdering 2017-12-13 11:05:06 +00:00
lukebarnard d5534a9ece Copyright 2017-12-13 10:17:38 +00:00
Luke Barnard 13925db251 Refactor to allow dispatching of two kinds of Actions
They are:
 1. The existing type of Action, Objects with an `action` type.
 1. Asyncronous Actions, functions that accept a `dispatch` argument, which can be used to dispatch Actions asyncronously.
2017-12-12 17:32:43 +00:00
Luke Barnard 8d2d3e62cd Only commit a non-falsy tags list 2017-12-11 17:30:10 +00:00
Luke Barnard 72550961e5 Move 'commit_tags' to action creator 2017-12-08 10:52:20 +00:00