jerone / UserScripts

🐵 My UserScripts
https://github.com/jerone/UserScripts#readme
GNU General Public License v3.0
339 stars 39 forks source link

(GitHub News Feed Filter) The 'Repositories' tab is empty. Also please consider displaying the filter's entries by default, as it was in previous versions #124

Closed darkred closed 6 years ago

darkred commented 6 years ago

Using GNFF 8.1.0 with Tampermonkey 4.6 in Chrome 66/Firefox 60 (tested in a new profile too).

I've noticed that whenever I click the 'Repositories' tab, it's empty of content.

This is an example error entry from the Chrome's console:

ERROR: Execution of script 'Github News Feed Filter' failed! Failed to execute 'add' on 'DOMTokenList': The token provided ('5 repositories') contains HTML space characters, which are not valid in tokens.

and here from Firefox's console:

ERROR: Execution of script 'Github News Feed Filter' failed! String contains an invalid character                userscript.html:2:172

Also, as a sidenote, I'd like to ask you please to consider displaying the filter's entries by default, as it was in previous versions of the script. Currently you have to click either the 'Actions' or the 'Repositories' title, for its content to populate. I would definitely prefer the previous behavior. Maybe, also make it so that a second click on any of the titles (Actions/Repositories/'News feed filter') to cause the filters content to collapse. And if there's a filter remains active, to make the parent title (Actions/Repositories) bold, as a visual reminder.



Thank you

jerone commented 6 years ago

Hi @darkred, I'm actually not using this userscript anymore as it's not compatible with Refined GitHub extension. I do accept a PR, if you are willing to fix the issue.

darkred commented 6 years ago

I do accept a PR, if you are willing to fix the issue.

Gladly, here: https://github.com/jerone/UserScripts/pull/126 (With my PR the script works with out errors again and displays the filter's entries by default, like before - I wrongly thought in my OP that it was done by you by choice)

I love your script, it's one of my most favorites for GitHub! 👍

darkred commented 6 years ago

Hey @jerone

First of all, I was informed [1] that if I add hide-useless-newsfeed-events in Refined GitHub's Options|'features to disable' then no entries in dashboard are hidden by the extension anymore, i.e. there's no conflict with your script anymore.

Also, after the recent GitHub layout update (repos and teams on the left with activity on the right, including issues you've commented on with recent activity, being on top). the script stopped working again, and that's irrelevant to GitHub Refined.

By making the modifications below, I managed to make your script partially work again, i.e. at least to execute without errors (most of the subfilters work ok now).


I'm telling you all this, mostly in case you hadn't tried hide-useless-newsfeed-events, that would change your mind about start using your script again, and if yes, whether you would like to take a look in fixing the 3 remaining issues listed in the end (they are caused by the recent GitHub update - they are irrelevant to GitHub Refined).

I've been trying to fix these issues myself, but unfortunately it's proven too advanced for me so far..


The modification

By changing in line 275 'protip' to e.g. 'protip2':

none.classList.add('no-alerts', 'protip2');

and in line 277 the selector from '.tabnav' into '.js-details-container':

newsContainer.insertBefore(none, newsContainer.querySelector('.js-details-container').nextElementSibling);

the script executes without errors again, and the "No feed items for this filter. Please select another filter." for non-matching filters is displayed ok again.


The three issues left:

[1] https://github.com/sindresorhus/refined-github/issues/1336#issuecomment-390321708

jerone commented 6 years ago

Hi @darkred. If I disable Refined Github (or disable the hide-useless-newsfeed-events feature), the GitHub News Feed Filter userscript works as intended (except for the Users-tab). All the other issues I can't confirm. Do they still happen for you?

darkred commented 6 years ago

Yes, they all happen, even in a fresh Chrome 66/Firefox 60 profile with only latest Refined GitHub 18.5.19.1605 (with hide-useless-newsfeed-events), Tampermonkey 4.6 and your script 8.1.1 .

For reference, here is a current screenshot of my dashboard (it's a long/scrolling screenshot)

Now, please notice in my captures below (click to expand):

Capture 1: ![](https://user-images.githubusercontent.com/723651/40277699-61de0c78-5c2c-11e8-9b5b-3de3b38984d2.gif)
Capture 2: ![](https://user-images.githubusercontent.com/723651/40277774-5a61a03a-5c2d-11e8-8fc2-a71bc37a5037.gif)
darkred commented 6 years ago

Correction: the counter of 'Actions' tab|'Commits' works ok, I wrongly thought it counts commits, not groups of commits. Sorry about that. All other points still stand

jerone commented 6 years ago

Just pushed an update, which I hope will fix all your issues (for me it does)!

I say I hope, because I don't have those 4 pinned issues at the top like you have, so I can't test that.

darkred commented 6 years ago

Thank you very much !!! I really appreciate it! Great 👍

I also made PR #127 to fix the 'Actions' tab|'Wiki' being empty. 🙂

darkred commented 6 years ago

And, one last thing: there were some entries still missing in 'Repositories' tab|All repositories:

in the screenshot below, if you do the sum, it was 27 (not 30, as expected) :

screenshot: ![2018-05-20_155415](https://user-images.githubusercontent.com/723651/40279147-12624b90-5c46-11e8-9f4c-55b72e21b372.jpg)


The fault was the change I had made in the my initial PR for the selector in the alertRepo variable, so I restored it in my new PR as you initially had it.