The Steem Curation Extension now shows available voting power

in Steem Oasis 🌴6 days ago (edited)

Today, I made my first update in a while for the Steem Curation Extension (with help from claude.ai). Using the api endpoint from @justyy's loadbalancer, https://api.steemyy.com, the extension now shows the current voting power from the logged in account if the mouse goes over the user name in the profile dropdown menu. For example,

With mouseover

And without mouseover

There should be no changes to the highlighting for /promoted posts and posts with @null beneficiaries.

The version label is: 20240922.

Update: I added an event handler to clear it by clicking anywhere if the mouseover happens too fast for the tooltip to be removed. I also repositioned the voting percentage so that it's not blocking the "Profile" link any more. Sorry for the late-breaking changes. Now I'm done with it for the day.

The version label is now: 20240922.3, and it looks like this:

Sort:  

Very nice. I have not yet given up my intention to have a look at the extension in the new version. Also the SCA. Unfortunately, I can't get round to it at the moment.

Intuitively, I would place the VP directly after the account name. Is there a reason why you have arranged it as a separate pane?

Is there a reason why you have arranged it as a separate pane?

It's not really a pane. It's just a tooltip, but the reason I placed it there was because I don't know how many characters will be in the account name. I tried moving it to the right first, but I don't think there's enough room to fit a 16-character account name along with the voting-power label all inside the rectangular area. When I moved it to the left side, the length of the account name stopped mattering.

What do you think about this:

grafik.png

You are welcome to take a look at the branch I created on your fork:
https://github.com/only-dev-time/Steem-Curation-Extension/tree/vp_on_profile_pane

Looks good to me, as long as it'll fit with a 16 character account name? If I read that right, it'll just append the (VP...) and the pane will be automatically sized so it all fits?

We just criss-crossed because I realized last night that the voting power reported by the blockchain doesn't regenerate as time passes, so I added a time calculation, but you solved that by pulling from steemworld?

Unfortunately, I was careless and updated the main branch. I've got to get better at remembering to do things in a separate branch. I'm not used to working in a shared repo yet. 😉

If I read that right, it'll just append the (VP...) and the pane will be automatically sized so it all fits?

Yes, I tested it with variuos account names.

you solved that by pulling from steemworld?

Correct. The value of the condenser_api was unfortunately the value from the last voting. I wanted to insert the calculation of the current value, but then decided in favour of the query from Steemworld, as we need a query anyway.

I'm not used to working in a shared repo yet

I also learnt that here with Steem. I now get on very well with git. Distributing the test branches to the servers and switching between the dev branch and test branch for Hivemind also works very well with git.

Update 2: Apparently, when you log out and back in, none of the events that I was handling take place. With Claude's help, I set up a mutation observer to add the click handler when the dropdown menu gets created, and I also added a check to eliminate the errors when the dropdown menu doesn't exist. This branch is an updated version of yours: https://github.com/remlaps/Steem-Curation-Extension/tree/fix4NoDropdown

Sorry if I'm not handling any of the git stuff correctly, I've never worked on an actively shared repo in git, so I'm figuring it out as I go.

You were much quicker than I expected :-D My branch wasn't even finished yet because I hadn't tested it properly either. In addition, the code was still very wild. But I'm glad you've already been able to fix something.

This branch is an updated version of yours:

I've had a look at it and am already very excited. The code doesn't look so wild anymore. :-)
Working together on a branch is yet another new challenge. I don't know if we can use comments to discuss the code directly.
Unfortunately it's too late today (again), but I'm still happy to test the code soon.

You were much quicker than I expected :-D My branch wasn't even finished yet because I hadn't tested it properly either. In addition, the code was still very wild. But I'm glad you've already been able to fix something.

Coincidentally, I had the morning off today, and I was (overly?) eager to figure out what was going on with that 1st click not displaying.

I've had a look at it and am already very excited. The code doesn't look so wild anymore. :-)

Yeah, after two years, I didn't remember much about how it worked, so I tried to prepare for next time. Although, this exercise really gave me some ideas about other possibilities, so maybe it won't be two years again.

Working together on a branch is yet another new challenge.

Yeah, sorry about that, I was not sure about the correct github mechanics for the situation, but the way I did it seemed less than ideal. FWIW, I don't expect to be working on it again in the next few days, so test away if you find time. 😉 Once you're satisfied with the current iteration, I think we can update the version date and merge it into the main branch. There's still one scenario (that I'm aware of) where the highlighting doesn't get painted on until the user scrolls or clicks, but that's been with us since the beginning. Not a result of these recent changes.

ok. I just split my updated "main" into a separate branch, reverted "main" to the previous version, and then I brought in your branch. The only thing I see that's a little weird is that it seems to generate errors and fail the first time you click after logging out and back in again. Not a big deal, 'cause it works the second time.

That's wonderful.

I can't view it though. I have updated the already downloaded extension in my browser through developer mode. But I saw no changes. Do I need to download it again?

Yeah, unfortunately, if you downloaded it before today you would need to replace the downloaded directory with the new one from today and then reinstall it in developer mode.

It's working now. Thank you so much for this.

I use Safari for sc0x accounts. Is there any chance that it can be used there?

I think it might, but I don't know. I've never used Safari. You can giveit a try and just uninstall it again if it doesn't work.

FWIW, brave search says that Safari supports manifest v3 after version 15.4, so if you have the latest version, I hope it'll work.

I am also not very familiar with Safari. Just use it for simple browsing sometimes as it feels smoother than Chrome on Mac. I will try installing the extension there too and will let you know if it works.

FYI, I made a couple of bug fixes yesterday with regards to positioning and scrolling of the voting power display, so you might want to make sure you have the latest version. It's 20240922.4. At this point, I hope I won't be touching it again any time soon. Sorry for the inconvenience.

Thank you for informing. I will install the latest version.

Great work! !thumbup

Hello @remlaps-lite! You are Magnificent!


command: !thumbup is powered by witness @justyy and his contributions are: https://steemyy.com
More commands are coming!

Thank you, @event-horizon.

It's not and I believe it has already been discussed in the past. (:

Na dann können ja alle einen Spam Kommentar absetzen munter drauf los
, ich werde diese Kommentare nicht suchen gehen aber wo sie mir begegnen werde ich sie als Spam benennen

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.030
BTC 65546.28
ETH 2666.01
USDT 1.00
SBD 2.90