Watchapp: Kagi News by James Downs

:smiling_face_with_three_hearts: Update alert!

:party: James Downs just released version 1.17 of Kagi News!

Go check it out!

Release notes

  • Added caching based on Batch ID to avoid unnecessary network requests
    • Network connectivity is still always required
  • Reduced app memory footprint
1 Like

As I inch ever closer to my dream of Aplite support, I was able to rip out 11K from the memory footprint of the app.

Aplite can now be built to, but since the app uses 23/24K, it immediately uses too much memory. The next goal is to bring the app size down to maybe 18K for Aplite and then drastically optimize the bridge between the phone and watch to ensure only the most minimal data is going over the bridge and remaining on the watch. This will require a better API than I’m using to request data from the phone on the chance the watch has decided to unload it from the back stack.

Also, max categories (including the Small Web feed) is now 20. I can’t imagine anyone wants more than 20 news categories at once. And the app started to break in interesting ways around 30. If someone sees this and uses more than 20 let me know.

2 Likes

:clap: Update alert!

:party: James Downs just released version 1.18 of Kagi News!

Go check it out!

Release notes

  • Updated action button to confirm to system and content size more accurately
1 Like

:confetti_ball: Update alert!

:party: James Downs just released version 1.19 of Kagi News!

Go check it out!

Release notes

  • Critical fix: Fix endpoint that queries latest batch ID, allowing app to work again
1 Like

Kagi News generates a press summary ā€œdaily at 12 UTCā€ but that fact is non-deterministic. While they attempt to so, the time at which it completes, or if it happens at all, is not set in stone.

What happens then is, the /api/batches endpoint, which defaults to showing you batches in the last 24 hours, is an empty array, which is why this issue happened. While I was testing, this endpoint always had a batch, and it was just by circumstance that the very next day, the batch time was missed. I require a success state on this endpoint (meaning just having data) to continue as even though there is a cache now, the app really wants Kagi News to up to present anything and avoid having to manage half-cached state.

I switched to using the /api/batches/latest endpoint instead which just always gives me back the latest batch (any batch ID can be used) regardless of how out of date it is. This was probably always the right answer and I was just using the other endpoint improperly.

At least this broke right away so I could catch it quickly.

2 Likes

:heart: Update alert!

:party: James Downs just released version 1.20 of Kagi News!

Go check it out!

Release notes

  • Sort stories by unique article domain / publisher count, descending
1 Like

:smiling_face_with_three_hearts: Update alert!

:party: James Downs just released version 1.21 of Kagi News!

Go check it out!

Release notes

  • Update available category list
  • Support requesting all LTR languages for content
  • Follow watch language when Default is selected for interface language
  • Invalidate network cache when the app version changes
1 Like

This started out with me just updating how I am dealing with message keys by auto generating them from some weird script and then I realized I probably should update the categories which I haven’t done in a while.

  1. Categories that no longer exist have been removed. Categories that are new are now added. I still look forward to a future where I can get all of this including the localization of the category names from the API, but that won’t be until at least the next update.

  2. I also just added all the LTR languages that Kagi’s content supports. I did not go ahead and add these to interface languages, but I’m not going to restrict someone that wants to read the content in one of those languages from doing so just because I haven’t localized the static strings yet. Hopefully full localization will come when I start requesting this stuff from the API, but I don’t think that’s my main priority yet versus just not having to do these updates going forward.

  3. I wasn’t pulling the system language correctly at all. I erroneously thought I could pull the phone language with navigator in the PKJS client but that is not how that works. Instead I am just checking Pebble.getActiveWatchInfo() for the language if I can and using that for interface strings. Content isn’t impacted because that just uses the original language of the content when default is set.

That plus a few other things this time. Like I said above, hopefully the next update is one that will mean I don’t have to push these updates for categories anymore since it’ll get retrieved at start up.

2 Likes

:partying_face: Update alert!

:party: James Downs just released version 1.22 of Kagi News!

Go check it out!

Release notes

  • Add Tension Index display when index is over 50
    • This can be toggled off in Settings
  • Associate app messages to a session ID to prevent receiving messages from stale sessions
  • Fix crash when reading read stories into array after app crash
1 Like

I have had to re-implement a lot of stuff that I would normally get for free from the OS features for this.

To get Tension Index working the way I wanted I had to:

  • Re-implement StatusBarLayer using two TextLayers as a hack. One is the background and one has the actual text so I can push the text to the bottom of the view
    • I could not use the builtin one because I could not figure out how to change the text on it (you can’t?). Mine at least is ContentSize API aware AND supported Gabbro scaling appropriately so that’s a one up
  • To make it so you can press up on the top item in the Categories MenuLayer, I needed to stop using the menu layer click config and had to re-implement selecting next or last item in the menu with regular window click providers

These two are among having to handle drawing the text manually to deal with up to 4 lines and scaled text among a lot of other things. I stray further and further from something that my brain is keeping track of.

Overall, this was a bit of a hacky change to try to bypass some of my view hierarchies to support a pseudo-category TensionIndex. I will look at making this more robust in the future.

Additionally:

  • Fixed a weird startup crash I don’t understand but did fix
  • Added a session ID to app messages to prevent the watch from receiving app messages from the phone if the session does not match
  • I have the branch to pull categories from the API instead of hardcoding them too! So hopefully once I figured out localization of that process it’ll be good-to-go!
1 Like

:partying_face: Update alert!

:party: James Downs just released version 1.23 of Kagi News!

Go check it out!

Release notes

  • Fix start up crashes when configuration changes