-
-
Notifications
You must be signed in to change notification settings - Fork 30
Conversation
Here is the current state of a repos issues page with badges for issues with funding amounts and statuses (these are also links which take you to the issue on the gitcoin site) Here is the current state of a search for keywords, I am doing a keyword match as well as doing a title match with indexOf() . One can also search for claimed bounties. It is currently working on a 500ms debounce from the 'keyup event'. Here is the new user tip button. @owocki let me know if you have any thoughts on the work so far. |
i am out of pocket today (limited internet, thanksgiving break in the US), but wanted to pop in and say that i'm very excited by the progress i see here! the issues board in particular looks very promising. |
i will pop in with more thoughtful feedback hopefully over the weekend |
No rush @owocki, Happy Thanksgiving! I will update this pull with any further progress I make |
I actually have a few things I want to clarify: For "1.) Ability to browse funded issues (and amounts) on an issue board", when you say board, do you mean the "boards" tab (the kanban board) or the page i attached (all issues page)? In your previous comment you said my work on the issues board looks good, just want to make sure which page this task is referring to. I am also struggling to find the code when the notifications are generated, could you point me in the right direction? Thanks you for the help and I'm glad you like the progress so far :) |
Looking at this now. Thanks for your patience thus far (holiday weekend!) |
@@ -11,25 +11,41 @@ var body = function(){ | |||
setThumbnail(''); | |||
} | |||
|
|||
var isOnUserProfile = isOnGitHub && url.match(/.+\/.+\/?/gi) != null; | |||
var isOnUserProfile = isOnGitHub && url.match(/.+\/.+\/?/gi) != null && document.getElementById("report-block-modal"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
var isOnProfile = isOnGitHub && url.match(/.+\/.+\/.+\/?/gi) != null; | ||
var isOnRepo = isOnGitHub && url.match(/.+\/.+\/.+\/.+\/?/gi) != null; | ||
var isOnIssuePage = isOnGitHub && ( url.indexOf('/pull/') != -1 || url.indexOf('/issue/') != -1 || url.indexOf('/issues/') != -1 ); | ||
var isOnIssuesPage = isOnGitHub && url.indexOf('/issues') != -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this reminds me, i should refactor isOnIssuePage
to be more descriptive of where the user actually is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely, this is something I can add too. A simple "check if element on page" should suffice, unless you have something else in mind
} | ||
|
||
getAllBounties = function(){ | ||
var bounties_api_url = 'https://gitcoin.co/api/v0.1/bounties/?order_by=-web3_created'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you wanted to be more performant/selective, you could search bounties by keyword here (so that you don't have to match inside the for loop on line 28).
Here's an example: https://gitcoin.co/api/v0.1/bounties/?raw_data=python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
itd also be good to only show mainnet bounties that are open
https://gitcoin.co/api/v0.1/bounties/?&idx_status=open&network=mainnet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thanks for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind making this change
itd also be good to only show mainnet bounties that are open
https://gitcoin.co/api/v0.1/bounties/?&idx_status=open&network=mainnet
@@ -66,15 +75,69 @@ var addMessage = function(_class, msg, seconds=5000){ | |||
setTimeout(callback, seconds); | |||
} | |||
|
|||
getAllBounties = function(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if theres a way to DRY here.
installing the browser extension now to play with it. here is my feedback upon first use:
|
I was hoping that the user could be provided an option to hide non-funded issues when browsing an issues board. This way they would only be looking at funded issues. Is this plausible?
Sure thing. What I did might be a little hacky, but here it is. https://github.com/gitcoinco/chrome_ext/blob/master/script/pageload/callbacks.js#L25 You want to use |
I'd also say that so far this looks really good and matches Github style way better than my code did. |
TODO: if an issue is already funded the green button shouldnt say 'fund issue', it should say 'claim issue' http://bits.owocki.com/1P321E1Z2Q2A/Image%202017-11-27%20at%209.13.27%20AM.png |
@owocki Thanks! Glad you like it. I tried to reuse github style classes as much as possible to save me writing css :) I noticed the long titles conflicting with the button too. I will reposition so that doesn't happen and change text to claim issue if issue is funded. I don't know how much success we will have with the issues kanban board. I can inject the html correctly on initial load, but it seems that there is a virtual scroll that re-renders the html and removes whatever i injected. Just pushed that code now, if you wanna take a look for yourself. All your requested changed look good, I will work on them on the next few days and will update you with my progress. |
Also, as a side issue, I have noticed that the body function is only invoked on a full page refresh. From what I can tell, github is a collection of smaller SPAs. This means that not every page change will re-invoke the body function (it won't work if you stay inside the same SPA, only if you change to diff SPA). I tested and found this behavior on the master branch too. Just something I thought I should give you a heads up on @owocki |
totally hacky, but would it be worth having a
sorry, which body function? mind pointing me to the code? i wonder if this means the |
🔥 hott! looking forward |
I tried doing something like this (was listening to dom changes) but it was firing way too much, setting it on an interval is a good idea. It won't be perfect but it will work.
Its the body function in the scripts/pageload/body.js file, invoked in body.js:52. I thought about how to handle this situation for a while over the weekend (with little success). I could see a setInterval being problematic for the general case. Wouldn't it just re-inject the same html multiple times? We could do a check to see if the html had already been injected as a workaround to that issue. It would be great if we could listen for a url change event instead. Ill let you posted on this. |
Usually while developing chrome extension injecting content scripts to a dynamically changing SPA, we use MutationObservers. That might help in this case. Instead of calling the |
this is so cool. thanks @rajatkapoor ! |
@rajatkapoor thanks for pointing this out. I tried using the mutation events api with little success. mutation observers are exactly what I'm looking for. |
really excited about the trello bonus! great to have you back @jclancy93 .. i hope to ship this soon! |
Hey @owocki, thanks for bearing with me! I added persistent keywords to the popup and the popup will now autofill the issue keyword when on a github repo. From what I can tell, it looks like you use the bounty smart contract as the data source for numBounties, the number for setThumbnail(). Would you like me to change this as the data source? |
@jclancy93 npnp :)
defer to you on this. you can use either the REST API or web3 ! |
@owocki it looks like the variable numBounties in the contract isn't always matching up with the number we expect (most of the time it is). For example, the smart contract repo it lists the number of issues as 4 but It should only be one. |
got it; i think we can use the http api as source of truth then ! |
Ok this should help a lot with the thumbnail issue. The thumbnail should now:
Let me know what you think! |
this sounds right to me. ill pull the lates code into my google chrome and test it for a day or two and get back if anything feels off |
Is it only when you are on the proper repo, or anything downstream from the repo (wiki, pull requests, etc)?
does it only do issues of a certain type? for example, i am on this URL right now #5 (comment) and i get a 0 in my thumbnail -- but the issue we are on now (chrome extension) is an open issue i think.. |
one other random piece of feedback. it'd be cool if when i was on a github repo that has open funded issues, if those were automatically shown when i click the gitcoin thumbnail. so for example, while on #5 i click the thumbnail and the keywords field is prefilled with |
I know its working on both issues and the repo page, but I still need to do more testing downstream. Based on some quick testing I did just now, it doesn't seem to work on anything more downstream than issues, but I will fix that up.
So the Browser Extension Revamp issue is actually associated with the web repo, thats why its not showing up here. I am only displaying issues with idx_status=open right now, but can easily change that.
This is already happening! :) Here's some screenshots: |
awesome! what can i do to help you get this shipped soon. this is already such an advancement over the current featureset, i'd love to put it live for the community to play with it soon :) |
Maybe we could release this on a beta branch and allow for the community to given open feedback/suggestions? You can announce it via slack or email or reddit? I'd like to do a little cleanup before then, just remove logging statements and make sure that I'm consistent with your code. Apart from that, I think everything from the original bounty is complete. The only other thing I think needs improving is running specific functions with setTimeouts, I'm hesitant to force everything to run on a setTimeout cause I'm afraid of the performance costs. I'll try to have a push out later today with these two improvements. Let me know what you think of this plan |
Yes, I like this idea.
I'm into it :) While youre at it, can you resolve the merge conflict too pls? |
merging to master so i can cut a release. stay tuned! |
WIP for gitcoinco/web#50
TODO List
Development