-
Notifications
You must be signed in to change notification settings - Fork 178
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
Port upstream's hashtag handling to glitch-soc #2386
Port upstream's hashtag handling to glitch-soc #2386
Conversation
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com> Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
import { getStatusContent } from './status_content'; | ||
|
||
// About two lines on desktop | ||
const VISIBLE_HASHTAGS = 7; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be an app setting or otherwise configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does seem like the type of thing that would be useful to have as a config option, yeah.
|
||
const revealedHashtags = expanded | ||
? hashtags | ||
: hashtags.slice(0, VISIBLE_HASHTAGS - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: hashtags.slice(0, VISIBLE_HASHTAGS - 1); | |
: hashtags.slice(0, VISIBLE_HASHTAGS); |
(Taken from: mastodon#26666)
Did a test toot with 10 different hashtags, only 6 were visible and the text said "and 3 more".
The above suggestion fixes that, so 7 hashtags, as configured, are visible. (I don't like the other changes in that PR)
I found a problem here This is how it looks from an instance without this patch and with this patch Maybe it's the swedish letters åäö causing this? |
I can't reproduce that with this PR. |
I am using this patch and glitch-soc is updated today and it works fine on all tags without swedish letters. And here another one with swedish letters in tagline then it doesn't work. |
https://mastodon.helvetet.eu/tags/shl And that patch you mentioned earlier is there.
|
Okay now I'm really confused (View from the link you shared): This makes me think this is a client-side issue. |
Nothing that should matter for Mastodon atleast. |
I tried with another webbrowser and it's same problem there. |
Whatever it is, it likely messes with the normalisation done by Mastodon.
Honestly, I have no idea. |
This is really strange. |
I have same problem on mastodon.social so i see same problem in vanilla Mastodon and not only my instance. |
It is indeed strange. Can you try the following patch and see if that fixes it? diff --git a/app/javascript/flavours/glitch/components/hashtag_bar.tsx b/app/javascript/flavours/glitch/components/hashtag_bar.tsx
index 674c481b8..f50be8a36 100644
--- a/app/javascript/flavours/glitch/components/hashtag_bar.tsx
+++ b/app/javascript/flavours/glitch/components/hashtag_bar.tsx
@@ -71,7 +71,7 @@ function uniqueHashtagsWithCaseHandling(hashtags: string[]) {
}
// Create the collator once, this is much more efficient
-const collator = new Intl.Collator(undefined, {
+const collator = new Intl.Collator('en', {
sensitivity: 'base', // we use this to emulate the ASCII folding done on the server-side, hopefuly more efficiently
}); |
Ok that seems to help. https://mastodon.helvetet.eu/@Anders_S@mastodon.nu/110094029130047998 |
The hashtag bar is only supposed to appear when the last line of a toot only contains hashtags, so a link after hashtags would prevent that. |
Edit: Oh wait, that link redirected me directly to the original instance, whoops. |
I don't see the logic in that. |
Hmm in this example hashtags are after the link and still not moving it. https://mastodon.helvetet.eu/@kallekn@mastodonsweden.se/110954671967626898 |
Ah, that's because there is no empty line between the link and hashtags, so
would create the hashtag bar, but
will not. |
Nevermind i understand now. |
…oc/merge-upstream
9b958a7
to
6b7c473
Compare
Oops, messed up the branch, I will re-open with its proper branch, sorry. |
Fixes #2381
Ported changes
Skipped changes
Additional changes