weiran / hackers Goto Github PK
View Code? Open in Web Editor NEWHackers is an elegant iOS app for reading Hacker News written in Swift.
Home Page: http://weiran.co/hackers
License: MIT License
Hackers is an elegant iOS app for reading Hacker News written in Swift.
Home Page: http://weiran.co/hackers
License: MIT License
Hey @weiran, I pinged you on Twitter but realized it would probably be good to also make an issue about this...
I'm working on some major improvements to Hackers, one of them being authentication so that you can up and down vote stories and comments. It's working great already, but for that extra sparkle effect I want to get Password Autofill up and running. However, to do that we need to have the Hacker News team add a apple-app-association-file
to their domain. I think that they would happy to do it, especially since the file can allow any number of other apps to also get the same experience just by adding the bundle ID. And i'll add that even if Hackers died sometime in the future (not that I expect it to!) it wouldn't hurt any users of the app or otherwise in any way. It's much like a robots.txt
file, some apps will check for it and everyone else doesn't even know it exists really.
I thought i'd check with you before reaching out to the team on the off chance you wanted to handle it. If not, I would happily do it and it would perhaps even get a better response because I am myself a YC founder...
Anyway, let me know, will leave this open until I hear back.
BTW, the file looks like this and placed at https://news.ycombinator.com/apple-app-site-association
(or https://news.ycombinator.com/.well-known/apple-app-site-association
):
{
"webcredentials": {
"apps": [
"2KB59GPA9B.com.weiranzhang.Hackers"
]
}
}
When using with a regular horizontal size class, when tapping to view comments for a post, the comments view controller is pushed onto the wrong view controller.
Had various reports since 4.0 that scrolling is now a lot harder because the swipe gesture is too sensitive.
New setting for this?
Error:
GCOLaunchImageTransition/GCOLaunchImageTransition.h not found
steps:
1.git clone --recursive https://github.com/weiran/Hackers.git
2.cd Hackers && pod install
3.console print
Fetching podspec for `NNNetwork` from `NNNetwork-temp.podspec` Downloading dependencies Installing AFNetworking (1.3.4) Installing ARChromeActivity (1.0.4) Installing ARKippsterActivity (1.0.1) Installing DTCoreText (1.6.14) Installing DTFoundation (1.7.4) Installing FontAwesomeIconFactory (1.4) ...
4.Xcode 6.1 open
5.error occured
Link to GitHub as the official issue tracker.
Link to leave a review.
@weiran Any thoughts on implementing push notifications? I think it's one of the key things missing in any Hacker News app. The simple v1 can just be notifications when a story is >= X points. I'm willing to write the backend for this, probably just something with Firebase Cloud Messaging so that we can use topics to determine what devices to send notifications to.
As another option that wouldn't require a backend service, we can build something similar to what GitHawk does, where it uses background fetch to trigger notifications by fetching data from GitHub. The nice side effect of this would be we can cache data in the background so that the app always has fresh data. More info about GitHawk's implementation is available here.
Hi again @weiran,
Apologies for #45 getting out of hand. Sadly, I have some more "bad" news in the same vein. I kept working in private, ashamed of how out of control my PR was getting as normally I create one off PRs. I guess I just got super duper into building the best fucking Hacker News app for iOS that I possibly could so I went all out. It may have also had something to do with recently leaving my last job after extreme burnout and being in a continual state of shock.
Anyway, I reached out to you via Twitter DM a few months ago about this but never heard anything so I wanted to open this issue so that I could be sure you saw it.
I know that merging all of this at once would probably be pretty insane, so I'm hoping you and others can cherry pick my best pieces. Just about everything except some specific minor UI stuff works (minor UI stuff being like the constraints sometimes screw up on stories that I can't extract media for).
I would offer to break all this up myself into individual PRs but I'm up to my neck in @home-assistant mobile work for the rest of the year at this point and all this stuff is so good that it didn't feel right to keep it to myself especially since I saw #68, #71 and #93 were on your near term todo list.
I've been using my fork multiple times per day since I finished working on it back in October. It's amazing. Totally replaces the browser for me.
I shot a quick little video for you to get a sense of where things are. I'd invite you to check out the branch and build it yourself.
Thanks, and again, please accept my apologies that I locked up all this fantastic (IMHO!) work in a single branch. It's one of my largest regrets of the last 2 or 3 years of my programming career.
Let me know if you or anyone else has questions. I'm excited to see Hackers become the end all be all best Hacker News app on iOS very soon 😄.
Here's what is in this new fork I've got going:
Thanks to UltraHN, I've been able to significantly improve the available views. Hackers now has support for:
/news
)/classic
)/newest
)/jobs
)/ask
)/show
)/shownew
)/active
)/best
)/noobstories
)/over
)/front
)/submitted
)/comments
)/favorites
)/upvoted
)/hidden
)/from
)There's a lot more things that building UltraHN allowed me to do, but also a lot of other improvements to the UI and UX:
There's generally a whole lot of other minor improvements here and there and it's been 5 months since I last touched the code and git log
only tells me so much.
All of this is of course in addition to my UI Improvements PR (#45). As a reminder, that featured:
Indicates if SFSafariViewController should enable collapsing of the navigation bar and hiding of the bottom toolbar when the user scrolls web content.
)When navigating back from SafariVC on the iPad app, it’s removing the highlight on the selected cell. This should only happen on the compact UI.
If you test a lot of login requests, Hacker News can start to show a reCAPTCHA to prove you're not a bot. In this case we should instead ask the user to login via the web page and capture the authentication cooke afterwards.
Currently it has no subject and puts the title in the body text.
Placeholder icon now looks dated, and any ycombinator.com icons (such as from Ask Hacker News) look terrible.
What do you think about adding an option to disable thumbnails? I find them to be distracting, because they are usually too blurry, irrelevant, and load very slowly. Even the "Y" icon used for Ask HN looks terrible and pixelated.
I don't have any suggestions for what an alternative UI would look like. I would be fine with the default Safari icon for everything though.
Thanks!
Need to refresh the comment data source after logging in to get valid vote URLs.
Currently relying on iOS resizing for thumbnails which doesn't work very well (lots of jaggies)
Currently CommentModel
is a fairly useless copy of HNComment
with a couple of computer values. This could just be an extension or implemented some other way.
Would you be open to a pull request for Pocket support?
E.g.:
Need to add another launch arg to disable it.
All the new features added are hard to discover as they are all gesture based. Some sort of feature discoverability should be added. For simplicity I think I'll go for the boring but easy to implement onboarding interstitial�.
Apple announced a lot of interesting things at WWDC 2019, including SwiftUI and Combine. Since the keynote I've been thinking about how Hackers could adapt to use those new frameworks, and I think the best way is to do (another) ground up rewrite, like when Swift was introduced. The current codebase has already gone through almost every Swift version migration, and is suffering from some bad choices made back in Swift 1 days. I would also love to integrate some of the features from #100 in this, as well as extracting UltraHN into it's own modern and well maintained Hacker News library for iOS.
This is obviously a big change that will bring little in the way of user benefits initially, but should lay the groundwork for the next few years of iteration on Hackers. But first I want to get one last release on the current codebase out (4.0) that will include everything currently planned.
If you keep scrolling eventually the threads are no longer Ask HN threads.
Incident Identifier: FED39AB7-D6E1-4CC5-84B8-774189E5C028
CrashReporter Key: 18577e6b9b5509c445159c021d1486229f7833a8
Hardware Model: iPad6,11
Process: Hackers [639]
Path: /private/var/containers/Bundle/Application/AC4775D0-B097-48F9-AB7E-436632C34E34/Hackers.app/Hackers
Identifier: com.weiranzhang.Hackers
Version: 52 (3.6.2)
AppStoreTools: 10E121a
AppVariant: 1:iPad6,11:12
Code Type: ARM-64 (Native)
Role: Non UI
Parent Process: launchd [1]
Coalition: com.weiranzhang.Hackers [549]
Date/Time: 2019-06-03 20:42:53.8623 +0400
Launch Time: 2019-06-03 20:42:34.5382 +0400
OS Version: iPhone OS 12.1.4 (16D57)
Baseband Version: n/a
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x20d63dea4 __exceptionPreprocess + 228 (NSException.m:172)
1 libobjc.A.dylib 0x20c80da50 objc_exception_throw + 56 (objc-exception.mm:557)
2 CoreFoundation 0x20d544484 +[NSException raise:format:] + 116 (NSException.m:145)
3 SafariServices 0x222db95cc -[SFSafariViewController initWithURL:configuration:] + 112 (SFSafariViewController.m:49)
4 Hackers 0x103003404 @objc ThemedSafariViewController.init(url:configuration:) + 180 (ThemedSafariViewController.swift:0)
5 SafariServices 0x222db9bb8 -[SFSafariViewController initWithURL:] + 100 (SFSafariViewController.m:218)
6 Hackers 0x103010494 specialized CommentsViewController.linkTapped(_:sender:) + 204 (<compiler-generated>:0)
7 Hackers 0x10300f020 protocol witness for CommentDelegate.linkTapped(_:sender:) in conformance CommentsViewController + 20 (<compiler-generated>:0)
8 Hackers 0x102ffabcc specialized CommentTableViewCell.textView(_:shouldInteractWith:in:) + 140 (CommentTableViewCell.swift:77)
9 Hackers 0x102ffa190 @objc CommentTableViewCell.textView(_:shouldInteractWith:in:) + 124 (<compiler-generated>:0)
10 UIKitCore 0x23a894f90 -[_UITextViewInteractableLink allowInteraction:] + 360 (UITextView_LinkInteraction.m:782)
11 UIKitCore 0x23a893cc8 -[_UITextViewInteractableItem handleTap] + 40 (UITextView_LinkInteraction.m:547)
12 UIKitCore 0x23a7f1430 -[UITextLinkInteraction tapOnLinkWithGesture:] + 452 (UITextLinkInteraction.m:139)
13 UIKitCore 0x23a7eed84 -[UITextInteraction tapOnLinkWithGesture:] + 200 (UITextInteraction.m:353)
14 UIKitCore 0x23a7f2688 -[UITextNonEditableInteraction oneFingerTapInUneditable:] + 96 (UITextNonEditableInteraction.m:33)
15 UIKitCore 0x23a16d0d0 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 64 (UIGestureRecognizer.m:113)
16 UIKitCore 0x23a1756ec _UIGestureRecognizerSendTargetActions + 124 (UIGestureRecognizer.m:1148)
17 UIKitCore 0x23a172f70 _UIGestureRecognizerSendActions + 320 (UIGestureRecognizer.m:1187)
18 UIKitCore 0x23a172458 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 764 (UIGestureRecognizer.m:0)
19 UIKitCore 0x23a165760 _UIGestureEnvironmentUpdate + 1096 (UIGestureEnvironment.m:159)
20 CoreFoundation 0x20d5cd6bc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1822)
21 CoreFoundation 0x20d5c8350 __CFRunLoopDoObservers + 412 (CFRunLoop.c:1932)
22 CoreFoundation 0x20d5c88f0 __CFRunLoopRun + 1264 (CFRunLoop.c:2950)
23 CoreFoundation 0x20d5c80e0 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
24 GraphicsServices 0x20f841584 GSEventRunModal + 100 (GSEvent.c:2245)
25 UIKitCore 0x23a554c00 UIApplicationMain + 212 (UIApplication.m:4347)
26 Hackers 0x102ffa460 main + 68 (CommentTableViewCell.swift:10)
27 libdyld.dylib 0x20d086bb4 start + 4
This will allow swipe based voting and get rid of some annoying code at the expense of other annoying code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.