Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Better autocomplete #296

Merged
merged 16 commits into from
Jul 4, 2016
Merged

Better autocomplete #296

merged 16 commits into from
Jul 4, 2016

Conversation

aviraldg
Copy link
Contributor

@aviraldg aviraldg commented Jun 1, 2016

Still WIP. Fixes element-hq/element-web#1574, element-hq/element-web#821, element-hq/element-web#644, element-hq/element-web#584, element-hq/element-web#883, element-hq/element-web#572.

TODO:

  • emoji provider
  • username provider
  • room provider
  • disable old autocomplete
  • fix positioning
  • styling
  • tab & arrow navigation

@@ -5,7 +5,8 @@ import {
convertFromHTML,
DefaultDraftBlockRenderMap,
DefaultDraftInlineStyle,
CompositeDecorator
CompositeDecorator,
SelectionState
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really minor thing, but if we're moving to all-new ES2016, presumably this can end with a comma?

@dbkr
Copy link
Member

dbkr commented Jun 21, 2016

Looking good!

@matrixbot
Copy link
Member

Can one of the admins verify this patch?

@dbkr
Copy link
Member

dbkr commented Jul 4, 2016

@matrixbot test this please

this.setState({
completions: newCompletions
completions: newCompletions,
completionList: _.flatMap(newCompletions, provider => provider.completions),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth pulling in all of lodash just for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lodash has a bunch of useful utilities which can replace a decent amount of
code that's currently in the codebase. ratelimitedfunction, for example.

On Mon 4 Jul, 2016, 4:13 PM David Baker, notifications@github.com wrote:

In src/components/views/rooms/Autocomplete.js
#296 (comment)
:

                 this.setState({
  •                    completions: newCompletions
    
  •                    completions: newCompletions,
    
  •                    completionList: _.flatMap(newCompletions, provider => provider.completions),
    

Is it worth pulling in all of lodash just for this?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/matrix-org/matrix-react-sdk/pull/296/files/a74db3a815879558110fcaa4b2f6f322dc1af783..cccc58b47f77f0eec644bc2455916496ed468318#r69440073,
or mute the thread
https://github.com/notifications/unsubscribe/AAOlRHqTcDZbZTyo-RK80t7msI-bmPF_ks5qSOPBgaJpZM4Irc8R
.

Copy link
Member

@dbkr dbkr Jul 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - not opposed in principle, just want to make sure it's worth an extra 22kB on the bundle

@dbkr
Copy link
Member

dbkr commented Jul 4, 2016

Trying it out, I get the autocomplete list every other character I type, ie. I type an '@' symbol and the list of users appears, then I type 't' and it disappears, I type 'e' and it appears again.

@dbkr
Copy link
Member

dbkr commented Jul 4, 2016

Also, it would be good if the 4 emoji that appear when you type a colon were commonly used things like the smilies: having it pop up with some kissing couples and a fist is somewhat offputting :p

@dbkr
Copy link
Member

dbkr commented Jul 4, 2016

It also seems to get a little confused with the colons in room aliases / user IDs, popping up the emoji autocomplete.

@dbkr
Copy link
Member

dbkr commented Jul 4, 2016

OK, looking good in general, just a few comments as above.

@aviraldg
Copy link
Contributor Author

aviraldg commented Jul 4, 2016

That it alternates between showing and not showing completions when typing seems to be a recent regression -- did it work for you before the last update (ie. before replacement was added?)

@dbkr
Copy link
Member

dbkr commented Jul 4, 2016

Re: the alternating, unsure to be honest, as far as I can remember, it did.

@dbkr
Copy link
Member

dbkr commented Jul 4, 2016

OK, lgtm!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better autocomplete
3 participants