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 regex filter back to firehose #2266

Merged

Conversation

Plastikmensch
Copy link

@Plastikmensch Plastikmensch commented Jul 3, 2023

The regex filter will apply to all tabs and not be automatically applied when pinned.
Not ideal, but it at least works.

The regex filter will apply to all tabs and not be automatically applied when pinned.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
@Plastikmensch Plastikmensch marked this pull request as ready for review July 3, 2023 01:20
@ClearlyClaire
Copy link

Thank you!
The following should allow it to be kept when pinning the column:

diff --git a/app/javascript/flavours/glitch/features/firehose/index.jsx b/app/javascript/flavours/glitch/features/firehose/index.jsx
index 02490a21bb..f778fbdbca 100644
--- a/app/javascript/flavours/glitch/features/firehose/index.jsx
+++ b/app/javascript/flavours/glitch/features/firehose/index.jsx
@@ -86,17 +86,17 @@ const Firehose = ({ feedType, multiColumn }) => {
     () => {
       switch(feedType) {
       case 'community':
-        dispatch(addColumn('COMMUNITY', { other: { onlyMedia } }));
+        dispatch(addColumn('COMMUNITY', { other: { onlyMedia }, regex: { body: regex } }));
         break;
       case 'public':
-        dispatch(addColumn('PUBLIC', { other: { onlyMedia, allowLocalOnly } }));
+        dispatch(addColumn('PUBLIC', { other: { onlyMedia, allowLocalOnly }, regex: { body: regex } }));
         break;
       case 'public:remote':
-        dispatch(addColumn('REMOTE', { other: { onlyMedia, onlyRemote: true } }));
+        dispatch(addColumn('REMOTE', { other: { onlyMedia, onlyRemote: true }, regex: { body: regex } }));
         break;
       }
     },
-    [dispatch, onlyMedia, feedType, allowLocalOnly],
+    [dispatch, onlyMedia, feedType, allowLocalOnly, regex],
   );
 
   const handleLoadMore = useCallback(

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
@Plastikmensch
Copy link
Author

Thank you! The following should allow it to be kept when pinning the column:

Indeed. Thank you!

@ClearlyClaire ClearlyClaire merged commit ed15893 into glitch-soc:main Jul 3, 2023
23 of 25 checks passed
neatchee added a commit to neatchee/mastodon that referenced this pull request Jul 3, 2023
* Remove the search button from UI header when logged out (mastodon#25631)

* Change account search to match by text when opted-in (mastodon#25599)

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>

* Fix ResolveURLService not resolving local URLs for remote content (mastodon#25637)

* Remove `pkg-config` gem dependency (mastodon#25615)

* Update Crowdin configuration file

* Fix onboarding prompt being displayed because of disconnection gaps (mastodon#25617)

* Use an Immutable Record as the root state (mastodon#25584)

* Add index to backups on `user_id` column (mastodon#25647)

* Fix rails `rewhere` deprecation warning in directories api controller (mastodon#25625)

* Remove unused routes (mastodon#25578)

* Fixing an issue with a missing argument (glitch-soc#2261)

undefined

* Update uri to version 0.12.2 (CVE fix) (mastodon#25657)

* Change local and federated timelines to be in a single firehose column (mastodon#25641)

* Fix HTTP 500 in `/api/v1/emails/check_confirmation` (mastodon#25595)

* Rails 7 update (mastodon#24241)

* Change dropdown icon above compose form from ellipsis to bars in web UI (mastodon#25661)

* Prevent duplicate concurrent calls of `/api/*/instance` in web UI (mastodon#25663)

* Revert "Rails 7 update" (mastodon#25667)

* [Glitch] Remove the search button from UI header when logged out

Port 285a691 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Fix onboarding prompt being displayed because of disconnection gaps

Port 9934949 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Use an Immutable Record as the root state

Port 78ba12f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Change local and federated timelines to be in a single firehose column

Port cea9db5 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Change dropdown icon above compose form from ellipsis to bars in web UI

Port 0512537 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Prevent duplicate concurrent calls of `/api/*/instance` in web UI

Port 5b46345 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* Show local-only posts in “All” by default, and add back option to toggle it

* Fix showing local only toots in "All" (glitch-soc#2265)

* Fix warnings about missing dependency in hooks

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

* Add `allowLocalOnly` to timelineId

Without this local-only toots will never be loaded.

feedType is checked to be public to not show local-only toots in the "Remote" tab.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

---------

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

* Add regex filter back to firehose (glitch-soc#2266)

* Add regex filter back to firehose

The regex filter will apply to all tabs and not be automatically applied when pinned.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

* Keep regex when pinned

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

---------

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

---------

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: jsgoldstein <jakegoldstein95@gmail.com>
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
Co-authored-by: Matt Jankowski <matt@jankowski.online>
Co-authored-by: Vivianne <puttabutta@gmail.com>
Co-authored-by: Daniel M Brasil <danielmbrasil@protonmail.com>
Co-authored-by: mogaminsk <mgmnjp@icloud.com>
Co-authored-by: Plastikmensch <Plastikmensch@users.noreply.github.com>
@Plastikmensch
Copy link
Author

One thing I didn't account for is that it will reset any regex that was set in the public/local timeline :/

@ClearlyClaire
Copy link

How so?

@Plastikmensch
Copy link
Author

Plastikmensch commented Jul 3, 2023

The firehose column reads settings from firehose, but the regex for these columns was saved in public and community.
So after merging the latest changes when opening the firehose column the regex will be empty.
I don't know if that's also the case when the federated or local timeline was pinned before.

@ClearlyClaire
Copy link

The firehose column reads settings from firehose, but the regex for these columns was saved in public and community.
So after merging the latest changes when opening the firehose column the regex will be empty.

Ah, you're right. Maybe it would make sense to use public and community values depending on the selected tab? Though that's pretty awkward.

I don't know if that's also the case when the federated or local timeline was pinned before.

No, that isn't overridden.

@Plastikmensch
Copy link
Author

Ah, you're right. Maybe it would make sense to use public and community values depending on the selected tab? Though that's pretty awkward.

That would be awkward indeed. Especially since the column settings are shared across tabs.

I don't know if that's also the case when the federated or local timeline was pinned before.

No, that isn't overridden.

Ah, that's good to know. Thanks

hibiyasleep added a commit to Idyllshire/mastodon that referenced this pull request Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants