#Smithereen update. Some frontend stuff this time. Performing actions without page reloads is important for UX, so I started implementing just that. Laid some groundwork for ajax actions. The first, and currently the only one is post deletion.
Friend requests are the logical next step because they are similar to post deletion in terms of networking. And then form submissions. Especially comment replies, those are so frustrating to post currently.
Chris the #cat
Also here's my favorite thing about TypeScript: .ts extension is also a media container.
Mastodon doesn't like images this large apparently. Anyway, here's how it looks in Telegram.
Another small #Smithereen update. I've added og: meta tags to profiles and posts because I became tired of there being no preview cards whenever I send someone a link to my instance. Now, for example, this post link should have a card here: https://friends.grishka.me/posts/6442
#Smithereen update! Image attachments. The UI currently looks fugly, but hey, it works for now at least. I'll make it prettier when I get to all this JS/AjaxLayout stuff, which is the next thing on my todo list anyway.
Took me too long because I participated in the Telegram developer contest, and also because it just takes so much thinking to figure out how to keep files in sync with the database. Hopefully I'll be able to reuse this code wherever I need image uploads.
Ой, смотрите-ка, ВК лежит)
Is this another weird "privacy" feature in Mastodon? The web profile is publicly accessible, but the corresponding #ActivityPub actor doesn't even have the "url" field that my code expects. The web profile contains a name, a profile picture, a cover image, 2 fields and a summary, but those are nowhere to be seen in the actor. Just... why?
#Smithereen update: mentions. They now actually work. There now are two kinds of mentions:
- The one that's inserted automatically when you reply to a comment (not a post), of the form "Name, " like in VK
- The one that you can type manually of the form @username@domain, or without the domain for local users
Here's how these look: https://friends.grishka.me/posts/4845
Also this is pretty dumb. Generics work by generating casts at compile time. An empty list is type-agnostic because it's empty and throws an exception when you try adding anything to it. Yet Idea shows this warning, implying there's something fundamentally wrong with your code.
I thought I knew everything about Java but... it turns out you are allowed to have a public field with matching name and type in a class and in its superclass. And which one is being used depends on the type of the variable you use to access the field. That's why my mentions had wrong URLs in them.
Another day, another flawed library. Found out the HTML sanitizer I use needlessly escapes too much, including emojis and @ signs. Had to implement an HTML writer (thankfully there's an interface exposed for that) that doesn't do any of this. Literally the only characters it touches are <, > and " (in attribute values), those do legitimately need escaping.