Show HN: I developed a native macOS Hacker News client
github.com
github.com
I developed this b.c. I found that I didn’t like HN mixed with other work/school related tabs, and realized that a separate app would be great for me. I believe that apps should use the most native-like UI possible — especially Cocoa on macOS, so I aimed to be the most ‘Mac-assed’ HN client possible.
Unfortunately the current app is in fact pretty unpolished — it’s in a usable state, but there’s a lot of missing features that one would expect from a ‘full-featured’ HN client. Probably a bunch of unknown bugs as well :-(. I would very appreciate any suggestions on feature additions or simple bug reports. Thanks!
Unfortunately, I found that resources on Cocoa are very lacking, you have to search all day to get some trivial thing to do. The best resources you have would be WWDC videos and transcripts[0]. If the subject you’re looking for is older than a few years, the documentation archive[1] might have detailed, good documentation with concepts and sample code. Some more obscure features will require you search all day, find a few blog posts from ~10 years ago, and munge them enough to make something workable.
The best resource of all was the help of more experienced Cocoa devs – the AppKit Abusers Slack [2] was very helpful and pointed out problems when I had problems. Very grateful for them.
[1]: https://developer.apple.com/library/archive/navigation/
If you find yourself in a position of not wanting a specific website mixed in with your browser tabs again but not caring enough to make another native app, check out nativefier. Quickly makes an electron wrapper for any website.
[0]: https://fluidapp.com
Its extremely inefficient, to the point where I have a better time curling the HN web page and piping it through python beautifulsoup
Regarding a native app vs the using the HN website. The HN website I think is pretty ideal for the type of content its displaying, a native app doesn't give you much over having a HN tab open. I guess only if you want to read HN but not have a web browser open? But how often does that happen?
The only benefit I see from a native app ( and why I use one on Android ) is the ability to save articles and comments for offline reading, say, when I get on a plane.
> Its extremely inefficient, to the point where I have a better time curling the HN web page and piping it through python beautifulsoup
Yes it still does and yeah it's ridiculously inefficient. I have a couple tools I've written atop the HN API and all of them are forced to go async simply because the sheer # of page loads necessary to render a thread makes async almost a necessity.
I’m using two different APIs — the inefficient API that requires you querying in a tree fashion is the HN official API[0], but there’s also the Algolia API[1], which is much faster and gives a much sensible data shape. I also do actually fetch the HN website as well — it’s needed for account/voting features. With these sources, it’s much faster than a usual client that gets it’s data from the official API.
> The HN website I think is pretty ideal for the type of content its displaying, a native app doesn't give you much over having a HN tab open.
I guess it’s a bit of difference on how one uses HN? I didn’t like HN tabs being mixed with other work—related tabs. I felt that having an app would be a perfect solution to me, but YMMV I guess.
> The only benefit I see from a native app is the ability to save articles and comments for offline reading
I guess that’s one more feature that I should add to my backlog :)
A roadmap of planned features would be nice or some tickets that other people could help with.
I'm not sure how much time you plan on spending this, but I'd personally probably be willing to buy a version of this if it was able to do notifications on replies and similar features hn lurkers might want. Other interesting paid features could be read-later list, favourites, cross device syncing of read indicators and lists, etc. If you don't wanna deal with paid features maybe consider enabling the github sponsor feature so people could optionally pitch-in.
I’m more than happy to get feature requests though — read/unread indication and favorites are something that I would definitely try implementing. Notifications are a bit harder because it would require polling HN — I’ll be thinking on it.
Displaying the total number of times I've upvoted someone, a flair which I could put next to their user name, and, sad but true, being able to put a user in the block bin.
If I had those features I'd use this app in preference to the site.
The app is already great, but those few things would make it something I could see having a small subscription for, to help keep development going.
I still have the landing page up which warning, looks awful on mobile https://mackernews.com/
But congrats! I stopped selling my client and it’s starting to show age for my personal use too. Will check this out. Do you have voting and commenting working? That’s one thing I miss the most that stopped working on my client.
My only complaint so far is that I can only see about 12 items in the app on one screen, vs the whole front page in a browser. Adds a lot more scrolling.
How many of you prefer to run a native app rather than the web app?
Personally I hate installing things on my desktop if there is a website because it is just another thing I have to manage. (Even more so because I have multiple Windows, Mac and Linux boxes I'm bouncing around between during the day and rather just have sync'd Firefox bookmarks than have to install s/w on each box.)
Am I in the minority, majority, both, neither?
https://f-droid.org/is/packages/io.github.hidroh.materialist...
It is has an infinite scroll system so there is no page1/2/3 etc and in the comments section this is especially useful. I used to wonder why Dang inserted the extra pages links at the top of high comment count posts and it is obviously a pain point for him. With this android app its just all there in a slick card presentation.
I think there are a lot of interesting ways to enhance our connection to HN's valuable store of knowledge...
The main pain point for me is the article view in the app. I would prefer that it display the comments as it does but open the article in my browser of choice.
The built-in browser view is a little janky, I'd prefer it just pop a firefox tab that I can sync, etc.
(I appreciate that many will enjoy a native app, and I applaud the effort, but for me personally content sites are harder to keep track of if each has its own app.)
A native app should be snappier and maybe offline capable, but I'm not expecting to use Hacker News offline.
I'm usually lost in a sea of browser tabs
Things like reader mode and user styles help a lot with that, but they’re both kind of clunky bolt-ons and in the case of userstyles, often manual since many sites don’t have any readily available.
A lot of this could be improved if browsers had restyling built in as a first class feature and site owners were incentivized to make their sites work with it.
- don't need to create yet another account (and won't be deplatformed arbitrarily)
- my data stay in local and are not used in shaddy way by the service provider
- usable offline or with poor connection
- better performance
- I'm in control with upgrades
Webapps in general are hostile to the user and are just a way for the developer to take over (undue) control over the software usage and user data.
my number one reason is that most native apps care about accessibility (and my other preferences, fonts, UI, etc.)
the idea that modern web-based apps (mobile or desktop) provide a modicum of accessibility is laughable at best. it is something that makes me depressed everyday.
I use Slack's web client for this reason, I don't want it to tell the other person when I'm typing.
I like my apps to have an icon in the dock/taskbar, and I like being able to alt/command - tab. For web apps that I use a lot, I make an app shortcut so the app has it's own window and dock/taskbar icon.
The thing is, I really need tabs/multiple windows for some apps. (Log viewers, Jira/Asana, GitHub...) I used to use application-specific browsers for those sites, but the html engines never kept up.
I usually like electron apps... When they're correctly made. Slack's electron app works well. LastPass's electron app is missing too many features and doesn't integrate into the browser.
I'd also consider the sidebar include 'My Posts' and 'My Comments'. Maybe it has those, but I couldn't tell, as I turned off outgoing network access to firebase before logging in just to be on the safe side. Any reason you're connecting to firebase rather than storing preferences locally? I'm worried about my HN credentials being stolen.
> Any reason you're connecting to firebase rather than storing preferences locally?
All of your preferences are stored locally — the firebase connection is due to the official HN API[0] implemented on Firebase. Your HN credentials never leave the app (except for news.ycombinator.com) — it’s tucked in your keychain.
I know it's kind of a feature/property of HN to not implement notifications or other attention driving features but it'd be interesting to see this app periodically poll HN for any replies to My Posts / My Comments and generate at least sidebar number badges, if not app badges and system notifications. I'd implement a preference on the latter two though, in keeping with the spirit of not having HN turn completely into an attention grabbing social network for those that wish it not to be.
function hackernews() {
if (document.location.toString().indexOf('news.ycombinator') === -1) return;
document.querySelector('#hnmain td').style = 'background-color: #55b6f2;';
var i = 0;
function render(user, html) {
const div = document.createElement('div');
let style = 'cursor: text;overflow-y: scroll; height: 39px;position: absolute;border: 1px dotted #828282;width: 250px;margin-left: 250px;margin-top: -34px;background-color: #f6f6ef;';
div.innerHTML = html;
const date = div.querySelectorAll('tr')[5].querySelectorAll('td')[1].innerHTML.split(', ')[1];
const karma = div.querySelectorAll('tr')[6].querySelectorAll('td')[1].innerHTML;
const about = div.querySelectorAll('tr')[7].querySelectorAll('td')[1].innerHTML;
if (about.length < 60) {
style += 'display: flex;flex-direction: column-reverse;margin-top: -39px;border: none;background-color: transparent;';
}
div.innerHTML = about;
div.style = style;
user.querySelector('.age').innerHTML += date ? ' ' + date + ' ' + parseInt(karma).toLocaleString() : ' (x_x)';
user.appendChild(div);
}
function next() {
if (i >= document.querySelectorAll('.default .comhead').length) return;
const user = document.querySelectorAll('.default .comhead')[i++];
if (!user) return next();
const username = user.querySelector('a').href;
if (username.indexOf('soheil') !== -1) return next();
const html = localStorage.getItem(username);
if (html) {
render(user, html);
next();
return;
}
fetch(username)
.then(res => res.text())
.then(res => {
localStorage.setItem(username, res);
render(user, res);
setTimeout(next, 3000);
});
}
next();
}They don't even make it particularly easy to script an installation of an older version in a VM. There are 3rd-party tools but they're usually just as complete & compatible as whoever wrote them needed them to be, and/or they're abandoned.
[EDIT] like the VM images Microsoft provides. Those are wonderful.
Regarding Mojave... Yeah I still use that daily. Catalina is a mess, and Big Sur can't be (officially) installed on my mac. I could've tried to have a go at backporting the OP app, but Swift is too annoying of a language and I don't know much of it.