[Utopian] Filter Resteem from User Blog

in utopian-io •  19 days ago

Repository

https://github.com/steemit/condenser

New Feature

This is a feature that was recently merged and deployed into Steemit. Earlier I submitted a pull request to add the feature to filter resteemed posts from a given user's profile page. This was a long-requested feature that has various workarounds through browser extensions and handled in various alternative interfaces, but I just wanted to make it work in Steemit.

Here is how it looks when you look at the user's profile. There's a little link now that shows up when you first load the page that indicates "Hide Resteems":

filter resteem screenshot

Once clicked, it will remove the resteemed posts from the page immediately, and show up as "Show All", like so:

show all screenshot

Since all the post data is preserved, this switch is relatively insant. Now when you scroll to the bottom, if you are in the hide-resteem mode, it will fetch more posts until either a certain number of main posts are found, or an upper limit of post fetches is reached. So for example, if you go to see a resteem-only page, it will just be blank.

If every single post in the feed is a resteem, or if there's only 1 main post, it's possible that it doesn't retrigger a re-fetch until you resize, which is a slight annoyance. In the majority of the cases though, I don't expect too many problems.

Implementation

While this kind of filtering is normally something done by the database, there was no database-like backing to do such a thing, and it would likely need HiveMind support to do it in that way. So I investigated just to do something that we as end-users would end up doing anyway: repeated fetching until we finally found posts that are not resteems (if looking at a resteem-heavy profile).

If you follow my list of files: https://github.com/steemit/condenser/pull/2897/files the change boils down to a few components:

  • Link and Text, linked to the action of requesting to hide resteems, which is here. Oh dear, I forgot to localize that text!
  • Propagating the Signal to the code that performs the data fetch. This isn't anything special, you'll see in the first few files of the link that a showResteem boolean is being passed around. Something of note here is that a predicate is formed here and passed down to the data fetch code.
  • Modifying the Data fetch to perform repeat fetches until the required number of filtered posts are found, or until the max batch size limit is reached.
    • I changed the fetch into a loop here. One thing to note in this loop is that it does not discard anything. It retains all fetched posts and passes it up, and relies on the front end to actually filter it. So essentially, this simply fetches until the number of posts that match the filter fills up the batch.
    • There's a piece of code here that has a signal where if it knows there is no more data to fetch, it will signal to the top that it should wait a short period of time before requesting another fetch for the same data. It was modified to rely on the caller to pass the signal for end of data.
    • Oops. I left some unused code around, will need to clean that up! Will need to clean this up shortly
  • Code to hide the resteemed posts. That is here, which is pretty straight forward, it detects the signal for whether to hide the resteems, and checks if it is a resteem or not to decide whether not to show the item.
  • Tests, for the rest of the files. Nothing too exciting here, sets up the fetch with the filter and runs multiple cases, including the case where it fetches until a max batch size is reached.

If you are curious about any part of the change, do let me know and ask below.

GitHub Account

https://github.com/eonwarped

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for your contribution. A nice little update for Steemit website, which is actually good for Steemians. The code looks good and its nicely explained in the post. A really like that you have added the test too.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

·

Thank you for your review, @codingdefined!

So far this week you've reviewed 6 contributions. Keep up the good work!

hmmm so you are the one responsible for it! Great job man!

Although i would prefer if something like this could be done in our feeds too, cause some of the people we follow tend to make tons of resteems :P and thus the whole scrolling down and manually checking becomes quite difficult.

On the other hand don't get me wrong, i think this is a huge huge step. I keep nagging about the interface and how old and hard is with the current number of people in the platform.

So watching this made me think there is still hope so once again i am very thankful!

·

So it was brought up in discussion that doing it for feeds would make resteems worth almost nothing as a tool for exposure, which I do agree with. My policy there is if I see too many resteems for things I do not like, I simply unfollow. There are plenty of times where a resteem on my feed has led me to some interesting posts after all.

·
·

yes but i think there are already dapps that are doing this so eventually will be a need for that here or nobody will use that interface (not only for that reason, this is the least). I have some people 2-3 that may too many resteems but they both quality and loyal users. At the same time 1/10 times a resteem might seem useful to me so i can't unfollow these guys even if they are making my life difficult.

I don't think it will lose it's worth it will simply be a choice. if you have people like you said that led you to interesting post then there is no need and you can always switch it back. I may have no time this day and need to quickly check my feed, i will click to hide the resteems to do so and they again show them!

·
·
·

I see your point as well, mainly because if it were me personally I would probably turn off all resteems (even though I said they have been useful sometimes) :D. I don't know. This is a particularly contentious point among people that are proponents of resteems though, and I'm not sure what the consensus of the Steemit site code owners is. If I remember correctly though, they weren't willing to do it for feeds. I'd have to doublecheck though. This is always something that can be raised and debated though in their issue trackers.

