💾 Archived View for josipantolis.from.hr › gemlog › devlog-03-its-on-github.gmi captured on 2023-07-22 at 16:40:42. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-03)

-=-=-=-=-=-=-

Devlog 03: it's on GitHub

Published on: 2021-06-12

I've made good progress! As mentioned in my previous devlog¹, my first order of business was refactoring original code and adding test coverage. I completely rewrote my URI handling and solved the issue with streaming based rendering. Special thanks to Ecmel² for sharing his Moonlander³⁴ client code with me! As for new features I implemented browsing history, GSettings state persistence, (very basic!) image rendering and integrated with elementary OS' dark mode. Lastly, I published the code over on GitHub⁵. There are no releases or built packages there yet, but you can look at the code and compile it yourself if you wish.

1: Starfish devlog 02

2: Ecmel's Gemini pod

3: Rust version of Moonlander (GtK Gemini client)

4: Work in progress Vala port of Moonlander

5: Starfish GitHub repo

URI refactor

For URI parsing I initially tried to "home-brew" a regex parser and "just wing" the handling of relative URIs. Suffice it to say final product was not ideal. So I went back to the RFC 3986¹ spec referenced in the Gemini protocol itself. To my surprise this document was actually relatively easy to read and contained some really cool resources! Namely proper regex for URI parsing and a bunch of corner case examples that I could use for my tests.

Plus I found a pod² by Chris Vittal which hosts all IETF RFCs right here on Gemini space! Cool stuff.

1: RFC 3986 Uniform Resource Identifier (URI): Generic Syntax

2: Chris Vittal's Geminispace (with list of IETF RFCs)

Testing

I have a feeling my tests are crap 💩️, but I guess that's ok 😅️. All I did was take the stuff from a test sample page¹ on Vala documentation and hooked it up to meson. I wrote the actual tests for core logic classes (like URI and Gemtext parsing). UI stuff is as of yet untested.

Oh, and I created a little section² on this Gempod with some pages that I can use for manual testing. It has some large gemtext files, some images, other file types, that sort of thing. It let me play around with some features, like checking that streaming actually works or that it can be stopped mid-load.

1: Unit tests in Vala sample page

2: My set of test gemini pages

New features

elementary OS integration

One of the core goals of the Starfish app is for it to feel native on the elementary OS platform. That informed the choice of GTK framework and Vala as a language. It also means I have the elementary developer docs¹ to help me along!

In particular I've hooked up Starfish to GSettings for storing the app state between runs. I may have gone overboard with this a bit, as I'm currently saving browsing history there too. More on this later. I also integrated with elementary's system wide dark mode and have exposed a font size setting to users to configure. All in all, I'm pretty pleased with how the app looks²³.

1: elementary OS' Developer Documentation

2: Starfish rendering this blog post

3: Same page, just in dark mode and with Dyslexia-friendly font

Browsing session

Biggest usability improvement was introduction of browsing history (back + forward). I implemented this through a session abstraction. I tried to make it so that multiple sessions could be open in parallel so that when I add tabs in the future each will keep its own session. We'll see how successful I was at this. For now there are no tabs, and there's only the default session. In addition to back and forward it also handles stuff like canceling a Gemini request partway through.

Smaller features

Lastly, I added some smaller features such as delegating non gemini URI links to the OS, very basic image rendering, Gemini user input, etc. Some of these will definitely need to be improved in the future, and there are still some missing stuff that I believe would be relatively easy to add but I haven't come around to.

Next steps

Imminent

For the next week or two I'd like to focus on wrapping up the initial beta release version and submitting it to the AppCenter. This will probably coincide with release of the second beta version of the elementary OS itself. (It might be a good idea to re-test the app against that version!) I've already created a GitHub repo¹ for the project, but there are still some things I'd like to do:

1: Starfish GitHub repo

Long term

I need to be careful not to get carried away by longer term planning. (I find myself particularly susceptible to that.) But I have a bunch of features I'd like to add after the initial beta is published but before the 1.0 release:

Plus all the unforeseen issues I'll encounter along the way! 😁️