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

(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 opened this issue May 9, 2018 · 9 comments

Comments

@darkred
Copy link
Contributor

darkred commented May 9, 2018

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
Copy link
Owner

jerone commented May 9, 2018

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
Copy link
Contributor Author

darkred commented May 10, 2018

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

Gladly, here: #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
Copy link
Contributor Author

darkred commented May 19, 2018

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:

  • The global counters 'All news feed'. 'All repositories' and 'All users'
    all get the same (wrong) value of 'All news feed', e.g. 38 (38).
    The global counter 'All users' is 0
    Also, the 'Actions' tab|Commits counters, and the 'Repositories' tab counters values are all wrong.
  • The: 'Actions' tab|'User' filter always shows '0' (lists no usernames).
  • The 'Users' tab is empty (lists no usernames).

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

@jerone
Copy link
Owner

jerone commented May 20, 2018

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
Copy link
Contributor Author

darkred commented May 20, 2018

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):

  • as I switch tabs, the 'Actions' tab|'All news feed' counter and the 'Repositories' tab|'All repositories' counter values are both wrongly 38.
    Also In 'Users' tab|Users, the global counter is 0 (and it's wrongly empty).
  • the counter of 'Actions' tab|'Commits' is wrong: it's not 7 (that's just the value of the 1st entry), it's actually 7+2+3+1+... (second capture) <--- and it immediately changes wrongly to 15
  • the 'Actions' tab|'User', the 'Actions' tab|'Wiki' and the 'Users' tab are all wrongly empty.
Capture 1:

Capture 2:

@darkred
Copy link
Contributor Author

darkred commented May 20, 2018

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
Copy link
Owner

jerone commented May 20, 2018

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
Copy link
Contributor Author

darkred commented May 20, 2018

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

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

@darkred
Copy link
Contributor Author

darkred commented May 20, 2018

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


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants