#crystallang 75 hashtags

Todd Sundsted

I've streamlined theme development in Ktistec. The theming system uses a hierarchy of CSS custom properties and fallbacks. Theme authors can customize a theme at multiple levels:

Base Colors Only

Define only base colors like --text-primary, --bg-primary, --bg-input, --semantic-primary, etc. Derived colors will auto-generate using color-mix formulas. For example:

:root { --semantic-primary: #ffa500; }

From this one line, theme-appropriate colors like --bg-accent-code, --anchor-color, etc. auto-generate.

Base Colors Plus Derived Colors

Define base colors and derived colors. Derived colors use custom values when defined. Undefined derived colors auto-generate. For example:

:root {
    --text-primary: #333;
    --text-primary-2: #ff0000;  /* red for this specific shade */
}

Given this theme, derived shades like --text-primary-1, --text-primary-3, and --text-primary-4 auto-generate. --text-primary-2 is red.

The simplest possible interesting theme redefines the primary semantic color. The single line above (in Base Colors Only) would result in the following, with button color, link color, disabled, selected, and hover states all derived automatically:

screenshot of the setting page with the primary semantic color defined

These changes will be in the upcoming release. Existing themes will continue to work, as is.

#ktistec #crystallang #activitypub #fediverse

Todd Sundsted
Release v3.2.1 of Ktistec

Release v3.2.1 of Ktistec adds support for bookmarking posts. This was so immediately useful I don't know why it took me so long to get around to it!

Pinned/featured posts are in the works for the next release.

The full changelog:

Added

  • Support for bookmarking posts.

Fixed

  • Invalidate user's sessions after changing password.
  • Ignore supplied languages that don't conform to expected format.

Changed

  • Upgrade Kemal.

In other thoughts... I'd like to make followed hashtags more consumable. I follow ~10 hashtags and: 1) it's hard to tell what's new, 2) it feels like they arrive in large batches that are difficult to digest, and 3) the reading experience is meh.

#ktistec #fediverse #activitypub #crystallang

Todd Sundsted

no #ktistec release this week. i have been working on bookmarked posts, pinned/featured posts, as well as some minor performance improvements, but i need to spend time fixing an issue with my libxml extensions that is preventing me from moving to the latest release of #crystallang. i've been putting it off but it's gotta get done, so...

Todd Sundsted
Release v3.2.0 of Ktistec

The major feature in v3.2.0 of Ktistec is thread analysis. The previous release, v3.1.2, added support for viewing threads from Lemmy communities. I follow the Open Source community, which leads to many large threads. The thread on FFMpeg and Google has 112 posts and is still growing.

Thread analysis helps me navigate these extensive conversations. It includes: top contributors, a timeline histogram, and notable branches.

The analysis applies several heuristics to identify interesting branches of the main thread. “Interesting” is subjective, but the algorithm currently looks for sudden bursts of activity and highlights those areas. Ktistec uses this to create a table of contents that links directly to those branches. Clicking on one of these links takes you to a branch-only view that focuses on the selected part of the thread.

It's fast—I anticipated needing to cache analyses, but analyzing a thread with over 400 posts takes only about 50 milliseconds on my production server.

Figure 1: Screenshot of the final design. Notable branches link to subsets of the thread.

This release also addresses an object visibility regression that was introduced in a previous version.

Full Changelog

Added

  • Thread analysis that displays key participants, a timeline histogram, and notable branches
  • New MCP tools: analyze_thread and get_thread
  • Focal point rendering support for image attachments

Fixed

  • Regression in object visibility affecting replies to threads

Changed

  • Enhanced MCP tool details for likes, dislikes, and announces
  • Improved cookie security.

#ktistec #fediverse #activitypub #crystallang

Todd Sundsted

@alexanderadam works!

macro ✂️(str, n)
  {{str}}.size > {{n}} ? {{str}}[0, {{n}} - 1] + "…" : {{str}}
end
 puts ✂️ "hello, world!", 3  # => "he…"

https://play.crystal-lang.org/#/r/iecr

#crystallang

Todd Sundsted

TIL

The (the Unicode ellipsis character) works as both a Crystal Language macro and method name, as in:

macro …(str, n)
  Ktistec::Util.render_as_text_and_truncate({{str}}, {{n}})
end

Which can be used in a view template as:

= … preview, 120

I'm not saying you should. I'm saying you can.

#crystallang #til

Todd Sundsted
Release v3.1.3 of Ktistec

There are two big features in release v3.1.3 of Ktistec: auto-approve followers and a new image viewer.

Auto-approve followers is conceptually simple ("the server automatically sends an Accept activity when it receives a Follow activity") but it required extensive changes to some of the oldest code in the codebase: the inboxes and outboxes controllers. I refactored inbox and outbox side-effect processing into independent services, which made it possible to support side-effects like auto-approve follow (and also auto-follow back), without having to go through the controllers.

A more significant change for me personally was replacing the lightGallery image gallery (an external dependency) with my own implementation. It's not as slick, and not as full of features—I wrote it in two days—but it is fully free software, and that's important to me.

Added

  • Add admin page for managing OAuth access tokens.
  • Add support for auto-approve followers. (fixes #26)
  • Add support for auto-follow back.

Fixed

  • Prevent triggering actor refresh when user is anonymous.

Changed

  • Replace "lightgallery" dependency with custom image viewer.
  • Set OAuth access token expiry to 30 days (previously expired after 24 hours).
  • Refactor inbox and outbox processing into dedicated processor services.

The OAuth changes set the groundwork for better support of the Mastodon API and the Fediverse clients that depend on it. Stay tuned!

#ktistec #fediverse #activitypub #crystallang

Todd Sundsted
Release v3.1.2 of Ktistec

I'm working on federation issues.

👻 Release v3.1.2 of Ktistec improves support for Lemmy and community servers like it that distribute content by wrapping it in Announce activities (FEP-1b12: Group federation support). Ktistec also supports the audience property, although support for that was removed from Lemmy earlier this year.

🎃 This release also adds support for delivering to shared inboxes, which are widely supported by other ActivityPub servers. Despite being federated, the Fediverse is not highly distributed, and this optimization can reduce outbound delivery traffic by 10-20x.

Added

  • Support for the Dislike activity.
  • Support for the audience property on activities and objects.
  • Support for delivery to shared inboxes.
  • Support for full-width hash signs in hashtags (e.g. #日本語) commonly used in Japanese and other Asian languages.

Fixed

  • Strip HTML from object summaries rather than escaping it.
  • Properly unwrap Lemmy-style Announce activities.

Changed

  • Destroy discarded drafts instead of deleting them.

Enjoy!

#ktistec #fediverse #activitypub #crystallang

Todd Sundsted
Release v3.1.1 of Ktistec

Vacations are wonderful. It is a privilege to be able to travel without worry. It's also wonderful to be home, and to have the time to work on projects I care about. With those thoughts in mind, I present release v3.1.1 of Ktistec, an ActivityPub server written in the Crystal programming language!

This release is a mixed bag of small features and improvements:

Added

  • Auto-link URLs in posts. (fixes #24)
  • Support searching by actor username. (fixes #102)
  • Support hourly granularity in metrics charts.

Fixed

  • Mark actor as down if refresh fails.
  • Remove draft posts from the everything collection.
  • Ignore charts with no points in the date range.
  • Ensure HTTP::Client instances are closed.

I added support for multiple users at the beginning of the month. I'm very interested in feedback on how that's working out for anyone using it.

#ktistec #fediverse #activitypub #crystallang

Todd SundstedCrystalLanguage
20k stars badge

We're reaching for the stars! 🚀✨
Just as 1.18 is released, over 20k users have starred the Crystal repo on GitHub 🌟

github.com/crystal-lang/crystal

#crystallang #achievement #github