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

Add style exclusions. Closes #113 #360

Closed
wants to merge 205 commits into from
Closed

Add style exclusions. Closes #113 #360

wants to merge 205 commits into from

Conversation

Mottie
Copy link
Member

@Mottie Mottie commented Mar 5, 2018

  • Popup: Right click on a style's check box to open exclusions menu for a page.
  • Manage page: "Excluded on: ..." added to "Applies to" column (in both old and new UI).
  • Edit page: Excluded Pages section added to side bar.

@JourneyOver
Copy link

JourneyOver commented Mar 6, 2018

So far this looks pretty nice :D

one bug I've run into so far though is that if I an exclusion through the edit style page and then go and add one through the popup menu it goes and deletes any excluded sites I had added through the edit style page.

Edit: Well since we found out this "small bug" was actually just me forgetting to save after adding excludes from the edit page guess that's that xD

@Mottie
Copy link
Member Author

Mottie commented Mar 6, 2018

The popup menu select should highlight an option if it's already in the exclusion list. If you remove it in the popup, it also removes it from the exclusion list.

For example, if you right click the checkbox on google.com, you should see select options with "Domain: google.com", "Domain: www.google.com" and "Prefix: https://www.google.com". If you already have "google.com" in the list, it should be highlighted. If you remove it from the select, it'll remove it from the exclusion list. You can also select multiple options; I know this will add duplicates, but you can change them from the edit page for more fine-tuning.

@Mottie
Copy link
Member Author

Mottie commented Mar 6, 2018

Solved in chat: Make sure to save any exclusions you add from the edit page, they don't automatically save with the style.

@JourneyOver
Copy link

Will remember that for now on haha :P

@tophf
Copy link
Member

tophf commented Mar 8, 2018

Popup:

  • The modal in the popup is too big, it also has big margins. I think it should be similar to the confirmation on deleting a style. No need to show the style name, you can highlight it somehow in the list e.g. by adding a class like selected or highlighted which has a border or an underline.
  • Edit excluded page(s) is misleading: I would expect being able to actually edit the value. Exclude the site or page maybe.

Editor:

  • Excluded Pages: N sites title contradicts itself: sites or pages? I think we can strip the extra word by using an additional i18n message with a placeholder: Excluded $num$ pages. The number won't be highlighted.
  • When there are exclusions the section should probably always expand on opening the editor, conversely when there are none it should always be collapsed on opening the editor.
  • No exclusions shouldn't have a border because it's not an element. Arguably, there's no need to display any text at all.
  • Add excluded page should just add a new input box in the list and position the caret there, no popups.
  • An x icon to the right of each entry to delete it would be more convenient and obvious.
  • Editing should be possible via click on an entry. Entries should be input elements for that.
  • Not sure why regexp isn't supported, I think it should be, for example using the /re/ notation.
  • I can't exclude *://*.google.co*/*foo* - the asterisk should be handled in any place.
  • In addition to the info icon with its lengthy explanation it'd be nice to have a one line example right next to the now single Add button e.g. *://*.google.co*/*foo*

@JourneyOver
Copy link

This still being worked on? Would love to see this get implemented into the stylus fully..

@Mottie
Copy link
Member Author

Mottie commented Apr 14, 2018

Yeah, I am... on and off (prepping a baby room 👶). I ended up almost totally rewriting it and I still have one more issue to work out before I update this PR.

@JourneyOver
Copy link

Ahh sounds fun :p and glad this is still being worked on. Can't wait for this to get into the actual releases of stylus as so far I've just been running the latest releases while adding in the exclusion branch stuff myself to stay up to date but having to manually do it get's tedious after a while.

@Mottie
Copy link
Member Author

Mottie commented Apr 19, 2018

Still not working yet... I wanted to push the current changes here because my hard drive has been acting flaky.

Last issue I need to address (that I remember) is getting the popup to update all tabs after adding/removing exclusions; the database gets updated, just not the active tabs.

And @JourneyOver, since you've been using this branch, you'll need to go through each style that has an exclusion and edit a single entry to get it to save the modified regular expression. Previously, if you added b.c as an exclusion, it would include github.com! Now it includes breaks and the internal regexp for b.c becomes \bb.c\b.

@JourneyOver
Copy link

Got it! thanks for letting me know. :)

@JourneyOver
Copy link

JourneyOver commented Apr 22, 2018

Hmm seems something is broken between the latest commit 4a1c163 and the latest changes with this branch, right clicking the checkbox that opens the "Exclude the site or page" and clicking on one of the options and then pressing "ok" doesn't seem to add it to the excluded for the style. Doesn't seem to matter which option you choose from the menu.

Currently seems the only way to add excluded stuff for themes at the moment is having to go into the theme and add the exclusions manually.

Didn't find this issue until now since I haven't had to exclude any new sites from a theme until now and I manually fixed up exclusions in the themes I previously had exclusions in after I updated so I hadn't tested your new changes until now.

I know it was working just fine before, dunno if it was a commit in this branch or master branch that ended up breaking things.

Another thing I notice as well, opening and closing the "exclude the site or page" makes the stylus dropdown menu keep expanding down each time you open it until it gets to about this size

Screenshot

chrome_04-22-2018_01-27-10

and then it stops expanding.

@Mottie
Copy link
Member Author

Mottie commented Apr 25, 2018

Thanks @JourneyOver, I've fixed the expanding popup; but I've been having a lot of difficulty with getting the exclusions to update dynamically.

Previously, when it sorta worked, excluding a style would completely remove it from the list of styles in the popup. Now, the excluded style is visible & red; but updating it for all tabs is just not working. I think I'm going to need @tophf to look at the code and provide some suggestions.

