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

[Feature Request] Filter Labels #108

Closed
saxamaphone69 opened this issue Oct 5, 2024 · 8 comments
Closed

[Feature Request] Filter Labels #108

saxamaphone69 opened this issue Oct 5, 2024 · 8 comments
Labels
feature request New feature or request

Comments

@saxamaphone69
Copy link

A long-standing feature request of ccd0's 4chan X was to include filter labels, as in a reason why a post was triggered by a filter (either highlighting or hiding).

Mayhem had it in his version, but it never made it across.

I had tried (to the best of my ability, which is low) to "port" it over (as mentioned in this comment, which links to my original PR attempt and Mayhem's original 2014 commits) but failed.

@TuxedoTako
Copy link
Owner

You can kinda get this since 2.11, which started allowing both highlight and filter, and the stub gets the filter class, so you can do something like:

/bait/
/bait/;highlight:bait

and then in the custom CSS:

.bait .stub::after {
  content: " - bait";
}

Which will add that text after the stub: msedge_SYOFA8S87G

I should update the filters to allow both the highlight and hiding to use one check instead of duplicating it.

@TuxedoTako TuxedoTako added the feature request New feature or request label Oct 5, 2024
TuxedoTako added a commit that referenced this issue Oct 5, 2024
…cd0#126)

- You can now apply a hide and highlight on the same filter. The highlight class will apply to the stub.
@saxamaphone69
Copy link
Author

I pulled the latest, looking great so far. It looks like I was way off with my attempt...

image

@TuxedoTako
Copy link
Owner

Released in 2.15.0.

@saxamaphone69
Copy link
Author

Another big update, thank you Tako!

Can the reason also display for threads, too?

image

For stubbed threads with a subject, perhaps my old PR could be merged?

Speaking of stubs, the subject (if added), name, and filter reason(s) being wrapped in span would allow greater styling options.

<div class="stub">
<a class="show-reply-button" href="javascript:;"><span>➕︎</span> Anonymous (wow what &amp; Filtered comment /from/i)</a><a class="menu-button" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 320 512"><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z" fill="currentColor"></path></svg></a>
</div>

into

<div class="stub">
<a class="show-reply-button" href="javascript:;"><span>➕︎</span><span class="stub-subject">/wdg/<span><span class="stub-name">Anonymous</span><span class="stub-reasons">(<span class="stub-reason">wow what</span> &amp; <span class="stub-reason">Filtered comment /from/i</span>)</span></a><a class="menu-button" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 320 512"><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z" fill="currentColor"></path></svg></a>
</div>

The brackets and &'s could even be added with CSS instead (something like)

.stub-reasons::before { content: '('; }
.stub-reasons::after { content: ')'; }
.stub-reason:not(:last-of-type or maybe :last-child)::after { content: ' & '; }

I guess the other option to support is for reasons to be added to the menu, as opposed to inline or on hover. Perhaps like my poor PR attempt, it is a setting within the Menu section and it could override being displayed inline (off by default). Although, in saying that, if a post is highlight instead, the option would have to be in the menu, but only if Menu is enabled

image

I've chucked in a somewhat simple filter: /we/i;reason:wow what; and /from/i; and it results in a bunch of undefined classes:
image
the reasons still display:
image

@TuxedoTako
Copy link
Owner

Can the reason also display for threads, too?

I didn't know thread stubs use different code. It's in 2.15.1.

For stubbed threads with a subject, perhaps my old PR could be merged?

I recreated it. I can't merge pull requests made against the coffeescript version, because that would just lead to git conflicts.

Speaking of stubs, the subject (if added), name, and filter reason(s) being wrapped in span would allow greater styling options.

a bunch of undefined classes

Also in 2.15.1.

if a post is highlight instead, the option would have to be in the menu,

Do you really need the reason for highlighted posts? As I understand it, reasons in stubs are so you know why a post was hidden without having to unhide it.

@saxamaphone69
Copy link
Author

thread stubs different code

Mayhem had actually combined Reply and Thread logic around the same time as the Filter Labels.

recreated it

Thank you.

wrapping spans

I'll attempt a PR.

reason for highlighting

Nah, I agree it isn't needed. I just recall one commenter wanting reasons (hiding or highlighting) as an option in the menu.

Again, thank you Tako.

@saxamaphone69
Copy link
Author

@gir489returns

'Filter Reason' under 'Filtering'

image

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

No branches or pull requests

3 participants
@saxamaphone69 @TuxedoTako and others