Download it on the app store

TL;DR: If you’ll download the app don’t forget to toggle the Safari switch in Settings

Motivation

I would often scroll HN, see something interesting but not open the link, by the time I got home from the office (remember offices?) it was from the top items. At the end of the day, I just wanted a way to go back in time at a specific hour or get a curated list of news items

Metalens daily HN digest email

This is how it all started, as a newsletter, with only one subscriber, me. For categorization I used natural language processing from GCP, news items would get categorized either by the site’s content or by HN comments, depends on what source gave a better confidence result. If the categories seem familiar it’s probably because Reddit probably uses the same API for its categorization.

Either way, it would only hit the mark for half of the items, the rest of the items needed some manual help, the language processing, and categorization part need a lot more work, I think that’s one reason why AI startups use people and sell it as an AI service, Intelligence as a Service?

The iOS app

A few months ago I decided to put my best efforts into an iOS client for HN, yes I know there are some good apps out there but they offer the same or fewer features than the HN website.

The almost “real-time” analytics I thought looks fun and even offers an insight into how an item/topic is doing overtime in comments and score activity.

I often use the granular time travel to back and read some pretty cool items I missed, it works fine for me, I’m more of a lurker, the comments I wanted to write are often already written by somebody else or the subject is way out of my domain of expertise.

Happy accidents

About the flame graph, on top it tracks score activity and on the bottom the conversation activity.

Flamy graphs!

But its appearance is a “bug”, I mean there should only be a max of 5 red dots, 3 yellow, 2 blue, per column in score activity. It’s the result of a series of little happy accidents made in a late-night engineering session. I looked at it the other day, I have no idea what I wrote, I’ll leave that part untouched, wrote some tests to make sure the output values were withing range, I’ll leave the magic undisturbed, plus it makes the flame graph look more “flamy”!

SwiftUI

Initially tried Swift UI, development was going so fast, “I will probably never go back to UIKit” I was thinking while clicking away, the prototyping phase went smooth. But SwiftUI it’s not ready for production yet, it makes some things trivial and some trivial things a pain in the ass.

  • Want to implement a pull to refresh feature, nope.
  • Want to find out how far has the user scrolled the list? nope.
  • The list goes on.

There are workarounds, but it felt like I was fighting SwiftUI. Also, the app at that stage had some bizarre bugs when items in a list would not have the correct height until you scrolled a pixel or two. Then the scrolling performance was not good, using UIKit and CoreAnimation reduced CPU time in half when scrolling the same items. I had to rewrite it all in good old UIKit.

App store review process

I got the same rejection reason as Matt Stanford with his Hacker News Zero app. The only way I could get it approved was by opening links in Safari app, while every other app seems to get away just fine by opening them in SFSafariViewController. I included a toggle switch in settings when enabled opens links in SFSafariViewController and this seems to satisfy the reviewer,

The more you think about it the less sense it makes. Why Apple even added SFSafariViewController and recommends it as the primary way to open external links, should it only be used for ToS and Privacy Policies?

Copyright infringement?

Then there was the inappropriate use of auto-renewing subscriptions, the reviewers were very insistent that I should use non-renewing subscription even after adding additional features to the Metalens Premium package. Ok, Apple, be it your way.

But after 6 reviews and 5 iterations, Metalens finally got approved. If you plan to install and use it definitely toggle on the “Use internal Safari browser” switch.

Upcoming features and improvements

The app is still not there yet in terms of features, there is a lot more work to be done, If you would like to support the development and prevent another forgotten HN client app zombie on the app store you should subscribe to Metalens Premium.

  • Add search, seems like a trivial thing to add with HN Search API
  • Add trends with Metamate
  • I would really like to improve the current “Curated Feed” section, rework categories and maybe use trends to its advantage, a lot to explore here.
  • Get notified when someone replies to your comments or submission.
  • Add one-time payment as an alternative to subscriptions.

The backend

Nothing special, Go + SQLite running in a VM on CGP with Cloudflare + CF Workers so I could take advantage of their network and cache in case the app gets a surge of requests, how optimistic of me.