Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oops #100

Closed
robbiet480 opened this issue May 17, 2019 · 1 comment
Closed

Oops #100

robbiet480 opened this issue May 17, 2019 · 1 comment

Comments

@robbiet480
Copy link

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:

  • A clean room replacement for the existing Hacker News libraries on iOS. I call it UltraHN. It takes a bit of each official API (Algolia & Firebase) and combines it with HTML scraping. I dug through every single resource about all of the sources that I could find and visually inspected and documented differences between all three in painstaking detail.
  • UltraHN supports almost every action that can be taken by an authenticated user:
    • Voting (up/down and unvoting)
    • Flagging
    • Submitting stories
    • Submitting comments
    • Seeing secret, YC only, profile fields
    • Collapsing comments in the app syncs to the website and vice versa
    • Favoriting
    • One of the biggest things it doesn't support is editing existing comments and submissions.
  • UltraHN extracts bits of HTML that are significant to the UX, such as the grey levels of downvoted comments and correct colors for usernames
  • Implements search via Algolia
  • Has realtime update support thanks to Firebase. Realtime updates happen for comments and stories.

Thanks to UltraHN, I've been able to significantly improve the available views. Hackers now has support for:

  • Viewing your profile as well as others profiles just by tapping their username. Even lets you see that users submissions, comments and favorites. For your own profile you can also view hidden and upvoted submissions.
  • Here's all the views we now support:
    • Home page (/news)
    • Classic algorithm home page (/classic)
    • Latest submissions (/newest)
    • Jobs (/jobs)
    • Ask HN (/ask)
    • Show HN (/show)
    • Show HN by newest (/shownew)
    • All news with most active discussion thread first (/active)
    • Highest (recent) score (/best)
    • Most recent stories submitted by new users (/noobstories)
    • Submissions with more than the given point value (/over)
    • Homepage for a specific date (/front)
    • Posts submitted by the given username (/submitted)
    • Comments submitted by the given username (/comments)
    • Posts favorited by the given username (/favorites)
    • Posts upvoted by the given username (/upvoted)
    • Posts hidden by the given username (/hidden)
    • Posts from the provided domainName (/from)
    • Users profile
    • Leaderboard
    • Search

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:

  • A new, more visual, table view cell for the feeds
  • Keyboard shortcuts
  • Better notification filtering
  • Improved iPad experience
  • Allow the tab bar to be customized
  • A new image extractor backend which prioritizes better looking open graph images as well as adds caching.

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:

  • Two new themes, a pure black theme for OLED devices and a "original" theme which matches news.ycombinator.com in terms of colors and fonts (Verdana).
  • Handoff support for comments and links
  • Allow users to choose a browser to open a link in (SFSafariViewController, SFSafariViewController in reader mode, Safari or Chrome)
  • Long press on a link in NewsViewController to share link
  • When sharing, we give the user the option of either sharing the content link or the comments link
  • Long press on a comment now allows sharing a link to that comment
  • SFSafariViewController is initialized with barCollapsingEnabled = TRUE (Indicates if SFSafariViewController should enable collapsing of the navigation bar and hiding of the bottom toolbar when the user scrolls web content.)
  • Hides tab bar on comments view
  • Tapping a jobs post goes directly to the link instead of comments since job posts don't have comments.
  • Extends comments view to superview so comments are behind home indicator
  • Redid the settings page with Eureka so that it's easier to handle the inline theme picker as well as provide a good foundation for other future settings.
  • Removed the custom share icon and instead used the system default icon.
  • Minor other tweaks
@weiran
Copy link
Owner

weiran commented May 30, 2019

Hi @robbiet480,

Looks like some great work, especially with the new API based UltraHN parsing. Obviously with the large amount of changes in your fork, and changes to Hackers since then, it's going to be hard to merge them. I'll have a look this weekend at what the best way of merging your changes in, but I suspect it will be mainly cherry picking and manual conflict resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants