Commit graph

544 commits

Author SHA1 Message Date
Richard van der Hoff
722c7033bc Merge pull request #73 from matrix-org/rav/on_highlight_click
Expose onHighlightClick on the event tiles
2016-01-04 15:23:45 +00:00
Richard van der Hoff
89fcf019e1 Merge branch 'develop' into rav/scrollpanel_promises
Conflicts:
	src/components/structures/RoomView.js
2016-01-04 12:56:39 +00:00
Kegan Dougal
75ad96c8ba Null guard getMember 2016-01-04 10:11:42 +00:00
Matthew Hodgson
3009da0b39 move title attributes to the div 2016-01-03 22:34:56 +00:00
Matthew Hodgson
4f915d622e switch SVGs from imgs to objects 2016-01-03 22:30:52 +00:00
Matthew Hodgson
640aa45956 fix comedy bug where dates in timestamps were spectacularly wrong 2016-01-03 00:40:05 +00:00
Matthew Hodgson
441a9540ca sync CSS classnames with current react component names 2016-01-03 00:11:11 +00:00
Matthew Hodgson
15f19be408 highlight case insensitively 2015-12-28 03:14:50 +00:00
Matthew Hodgson
970bc84bb6 explicitly rejoin parted rooms 2015-12-28 02:58:40 +00:00
Matthew Hodgson
424540e57a fix NPE if messagePanel isn't yet defined 2015-12-28 02:40:17 +00:00
Matthew Hodgson
50ac0ab4cf wire up RoomAlias's homeserver as intended 2015-12-28 02:36:28 +00:00
Matthew Hodgson
bd498b47b3 fix 'this' scoping bug that could never have worked... 2015-12-28 02:36:18 +00:00
Richard van der Hoff
93e7f90ae4 ScrollPanel: implement forward-fill 2015-12-24 14:30:49 +00:00
Richard van der Hoff
f2a24521dc Make ScrollPanel keep track of when fill requests are happening
The dance to avoid doing repeated fill requests on every update is common, so
add it to ScrollPanel. Let onFillRequest return a promise, which prevents any
updates until it completes.
2015-12-24 14:15:50 +00:00
Richard van der Hoff
b0adb1945f Expose onHighlightClick on the event tiles 2015-12-24 13:51:14 +00:00
Richard van der Hoff
cc72f7ec24 Use new searchRoomEvents and backPaginateRoomEventsSearch methods
MatrixClient now exposes higher-level search APIs, so use them.
2015-12-24 13:33:58 +00:00
Kegan Dougal
103b0a03b1 Hotfix for tab press bug
The bug was that *sometimes* typing in some letters then
pressing tab would flash red and not auto-complete. This was
happening because nextMatchedEntry was being called with 0
because the state of inPassiveMode was wrong.
2015-12-24 11:56:50 +00:00
Kegsay
b941904078 Merge pull request #33 from matrix-org/matthew/settings
WIP experiment of turning UserSettings controller into UserSettingsStore
2015-12-24 10:54:26 +00:00
Kegan Dougal
5d490841bc Review comments 2015-12-24 10:50:47 +00:00
Kegan Dougal
5286ec170f Wrangle CSS to get avatar in right place 2015-12-24 09:20:16 +00:00
Richard van der Hoff
b4436df5e4 Refactor bodyToHtml, and allow onHighlightClicked
Factor out a Highlighter class to avoid passing round the static state
everywhere.

Add an optional 'opts' argument which can take an 'onHighlightClick' member.
2015-12-23 23:50:35 +00:00
Kegan Dougal
05d1d7c82d Better error message for failing to set avatars with no connection 2015-12-23 17:30:25 +00:00
Kegan Dougal
abb170ebde Keep one source of truth (the Notifier) when toggling notification state. Fixes notifications. 2015-12-23 17:06:30 +00:00
Kegan Dougal
a279dce027 Get avatar display and uploads working 2015-12-23 16:52:59 +00:00
Kegan Dougal
19bd39b066 More random tweaks
- 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.
2015-12-23 16:02:18 +00:00
Kegan Dougal
72b8cf1be2 Refactor ChangePassword to get it working. Add 'Account' section because trying to make ChangePassword divs part of the same table as the display name is nigh impossible. Feels okay though 2015-12-23 15:38:28 +00:00
Kegan Dougal
6295cf2ec9 Merge branch 'develop' into matthew/settings 2015-12-23 14:19:42 +00:00
Kegan Dougal
fb151b35c8 Remove debug logging 2015-12-23 14:17:56 +00:00
Kegan Dougal
e657b40a7e Use ChangeDisplayName for implict display name saving on enter 2015-12-23 14:14:25 +00:00
Kegan Dougal
82ff5c5e52 Factor out handleTabPress and remove passive flag onKeyDown 2015-12-23 13:48:44 +00:00
Kegan Dougal
b80015c69c More comments; remove redundant if statement 2015-12-23 13:33:44 +00:00
Kegan Dougal
1af5018597 General code cleanup / tweaks / fixes
- Swap Phases enum to be using string literals
- Swap roomId prop on UserSettings for a more sane onUserSettingsClose and
  make MatrixChat responsible for swapping the room.
- s/then/done/ when terminating Promise chains to avoid subtle errors.
- Rejig render() of UserSettings so we don't need to indent quite so much.
2015-12-23 11:47:56 +00:00
Kegan Dougal
095f82feee Remove boolean returns 2015-12-23 10:35:54 +00:00
Kegan Dougal
7e1b107f4c Review comments 2015-12-23 09:34:34 +00:00
Kegan Dougal
810e8993d6 Merge branch 'develop' into kegan/tab-complete 2015-12-22 17:44:04 +00:00
Kegan Dougal
62c378a619 Sort out the mess that is Javascript's \b - Fixes vector-im/vector-web#189
\b is *the worst*. From MDN:

Note: JavaScript's regular expression engine defines a specific set of
characters to be "word" characters. Any character not in that set is considered
a word break. This set of characters is fairly limited: it consists solely of
the Roman alphabet in both upper- and lower-case, decimal digits, and the
underscore character. Accented characters, such as "é" or "ü" are,
unfortunately, treated as word breaks.

We fix this by matching on whitespace instead, but then need to tweak the
replace() code since that bluntly replaces the entire match (which now includes
whitespace). It all works now and I can happily tab-complete non-ascii names.
2015-12-22 17:38:24 +00:00
Kegan Dougal
452c265e6a Implement automatically entering tab complete mode after a short delay
This seems to work. Manually tested for sanity.
2015-12-22 16:49:58 +00:00
Kegan Dougal
460f68caef Move RoomMember[] -> MemberEntry[] conversion somewhere sensible
This is required for automatically entering tab-complete mode because
onKeyDown is NOT called in that case, so we need to make sure to have a
membership list hanging around.
2015-12-22 15:38:23 +00:00
Richard van der Hoff
cdd539c3cd Factor out a separate 'ScrollPanel'
Create an intelligent scrolling list, which doesn't care what it contains, to
try and clean up some of the logic in RoomView.
2015-12-22 15:18:50 +00:00
Kegan Dougal
a20cabb06f Merge branch 'develop' into kegan/tab-complete 2015-12-22 15:16:39 +00:00
Kegan Dougal
e077517faf Ignore more keys when determining if the user is typing
Specifically ignore CTRL, ALT, META, SHIFT, WINDOWS.
2015-12-22 15:13:11 +00:00
Kegan Dougal
e541ddb060 Auto-complete clicked suggestions 2015-12-22 11:14:36 +00:00
Richard van der Hoff
cc90f4c0c6 Merge pull request #64 from matrix-org/rav/fix_date_separator
Fix bug with date separator flashing up on scrollback
2015-12-22 11:05:26 +00:00
Richard van der Hoff
360806a8f1 RoomView: add whitespace for disambiguation 2015-12-22 11:04:39 +00:00
Richard van der Hoff
6b07de05f3 Merge pull request #65 from matrix-org/rav/marker_at_top_of_search_results
Add a 'top-of-search' marker
2015-12-22 11:00:00 +00:00
Kegan Dougal
0dbb8d5294 Use MemberAvatar to generate image JSX. Split out entries from tab-complete logic 2015-12-22 10:00:30 +00:00
Matthew Hodgson
ea2405ab3a escape double-slash commands 2015-12-22 00:57:57 +00:00
Matthew Hodgson
618978d955 add appropriate CSS for the TabCompleteBar 2015-12-22 00:47:04 +00:00
Kegan Dougal
c8aaee46d7 Mark a TODO for timeout handling 2015-12-21 17:58:36 +00:00
Kegan Dougal
ba63b5dfff Add image URLs to TabComplete.Entry objects 2015-12-21 17:28:04 +00:00
Kegan Dougal
4e79c3c4c8 Add allowLooping opt for tab completion. Make peeking work. 2015-12-21 17:16:49 +00:00
Kegan Dougal
ab0a277d94 Rewrite tab-complete logic to allow peeking ahead
This primarily means pre-calculating the list of things we'll be looping over
and then returning matches from this list. Make the regex match be more generic
rather than sorta-kinda-user-id-like-ish.
2015-12-21 16:35:39 +00:00
Kegan Dougal
41d4c1d14e Add TabComplete.Entry so we can render images AND text(!) - Add peek() option, all broken. 2015-12-21 14:34:25 +00:00
Kegan Dougal
400b5196bb Add TabCompleteBar. Hook up display to whether we are currently tab completing. 2015-12-21 14:11:34 +00:00
Richard van der Hoff
7c285f9ad0 Add a 'No results' marker when there are no search results at all.
Also reword the 'no more results' marker.
2015-12-21 13:46:27 +00:00
Matthew Hodgson
b9ba4475b8 Merge branch 'develop' into matthew/settings 2015-12-21 13:09:33 +00:00
Richard van der Hoff
765e5bdeb1 Add a 'top-of-search' marker
Ugly as hell, pending better suggestions.

This fixes https://github.com/vector-im/vector-web/issues/547
2015-12-21 12:39:10 +00:00
Kegan Dougal
26dc3cc553 Push up instantiation of TabComplete to RoomView
RoomView is the parent component which creates MessageComposer AND the status
bar. By making RoomView instantiate TabComplete we can scope instances
correctly rather than relying on singleton behaviour through dispatches. This
also makes communication between status bar and the MessageComposer infinitely
easier since they are now sharing the same TabComplete object.
2015-12-21 10:59:10 +00:00
Richard van der Hoff
afadb23f89 Fix bug with date separator flashing up on scrollback
Refactor the event-tile generation loop to go forwards rather than backwards,
which makes it easier to figure out whether we are displaying a continuation of
the previous event, and whether we need a date separator.

Also only display the date separator at the top of the room if there's no more
scrollback to be shown.

This fixes vector-im/vector-web#431
2015-12-21 10:49:00 +00:00
Kegan Dougal
c6d02b2c26 Move tab-complete logic out from MessageComposer
Moved to a `TabComplete` class. Make it more generic (list of strings rather
than RoomMembers) and sort the member list by last_active_ago. Everything still
seems to work.
2015-12-21 10:38:37 +00:00
Richard van der Hoff
ff6d9454fd Merge pull request #63 from matrix-org/rav/paginate_search
Pagination for search results
2015-12-21 09:16:42 +00:00
Kegan Dougal
d1baf5854c Only display the MessageComposer if you're joined and not viewing search results 2015-12-18 17:23:46 +00:00
Matthew Hodgson
fa99c1fc59 make it clear result count is approx 2015-12-18 17:18:08 +00:00
Kegan Dougal
f0ff62166b Remove bottommost prop - can't DND on the bottom list anymore 2015-12-18 17:13:26 +00:00
Kegan Dougal
a2872deb53 Merge branch 'develop' into kegan/archived-rooms 2015-12-18 16:59:25 +00:00
Kegan Dougal
461e3f46dc Show an ErrorDialog when failing to forget a room 2015-12-18 16:56:37 +00:00
Richard van der Hoff
44c42394ae Fix scroll for search results
Make sure that we save scroll position when searching, and use it to preserve
offset when backfilling.
2015-12-18 16:42:46 +00:00
Matthew Hodgson
831aaec457 Merge pull request #57 from matrix-org/matthew/inbound-calls
Position the inbound call box correctly
2015-12-18 15:59:18 +00:00
Kegan Dougal
c3bd81b83a Make rooms the user is banned in be treated as a joined room for position in room list
This is so users can still find the room they've been expelled from, rather than
have it drop to the Historical section.
2015-12-18 15:56:27 +00:00
Kegan Dougal
711fdd25af Improve perf of refreshing room list. Show spinner when loading left rooms.
When the JS SDK encounters a new room it will emit a flurry of events for things
like state and room members. Refreshing the room list on each event is bad for
performance. This is okay initially because the room list is only shown after
the first sync, but when getting archived rooms it locks up for 15-30s as it
thrashes. Add a 1s cap to refreshRoomList() which means that it will refresh
*AT MOST* once every second. If it has been >1s since the last refresh it will
immediately refresh. If it has been <1s it will wait the difference.
2015-12-18 15:13:59 +00:00
Matthew Hodgson
08ffadc2c4 unbreak 2015-12-18 14:04:39 +00:00
Kegan Dougal
22635f251d Call through to syncLeftRooms when the archived header is clicked 2015-12-18 11:55:43 +00:00
Richard van der Hoff
ec32347f43 Request more search results when scroll hits top of window 2015-12-18 11:13:32 +00:00
Richard van der Hoff
4b271a332e Refactor the search stuff in RoomView
* factor out the call to MatrixClient.search to a separate _getSearchBatch (so
  that we can reuse it for paginated results in a bit)
* Don't group cross-room searches by room - just display them in timeline
  order.