@JourneyOver
Copy link

JourneyOver commented Apr 25, 2018

@Mottie it looks like whatever you did recently fixed the problem I had noted above about it not adding the exclusion when using the exclusion popup (it adds the exclusion to the exclusion list for the theme along with marking the theme red in the popup for said tabs with the excluded site now) though it seems to still be kinda iffy on it adding it or not. sometimes it'll be added and sometimes it won't.

This is the error that comes up when it decides that it doesn't want to add the exclusion to the site

Screenshot

chrome_04-25-2018_17-46-24

--

and I can confirm that the expanding popup thing is fixed now as well.

@JourneyOver
Copy link

@Mottie looks like the error is now fixed and seems to be adding any and all exclusions through the popup that I have thrown at it so far testing on various themes/sites ^^

@Mottie
Copy link
Member Author

Mottie commented Apr 25, 2018

It's not working for me if you add or remove an exclusion... I mean, the exclusion isn't being added or removed from the active or other browser tabs.

@JourneyOver
Copy link

JourneyOver commented Apr 25, 2018

Hmm it is for me O_o I'm running latest master commit and merging in the commits from this branch/pull request, dunno if that makes a difference or not.

unless your talking about making the style disappearing from the stylus popup on tha tab/other tabs for the excluded? for me it just turns red when it gets excluded.

@JourneyOver
Copy link

Please tell me this hasn't been forgotten about and is still being worked on.. So waiting for this to be included in stylus by default :s

@Mottie
Copy link
Member Author

Mottie commented Jun 9, 2018

It's not forgotten, but it is on the back-burner... I haven't had much time to mess with the branch.

@Mottie
Copy link
Member Author

Mottie commented Jul 15, 2018

@JourneyOver Please test the latest updates.

@JourneyOver
Copy link

JourneyOver commented Jul 15, 2018

Glad to see new updates to this :D


Bugs:

  1. After adding a site exclusion to a theme it seems to make toolbar icon stop showing the number of active themes for said site. Example -- https://i.imgur.com/4TIzOXq.png I have 1 active theme for the site still, but the icon is showing as if there are none. Refreshing does not seem fix it.

Going in removing exclusion and re-adding it seems to somewhat fix the toolbar icon, it stills end up being greyed out but it shows the active styles number as well. Example -- https://i.imgur.com/VoHismF.png refreshing the page brings back the color to the icon completely.

  1. Going into a style and adding an exclusion manually instead of going to site and doing it through the dropdown, while adding the site through the excluded it will randomly stop focusing in the text box area so you'll have to refocus multiple times if the url is going to be long.

  2. Sometimes a style with a site excluded will just randomly appear in the dropdown menu and sometimes it will disappear..

Example --
Install style https://userstyles.org/styles/142759/darkerr-a-darker-theme-for-sonarr-radarr
Add exclusion "trakt.tv" to style
Go to https://trakt.tv/home (theme will appear in the dropdown)
Go to https://trakt.tv/dashboard (theme will not appear in the dropdown)
(you'll need an account to view dashboard (but I'm sure there are other sites out there that could end up showing the same bug that doesn't require a sign up))

before it never appeared in the dropdown unless there was a sonarr or radarr in the url somewhere, but now for the most part is just shows up in the dropdown through the whole site for the most part if the site is in the excluded.

  1. Adding an exclusion and then removing said exclusion doesn't re-apply the theme to the site, refreshing the tab sometimes does not fix it, while sometimes it does fix it.

Those are at least a few of the bugs I've noticed in the latest update. If I run into anymore I will post them up.

@Mottie Mottie added this to Medium Priority in Priorities Nov 12, 2018
@Mottie Mottie moved this from Medium Priority to Que in Priorities Nov 12, 2018
@Mottie Mottie moved this from Que to High priority in Priorities Nov 19, 2018
@Mottie Mottie moved this from High priority to Que in Priorities Nov 20, 2018
@JourneyOver
Copy link

How are things going with this?

@JourneyOver
Copy link

JourneyOver commented Dec 28, 2018

@eight04 since #510 has been merged in from the looks of it, any idea when you might possibly get back to this? As there are now too many changes to master and this (and so many conflicts now as well) that I sadly can't go about just merging changes and continuing to use exclusions :/ so I am now stuck in the past on stylus versions as I kinda rely on exclusions for various styles atm.

@eight04
Copy link
Collaborator

eight04 commented Dec 28, 2018

We have to reimplement this on the current master (maybe after fixing all 1.5.x bugs). Also, @Mottie is designing a new style manager, so I guess we can first add the exclusion dialog to the popup and the editor.

@narcolepticinsomniac
Copy link
Member

narcolepticinsomniac commented Jan 27, 2019

where can I download this version of the extension, where do exceptions work.

Unfortunately, there is no working version of this PR currently. AFAIK, this PR hit a brick wall because some of the functionality was impossible to implement at the time. Pretty sure this PR was a big reason eight04 refactored the entire storage system.

We're still working out some of the kinks with that major update, and the dev who was working on this PR is currently busy with a different one when he has time to spare, but we all recognize that this is an important feature, so I'm confident that it'll happen eventually. Hopefully sooner than later.

@eight04
Copy link
Collaborator

eight04 commented Feb 11, 2019

Anyone still looking forward to this may take a look at #666.

@eight04 eight04 mentioned this pull request Feb 11, 2019
2 tasks
@Mottie Mottie closed this in #666 Mar 3, 2019
@eight04 eight04 deleted the exclusions branch March 9, 2019 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Priorities
  
Que
Development

Successfully merging this pull request may close these issues.

None yet

5 participants