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

Implement Recommendations #444

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jackyzy823
Copy link
Contributor

@jackyzy823 jackyzy823 commented Oct 2, 2021

UI looks like:

Desktop
Screenshot from 2021-10-02 05-18-51

Mobile:
1.toggle off
Screenshot from 2021-10-02 05-19-32

2.toggle on
Screenshot from 2021-10-02 05-19-54

TODO:
Should we limit numbers of recommendations in twitter api. or limit numbers in display (random pick) or just display them all?

@jackyzy823 jackyzy823 force-pushed the api-recommends branch 4 times, most recently from f9c3c5f to 3dee341 Compare December 28, 2021 09:04
@jackyzy823 jackyzy823 marked this pull request as ready for review December 29, 2021 10:44
@jackyzy823 jackyzy823 force-pushed the api-recommends branch 2 times, most recently from 41ba7b8 to 3a279e2 Compare December 30, 2021 12:48
@zedeus
Copy link
Owner

zedeus commented Jan 1, 2022

This feature is nice, but I'm having mixed feelings about it. I think some might see it as an anti-feature, Twitter trying to stuff "You might like" recommendations down the throat of users making the experience more "noisy", while it can also be a great way to discover similar accounts. You know what I mean? I feel like maybe it should be opt-in with a preference, and only show 3 with a "Show more" link at the bottom similar to tweet threads. I'd also like to call it "Similar accounts" or "Recommendations" for a more neutral wording.

A different issue is design. I'm quite happy with Nitter's profile layout, in particular my choice to make the profile "sticky" by default, so you can see what timeline you're browsing at all times. This does however mean there's a limit to how much stuff we can put on the left side before you run into issues. Here's how Twitter currently looks:
image

Instead of on the left side, they have the gallery, recommendations, and trends on the right-hand side. If the window gets too narrow, they simply hide everything instead of turning it into a mobile-friendly column like Nitter. One step towards a more "scalable" layout would be enabling the mobile view dropdowns for gallery and recommendations in desktop view, expanded by default instead of collapsed. In other words, the distinction between desktop and mobile for the sidebar dropdowns should be minimal, only using media queries to invert the behavior between mobile and desktop (unchecked checkbox should mean expanded on desktop and collapsed on mobile). That way you can just collapse the gallery if your screen isn't tall enough to see the recommendations. I would also like to be able to show trends as well (opt-in of course), so being able to collapse on desktop is a must. On that note it would be great to have a more generic way to create these "dropdown panels" for the profile side bar that can be reused between the gallery, this and upcoming trends, both in the view code and scss. You don't have to do this unless you really want to, I can take care of it after the PR.

So in short:

  • "You might like" -> "Similar accounts"
  • Add a new preference group called "Features", make one called similarAccounts off by default, add one called profileGallery on by default, and move infiniteScroll into the group
  • Limit the amount of displayed accounts to 3
  • Add a "Show more" link which opens a separate page with every fetched account shown (I consider this out of scope for this PR and not a necessity by any means, but it would be nice and not that hard, we already have an account list view used for search and list members)

@@ -449,6 +449,10 @@ proc parseTimeline*(js: JsonNode; after=""): Timeline =
elif "cursor-bottom" in entry:
result.bottom = e.getCursor

proc parseRecommnedations*(js: JsonNode): Recommendations =
Copy link
Owner

Choose a reason for hiding this comment

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

Typo

@jackyzy823
Copy link
Contributor Author

I feel like maybe it should be opt-in with a preference

ok. I will make it a preference.

  • Limit the amount of displayed accounts to 3

I'd like to fetch all and then random show user 3 of them. It is just because I hate that when i click show more in twitter page, they ask me to login :-(

it will take some days to finish these all.

@zedeus
Copy link
Owner

zedeus commented Jan 7, 2022

Picking 3 by random could work, but I wonder if they rank/sort the list somehow, which would result in worse recommendations of course. Do you know? Looking at some API responses and manually assessing how relevant the results are for a few examples should be enough to get a feel for how they do it.

@zedeus
Copy link
Owner

zedeus commented Jan 23, 2022

Due to a semi-emergency caused by Twitter I had to make a lot of changes, especially in routes/timeline.nim. Let me know if you need help rebasing, I see quite a lot of conflicts.

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

2 participants