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

Hide trending where not supported and update compatibility table #768

Closed
wants to merge 6 commits into from

Conversation

Steffo99
Copy link
Contributor

pleroma and akkoma don't support Trending, perhaps by development philosophy.

This pull request allows hiding the option from the menu for accounts on such instances, and additionally does the same with the Filter option.

@@ -9,12 +9,13 @@ const containPixelfed = /pixelfed/i;
const notContainPixelfed = /^(?!.*pixelfed).*$/i;
const containPleroma = /pleroma/i;
const containAkkoma = /akkoma/i;
const notContainPixelfedAkkomaPleroma = /^(?!.*pixelfed|.*akkoma|.*pleroma).*$/i;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂 I think, as this is becoming more complex, (simple, negated?) regex check is no longer feasible. Best way is for the check to accept a function. Maybe like:

'@mastodon/trending-hashtags': (version) => !containPixelfed.test(version) && !containPleroma.test(version) && !containAkkoma.test(version)

I initially added notContainPixelfed because I was lazy and didn't expect to add more conditions 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that sounds like the wiser decision lol

@cheeaun cheeaun added enhancement New feature or request pleroma akkoma labels Sep 10, 2024
return (supportsCache[key] = platformFeatures[feature].test(version));

const platformFeature = platformFeatures[feature];
if (platformFeature instanceof Function) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer typeof platformFeature === 'function'

if (platformFeature instanceof Function) {
return (supportsCache[key] = platformFeature(version));
}
else if(platformFeature !== undefined) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like prettier didn't run here 🙈 Should be } else if () {

@graue
Copy link
Contributor

graue commented Sep 21, 2024

GoToSocial also doesn't support trending links or trending hashtags so it might be added to this PR.

Alternatively, is there any server software other than Mastodon and its forks (Glitch, Hometown) that does support Mastodon's trending links and trending hashtags API? Pixelfed, Pleroma, Akkoma and GTS all don't, so that seems about it.

I wonder if what's really wanted here is an explicit notion of "server is Mastodon." If so, that could be done by checking the software.name field of the NodeInfo, which my PR #817 would fetch. Every supported server type other than Mastodon specifies its name there.

This should allow access to the "Go to another server" menu option for now.
@Steffo99
Copy link
Contributor Author

Just realized that the "Go to another instance" button is available on the Trending page, so hiding it completely might not be a good idea...

Let's go back to the planning stage!

@Steffo99 Steffo99 closed this Sep 23, 2024
@Steffo99 Steffo99 deleted the feature/hide-trending branch October 11, 2024 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
akkoma enhancement New feature or request pleroma
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants