Haiku native Matrix client development

Hey all!

I’m wanting to get familiar with the Haiku UI toolkit and overall development environment, so I was looking for project ideas.

Is there anything that y’all have been doing on Haiku you wish there was a native app for?

3 Likes

Use an existing Matrix chat libs and make a native GUI on top of it :wink:

3 Likes

sounds simple enough, I’ll give it a go

1 Like

I’m not really a big fan of any of the libraries available to me after looking around. Will probably end up rolling my own.

2 Likes

Well suddenly that is not a small project to get accustomed to the Application/Interface Kit anymore. Good luck with it anyhow :slightly_smiling_face:

2 Likes

Progress is being made - I have both the frontend and backend for logging in set up, just need to connect them together.

I apologize if the UI is bad - I don’t really know exactly what apps should look like yet so I’m kinda just giving it my best guess.

1 Like

That was surprisingly fast. Are you really coding or just providing a prompt for a LLM to do it for you?

1 Like

I am really coding! I’ve been doing C++ for a while now, and the documentation is fairly good, working forward from a template included with Genio. Bear in mind that all I’ve actually done is wrote a program that has a login UI and can make a username/password login request to Matrix so far. Nothing else.

I also have been working on this pretty much nonstop since I started, give or take 45 minutes for lunch.

7 Likes

Congrats then, impressive speed!

1 Like

Again, I really haven’t done very much, but I really appreciate it! This almost reminds me a little bit of Android app development, something I’m very familiar with. It was a bit of a shock at first, but now that I’ve gotten more familiar with it, the whole system makes a lot of sense.

I don’t want to constantly praise the Haiku team - I must already sound like a broken record - but I am seriously impressed with the work that’s been done throughout Haiku’s lifetime. This feels way better than any other system (most of which I gave up on because they’re no fun) for making deskop apps.

Excited to post more updates as they happen!

6 Likes

I I remember correctly, some of Be developers ended up in the initial Android team, so its API may be loosely inspired by the BeOS one? (No idea though as I never did Android dev).

Back on topic, once you have some code ready, count me in for alpha/beta testing!

1 Like

atleast androids binder is certainly inspired by it

3 Likes

No need to apologize! :smiley: Coding should be fun. If you want specific suggestions on what to improve you should show some UI code though ;) in this case the layout would be interesting, how you arrived there

Here for example a layout that aligns both text entry boxes above each other with the “Username” and “Password” strings right aligned could be an improvement.

I’m curious, are you using the libnetservices for this? and maybe the json kit? or curl and maybe some other json library?

1 Like

I probably should’ve used the Haiku libraries in hindsight (didn’t even know they existed), but currently I’m using Curl, libcpr, and then Nlohmann JSON, it’s just what I typically use. Fortunately I wrote things in such a way that it shouldn’t be too hard to port over.

And yes, that fix was planned (not officially, I didn’t put it in the TODO.md), and I saw in the docs how to do it, just haven’t gotten around to it because I figured it was unimportant compared to getting the app actually working. My frustration was moreso prompted by the fact that I am unfamiliar with the general “style” that Haiku and Be target, so I just threw a bunch of things in a layout and called it a day.

The layout (and how I arrived there) was inspired a bit by the Windows 2000 login panel. Of course, I have a ways to go before I get the look, but I thought that would be a fun relic. I may want to consider trying to match the BeOS/Haiku alert dialog. Just implemented those for the login screen errors (with some fun “poetry” for the captions).

In development news, I have gotten login fully functional, and fixed the API binding such that it will return the same type whether or not the request is a success, which should improve error handling. Next up on the agenda is understanding the rest of the Matrix API and how they want me to use it.

*with a big asterisk on login working; that being you can only log in with a username/password

I don’t know if it’s the right Haiku way, but I use a grid in my apps to keep fields and their labels aligned. Something like this (just an example).

Hope this helps.

2 Likes

That’s actually very helpful - thank you!

1 Like

i think you’re better off staying with curl and nlohmann json. Trying to reimplement http from scratch was a mistake. We should throw that library away and maybe write a C++ wrapper on top of curl if we really want something Haiku-specific for the simplest use cases.

2 Likes

I’m confused why you keep throwing the library “under the bus” so to speak. especially considering that nielx is written libnetservices2 and has asked for feedback there…

Sure, it may not be the best situation for webkit, where the requirements are super stingy because of idiotic server deploymnets that don’t care about the specifications… but atleast having a libary where all apps work the same is a huge benefit.

And as this is “just” an Api, nothing is stopping us from having a future netservices kit that uses curl or something else as apropriate (just as we are doing for the media kit with ffpmeg)

That I can’t just turn on network logging anymore since we switched webkit to curl is a huge loss imo. And our current logging mechanism has no replacement (with env vars I can filter in the sense that I set only the env vars I want, but for the current message passed one the displaying devconsole app has no filters, and changing it in webkit requires recompiles)

3 Likes

Howdy,

For what is worth, EmailViewsNeo uses libnetservices2, and it works well. I am no expert (at all), so I cannot give technical feedback.

But I do support the notion of giving priority whenever possible to the Haiku APIs rather than recommending the use of external libraries, especially when the API already exists. Putting the kit through its paces in real applications is what will help find out the bugs so that they can be addressed after all.

My thoughts were mostly along the lines of “the less HaikuDepot or pkgman have to pull in the better”. I’ll switch it over once everything works.