this post was submitted on 09 Jul 2025
54 points (100.0% liked)

hexbear

10446 readers
2 users here now

Hexbear Proposals chapo.chat matrix room.

This will be a place for site proposals and discussion before implementation on the site.
Every proposal will also be mirrored into a pinned post on the hexbear community.

Any other ideas for helping to integrate the two spaces are welcome to be commented here or messaged to me directly.

Within Hexbear Proposals you can see the history of all site proposals and react to them, indicating a vote for or against a proposal.

Sending messages will be restricted to verified and active hexbear accounts older than 1 month with their matrix id in their hexbear user profile.

All top level messages within the channel must be a Proposals (idea for changing the site), Feedback (regarding non-technical aspects of the site, for technical please use https://hexbear.net/c/feedback), or Appeals (regarding admin/moderator actions).

Discussion regarding these will be within nested threads under the post.

To gain matrix verification, all you need to do is navigate to my hexbear userprofile and click the send a secure private message including your hexbear username.

founded 4 years ago
MODERATORS
 

I do not enjoy seeing ignoramuses' several-paragraph-long rants about "tankies" when checking the front page. Ideally, it would be possible to disable only that type of tagline, while leaving other taglines be.

I don't know if other people have already proposed this — I can't imagine I'm alone in feeling this way, but I also can't easily find anyone else who's made this suggestion.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 5 points 4 days ago (1 children)

Since you've worked on the site before, maybe you can point me in the right direction:

The function that actually creates the tagline (replacing CURRENT_YEAR, MOSCOW_TIME, and so on) seems to be hexbear_setupTagline, which is fed a random tagline from the taglines array):

Code block

return a.state.tagline = a.hexbear_setupTagline(
  null == (
    tagline = 0 === (
      taglineList = null != (r = null == (i = a.state) || null == (i = i.siteRes) ? void 0 : i.taglines) ? r : []
    ).length ? void 0 : taglineList.at(Math.floor(Math.random() * taglineList.length))
  ) ? void 0 : tagline.content
)
n.hexbear_setupTagline = function (e) {
  return e.replace(
    '<MOSCOW_TIME>',
    (
      o = new Date,
      r = o.getTime() + 60000 * o.getTimezoneOffset(),
      new Date(r + 10800000).toLocaleString().split(', ') [1]
    )
  ).replace(
    '<CURRENT_USER>',
    null != (
      t = null == (n = Nr.Instance) ||
      null == (n = n.myUserInfo) ? void 0 : n.local_user_view.person.name
    ) ? t : 'Someone'
  ).replace('<CURRENT_YEAR>', (new Date).getFullYear().toString()).replace(
    /<RANDOM:(\d+):(\d+)>/,
    (
      function (e, t, n) {
        return '' + (o = t, r = n, Math.random() * (r - o + 1) | 0);
        var o,
        r
      }
    )
  );
  var t,
  n,
  o,
  r
}

It's not necessary to understand this particular snippet, but I was wondering where the corresponding non-obfuscated code can be found (if it's publicly available). I checked the Hexbear GitHub but couldn't find it in the JS client repository or anywhere else, which seemed odd. Is its absence related to this open issue?

Not that it matters, but if you do end up playing around with any of this logic, you could replace the fiddly time math with the more elegant code used for the sidebar clock (to be fair to whoever wrote said fiddly math, the features used literally hadn't been implemented in Firefox yet when the site was born):

var date = new Date;
var moscowTime = Intl.DateTimeFormat(
  void 0,
  {
    timeZone: 'Europe/Moscow',
    timeStyle: 'medium',
  }
).format(date.getTime());

Thank you for your service (which, if I understand the changelog correctly, includes upstreaming taglines and custom emotes)! Open source development can be thankless work at times, but I appreciate the effort everyone puts in to keep this site running, rat-salute

[–] [email protected] 3 points 4 days ago (1 children)

It's in the lemmy-ui repo, on hexbear branch

[–] [email protected] 2 points 3 days ago

TIL that GitHub search only indexes the main branch! Didn't need it this time because you told me what branch to look in, but now I know how to efficiently search across branches for future reference thanks to this StackOverflow post; for instance, I could have found the file I was looking for using the following command

# Search all files and folders in all remote branches
git branch -r | awk '{print $NF}' \
    | xargs -P "$(nproc)" -I {} git --no-pager grep -n 'setupTagline' {}

Here's the relevant file, if anyone's curious:

https://github.com/hexbear-collective/lemmy-ui/blob/0ad34285aa653fc438af475afc927f48b2032612/src/shared/components/home/home.tsx#L1124-L1133