- Instead of using one attribute, use one that might just contain one token
- Use the first token when tracking a child
- Mandate that no commas can be in individual tokens
This adds the `data-contained-scroll-tokens` API to elements in `ScrollPanel` which allows arbitrary containers of elements with scroll tokens to declare their contained scroll tokens. When jumping to a scroll token inside a container, the `ScrollPanel` will act as if it is scrolling to the container itself, not the child.
MELS has been modified such that it exposes the scroll tokens of all events that exist within it.This means "Jump to unread message" will work if the unread event is within a MELS (which is any member event, because even individual member events surrounded by other events are put inside a MELS).
This makes the following changes:
- Improve CountryDropdown by allowing all countries to be displayed at once and using PNGs for performance (trading of quality - the pngs are scaled down from 32px to 25px)
- "I want to sign in with" dropdown to select login method
- MXID login field that suffixes HS domain (whether custom or matrix.org) and prefixes "@"
- Email field which is secretly the same as the username field but with a different placeholder
- No more login flickering when changing ServerConfig (!) fixes https://github.com/vector-im/riot-web/issues/1517
This implements most of the design in https://github.com/vector-im/riot-web/issues/3524 but neglects the phone number login:
![login_with_msisdn](https://cloud.githubusercontent.com/assets/1922197/24864469/30a921fc-1dfc-11e7-95d1-76f619da1402.png)
This will be updated in another PR to implement desired things:
- Country code visible once a country has been selected (propbably but as a prefix to the phone number input box.
- Use square flags
- Move CountryDropdown above phone input and make it show the full country name when not expanded
- Auto-select country based on IP
* WIP msisdn sign in
* A mostly working country picker
* Fix bug where you'dbe logged out after registering
Stop the guest sync, otherwise it gets 401ed for using a guest
access token for a non-guest, causing us to beliebe we've been
logged out.
* Use InteractiveAuth component for registration
* Fix tests
* Remove old signup code
* Signup -> Login
Now that Signup contains no code whatsoever related to signing up,
rename it to Login. Get rid of the Signup class.
* Stray newline
* Fix more merge failing
* Get phone country & number to the right place
* More-or-less working msisdn auth component
* Send the bind_msisdn param on registration
* Refinements to country dropdown
Rendering the whole lot when the component was rendered just makes
the page load really slow, so just show 2 at a time and rely on
type-to-search.
Make type-to-search always display an exact iso2 match first
* Propagate initial inputs to the phone input
* Support msisdn login
* semicolon
* Fix PropTypes
* Oops, use the 1qst element of the array
Not the array of object keys which has no particular order
* Make dropdown/countrydropdown controlled
* Unused line
* Add note on DOM layout
* onOptionChange is required
* More docs
* Add missing propTypes
* Don't resume promise on error
* Use React.Children to manipulate children
* Make catch less weird
* Fix null dereference
Assuming [0] of an empty list == undefined doesn't work if you're
then taking a property of it.
- Use avatar initial instead of "R" or "?"
- Use Fuse.js to do case-insensitive fuzzy search. This allows for better sorting of results as well as search based on weighted keys (so userId has a high weight when the input starts with "@").
- Added debounce of 200ms to prevent analysis on every key stroke. Fuse seems to degrade performance vs. simple, non-fuzzy, unsorted matching, but the debounce should prevent too much computation.
- Move the selection to the top when the query is changed. There's no point in staying mid-way through the items at that point.
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.
* Use binds rather than onFoo functions which aren't actually
handler functions themselves but return them
* Rename onKeyUp to moveSelectionDown etc,, reserving onKeyUp
for "a key has been released" rather than, "the up arrow key
has been pressed"
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 ...
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.
- 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.
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).
* 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
* Use a list of callbacks for things that need tinting.
Rather than gutwrenching the internals of TintableSVG inside the Tinter.
* Share a data: url for the tinted download svg in MFileBody
* Check image exists before tinting
* Add comments
* Use fetch+DomParser rather than XMLHttpRequest
* Remove comment about XMLHttpRequest
- initialise the 'publish' checkbox correctly so react doesn't grumble about it
turning from uncontrolled into controlled
- PowerSelector's 'controlled' property isn't really required, so mark it as
such.
- Make onBlur reset the EditText to show that it hasn't submitted it.
- Add the user ID of the logged in user to Advanced.
- Remove remnants of the Save/Cancel buttons.