2015-12-18 11:11:41 +00:00
Richard van der Hoff
9931ef1971 Merge pull request #61 from matrix-org/rav/fix_postinvite_dnd
Initialise the messagepanel correctly after accepting an invite
2015-12-18 10:32:24 +00:00
Richard van der Hoff
d6c208a275 Reinstate the DnD event listener removals, with comments 2015-12-18 10:19:07 +00:00
Matthew Hodgson
4baf9d5589 Fix paths 2015-12-18 00:40:01 +00:00
Matthew Hodgson
e2ae2dd199 merge stuff from vector 2015-12-18 00:37:56 +00:00
Matthew Hodgson
272d7362fb Merge branch 'develop' into matthew/settings 2015-12-18 00:14:36 +00:00
Matthew Hodgson
0f82b72e07 lost copyright 2015-12-18 00:13:57 +00:00
Matthew Hodgson
f30b7eec2f Merge branch 'develop' into matthew/settings 2015-12-18 00:11:43 +00:00
Richard van der Hoff
e0d05d4f4b Initialise the messagepanel correctly after accepting an invite
This should fix vector-im/vector-web#538.

I'm sorry.
2015-12-17 22:07:56 +00:00
Richard van der Hoff
6ee0c72340 Merge pull request #58 from matrix-org/rav/yet_more_scroll_fixes
Fix issue with rooms not scrolling down when new events arrive
2015-12-17 17:40:41 +00:00
Kegan Dougal
8e4d0c0be7 Merge branch 'develop' into kegan/archived-rooms 2015-12-17 17:07:18 +00:00
Kegsay
498990b376 Merge pull request #59 from matrix-org/kegan/3pid-inv
Finish 3PID invites impl
2015-12-17 16:54:29 +00:00
Kegan Dougal
12943b11fc Full Stop. 2015-12-17 16:40:46 +00:00
Matthew Hodgson
478ca91b4f s/Conversations/Rooms/ as per https://github.com/vector-im/vector-web/issues/535 2015-12-17 16:27:56 +00:00
Kegan Dougal
17a8eb0109 Display m.room.third_party_invite events. Display sensible text transitions. 2015-12-17 15:48:14 +00:00
Kegan Dougal
6e324a0dd1 Whoops, didn't mean to add this 2015-12-17 15:12:09 +00:00
Kegan Dougal
32bd9d155c Pass a new prop 'startingQueryParams' to pluck out the email from the URL
This is preferable to doing the way other QPs are passed (secret, etc) because
the link in the email wants to look like "#/room/<room_id_or_alias>" for guest
read-access (only bouncing you to /login if that room is not readable by guests).
This is hard to do in the current arch because we don't preserve QPs on /room
paths, and we do conditional executions depending on if it is a room ID or
alias. Rather than threading through the email in each section and creating
a fragile mess, just pass the *starting* set of query parameters through to
MatrixChat which can then do the Right Thing when the time comes.
2015-12-17 14:56:55 +00:00
Matthew Hodgson
5c999fe1ab stop the incoming call box from scrolling off the screen 2015-12-17 14:56:09 +00:00
Kegan Dougal
1eeb732625 Supply bind_email=true at registration time - required for 3pid invites to work. 2015-12-17 14:34:45 +00:00
Richard van der Hoff
3ff19dc4db Fix issue with rooms not scrolling down when new events arrive
Remove an optimisation which tried to avoid recalculating the scroll on every
render. The problem is that sometimes, when new events, the number of event
tiles remains the same, but we still need to do a scroll, because the height of
the message list changes.

The optimisation was a bit of a waste of time anyway - the actual render will
always be much more difficult than recalculating the scroll position.
2015-12-17 14:14:26 +00:00
Matthew Hodgson
bb184c12a1 fix NPE 2015-12-17 11:56:41 +00:00
Matthew Hodgson
d979a028a5 position the inbound call box correctly, and fix various issues with when the video preview and callview are shown 2015-12-17 02:49:09 +00:00
Matthew Hodgson
4327a2302d spell out affected versions 2015-12-16 18:05:15 +00:00
Richard van der Hoff
dc13b944bc Hacky fixes to jumpy scroll when backfilling
Keep resetting our scroll offset until the DOM believes us. Hopefully this will
fix vector-im/vector-web#528.
2015-12-16 17:57:32 +00:00
Kegan Dougal
e8f82527d1 Listen for room deletions and refresh the room list when it happens 2015-12-16 16:27:46 +00:00
Kegan Dougal
f7aa8be1c1 Add a forget button. Add left rooms to the "historical" tab.
Call /forget when the forget button is clicked. Number of shortcomings:
 - We need to lazy load the historical list (atm we never get the list of left
   rooms; things only go into that list if you leave the room whilst running)
 - Once a room is forgotten we need to physically nuke it from the JS SDK.
 - Need icon for forget room.
2015-12-16 16:06:29 +00:00
Kegsay
186b727303 Merge pull request #54 from matrix-org/kegan/hide-fs-users
Do not show conf user join/parts
2015-12-16 13:56:55 +00:00