Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intermix prefetched usernames and API responses, de-duplicating and c… #9820

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

TildaDares
Copy link
Member

@TildaDares TildaDares commented Jun 16, 2021

Part of larger planning issue #9667

Blending the list on the server side would be complex and inflexible and since both APIs return different JSON objects manipulating their objects would be a lot harder which is why I chose to do it on the client side.

No matter how I order the arrangement of both lists, the callback in the remoteFilter function always displays the usernames that match the first strings in the username at the top. In the video, you'll see this demonstrated when I type @a.

intermix.mov

You can test it here https://unstable.publiclab.org/

@gitpod-io
Copy link

gitpod-io bot commented Jun 16, 2021

@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@c76e485). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head d079858 differs from pull request most recent head 3a38168. Consider uploading reports for the commit 3a38168 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9820   +/-   ##
=======================================
  Coverage        ?   26.03%           
=======================================
  Files           ?       98           
  Lines           ?     7620           
  Branches        ?        0           
=======================================
  Hits            ?     1984           
  Misses          ?     5636           
  Partials        ?        0           

@TildaDares TildaDares closed this Jun 18, 2021
@TildaDares TildaDares reopened this Jun 18, 2021
@TildaDares TildaDares requested a review from jywarren June 21, 2021 10:30
@jywarren
Copy link
Member

Blending the list on the server side would be complex and inflexible and since both APIs return different JSON objects manipulating their objects would be a lot harder which is why I chose to do it on the client side.

Great justification - awesome!

Looking now!

@jywarren
Copy link
Member

This looks super!

No matter how I order the arrangement of both lists, the callback in the remoteFilter function always displays the usernames that match the first strings in the username at the top. In the video, you'll see this demonstrated when I type @A.

Do you think this is a problem? And if not, do you think this is ready to merge?

@jywarren
Copy link
Member

image

The issue you mentioned about ordering is here:

image

So, are you saying there really isn't a way to intercept the ordering /after/ remoteFilter? If that's the case, i think it's OK. What do you think?

@jywarren
Copy link
Member

Finally, is there a system test you'd like to add to this, which would protect the functionality? It could search for the recently active text, perhaps?

@jywarren
Copy link
Member

And, it would be nice to have it in the same PR, so that the test and the functionality are linked in the history!

@TildaDares
Copy link
Member Author

TildaDares commented Jun 22, 2021

So, are you saying there really isn't a way to intercept the ordering /after/ remoteFilter? If that's the case, i think it's OK. What do you think?

I'm still looking through At.js docs and issues for how to override the remoteFilter. For now, I think the merge can wait.

@TildaDares
Copy link
Member Author

Finally, is there a system test you'd like to add to this, which would protect the functionality? It could search for the recently active text, perhaps?

I'm definitely going to write a test. I just needed to confirm I was going in the right direction.

@TildaDares
Copy link
Member Author

TildaDares commented Jun 23, 2021

There's an open issue about the default filtering in ichord/At.js#448 but I've not found a solution. I tried changing the value of atwho_order to 0 but that didn't work. Looking at at.js code the ordering is determined by the index the query/string is found. I'm not sure I can override it.

@TildaDares TildaDares closed this Jun 23, 2021
@TildaDares TildaDares reopened this Jun 23, 2021
@TildaDares TildaDares force-pushed the intermix-usernames branch 5 times, most recently from 4d1bd5e to 82cdaea Compare June 25, 2021 20:15
@RuthNjeri
Copy link
Contributor

Hi @TildaDares 👋🏾 , looking at this now, you can respond tomorrow.

What makes a user marked as recently active? should something be done with the users in the test case to make one active? Also, something else that could be an option is maybe adding a few seconds with before checking the assertion, with sleep or something else I have seen in the tests is a function called wait_for_ajax that I think waits for the response of an API call to complete...

@TildaDares
Copy link
Member Author

@RuthNjeri I've tried the wait_for_ajax method and the sleep but it's not working. And a user is marked as active with the recently active text. Is there a way to look at the screenshots taken when running a system test? Locally, I can look at screenshots in the tmp/screenshots folder.

@TildaDares TildaDares force-pushed the intermix-usernames branch 2 times, most recently from af83c22 to 82cdaea Compare June 27, 2021 20:33
@codeclimate
Copy link

codeclimate bot commented Jun 27, 2021

Code Climate has analyzed commit 3a38168 and detected 0 issues on this pull request.

View more on Code Climate.

@RuthNjeri
Copy link
Contributor

RuthNjeri commented Jun 29, 2021

@RuthNjeri I've tried the wait_for_ajax method and the sleep but it's not working. And a user is marked as active with the recently active text. Is there a way to look at the screenshots taken when running a system test? Locally, I can look at screenshots in the tmp/screenshots folder.

Hi @TildaDares, I am not sure that there is a way to access the tmp/screenshot, currently I don't see any artifacts stored in the workflow

Screenshot 2021-06-29 at 15 39 25

There is a process to enable it, maybe @jywarren can have a look at it? (the process requires access to the Repo settings), https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository

I see you've updated the test to check for the list of names instead of the recently active text, that's okay too and a great alternative test. Maybe once we have access to the artifacts we can see what's happening...In the meantime, I'll have one final look and merge the PR 🚀

@jywarren
Copy link
Member

Great problem solving and yes, i'll look at the artifacts! We never had time to get those working in GitHub Actions yet. It'd be great!

@jywarren
Copy link
Member

OK, cool, i opened a PR for the screenshot saving here, let's see: #9868

@TildaDares TildaDares deleted the intermix-usernames branch June 29, 2021 19:08
17sushmita pushed a commit to 17sushmita/plots2 that referenced this pull request Jul 7, 2021
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants