FEATURE: autocomplete usernames early in topic based on participation

Following this change when a user hits `@` and is replying to a topic they
will see usernames of people who were last seen and participated in the topic

This is somewhat experimental, we may tweak this, or make it optional.

Also, a regression in a423a938 where hitting TAB would eat a post you were writing:

Eg this would eat a post:

``` text
@hello, testing 123 <tab>
```
This commit is contained in:
Sam
2019-02-20 13:33:56 +11:00
parent cff108762a
commit 1f4ace4f56
4 changed files with 65 additions and 14 deletions

View File

@@ -137,6 +137,11 @@ describe UserSearch do
results = search_for(staged.username, include_staged_users: true)
expect(results.first.username).to eq(staged.username)
results = search_for("", topic_id: topic.id, searching_user: user1)
# mrb is omitted, mrb is current user
expect(results.map(&:username)).to eq(["mrpink", "mrorange"])
end
end