·
·
·
·

+1 make it optional to work on feeds..

  • Some days you feel like a nut
    Sometimes you don't
    (from Mounds / Almond Joy commercial...)
    • Today I'll turn off all resteems
      Tomorrow I won't...

BTW, thanks for your coding @eonwarped. This is a very cool and needed feature!!!

·
·
·
·
·

Lol! I feel like I've seen that commercial and I'm not sure why but it is really weird and funny to me.

·
·
·
·

yes and as i see it it's something that will not be decided now, they have way more serious issues to solve!

·

Although i would prefer if something like this could be done in our feeds too, cause some of the people we follow tend to make tons of resteems :P and thus the whole scrolling down and manually checking becomes quite difficult.

I don't see why not. I second that! :)

Unfortunately it doesn't work well when there are no original non-resteemed stories in the blog visible. Infinite scrolling is then disabled, no more stories are loaded, even though there are some non-resteemed stories in the part that is not loaded yet...

·

Yeah... I'm aware of this part and trying to think about the right way to handle it. It's not triggering the reload in that scenario. You can get it to do it by forcing a resize or a zoom (ctrl +/ctrl -) in the meantime.

·
·

I am actually thinking about how to solve it as well, developing a web interface for Steem myself :D One possibility would be to not hide but somehow dim the stories that are resteemed. That might force the user to scroll for some time to get to original content, but at least it would work :-)

Or fetch more stories in a loop until N non-resteemed is encountered, which will obviously fetch a lot of data in case someone is only doing resteems and nothing else. It will fetch the whole blog.

·
·
·

Or fetch more stories in a loop until N non-resteemed is encountered

Yeah that's already happening (up to a certain limit), it just didn't trigger that logic in this special case. It will do it if it registers a scroll event that hits the bottom, but in the case where there isn't any to begin with it won't trigger. In this particular case, it might be beneficial to have a little button that forces a load, like a "load more" button.

Ha! Finally! You're a hero @eonwarped ;-)

Great job @eonwarped - I've been needing this feature for ages!

Thank you for recommending me this link @eonwarped

Appreciate your time and effort. You're doing great job

Yours, Piotr

Starting to think if you don't fiddle on the steem frontend then we might end up having an Internet Explorer case. Thank you for making steemit just that bit more. Good job.

I saw the hide resteem option earlier and it is awesome! Thanks for working on this feature. It is sorely needed and very appreciated!

Well done @eonwarped! I came to your blog from GitHub, where I saw your work on the PR being merged into master a few hours ago by @roadscape. It was about time a condenser had this feature!

Awesome.i need this

Posted using Partiko Android

Another great contribution! It took a while to be implemented but it's still cool since I don't use steemit but busy lol

·

To each their own eh? I guess eventually if I just wanted to look I could use the other tool that shows full post history, come to think of it :D

·
·

At least I know that the next time I'm digging for a post in someone's profile and they have a lot of resteems it would be more efficient to just hop on to steemit :^)

I wanted this for so long.
Thanks a lot! (even though I already went to steempeak, it doesn't harm for steemit to have that feature as well :P )

·

I've been meaning to check out steampeak for a while, but I'm just so used to Steemit that I can't seem to leave it :)

I really don't know if I like it or dislike. Because that will make people even more selfish and now every time I Resteem something by someone I like a lot of people won't reach it so it will be more difficult to find new users and spread the content around.

Posted using Partiko Android

·

That's actually not touched by this change. Your feed still shows resteems from people you follow. So don't worry :)

I like it, sometimes I get to see a profile and I want to see what "they" do, I myself resteem little cos I like my feed to be consistent, this way it can be filtered what I do share and the same for me about others... and I can make an idea. It would be nice "still" though that instead of hiding or showing there would be two columns, showing your feed and your shares

·

Yeah, I've seen this idea discussed as well but I don't remember if it was agreed upon. In the current format it might be easy to make it a drop-down with the third option though (someone has a two tab prototype as well). I personally haven't found a desire to show only resteems though, maybe because most people would share more than they post themselves, but that could be just me.

I've really loved this new thing, it helps me a lot :D

Good job man :)
We been waiting for this a while :P
Now will it take 3 months for a filter option to be added to Steemit ;)

Something a lot of us have been wanting, thank you. I did not read all the technical's on it. It works that is good enough for me.

·

Agreed. Something I've always wanted.

Congratulations @eonwarped! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:

SteemitBoard knock out by hardfork

Support SteemitBoard's project! Vote for its witness and get one more award!

Please 🙏 remove me from blacklist my younger sister temperd with my phone

Upvoted.

Hey, @eonwarped!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hi @eonwarped!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server