Two lines of CSS that will improve HN on mobile (IMO)
tdinh.notion.site
tdinh.notion.site
This way I don't have to scroll to find the comment to collapse its thread, and clicking the column is easier.
This is used in some subreddits in the old Reddit style, e.g. /r/de as can be seen here: https://old.reddit.com/r/de/comments/rcc9us/experten_finden_...
[0] https://gist.github.com/evanreichard/96d89512cbfe23e5d7a8147...
Many thanks! It works like a charm.
One I came across performs automatic voting. On pageload, it scans for comments starting with "So..." or ending with " lol" and downvotes them. I'm not sure who this is for. "Communication peeves" comes to mind, but doesn't quite fit. I'm don't know what the word is for this.
EDIT: It originally said "less than 500 karma".
To that newly freed space on the left move the "next" and "prev" links, and if "next" and/or "prev" is not available for a particular comment pad its space so if "next" and/or "prev" is there it is always at the same horizontal position.
This makes it easier to skip forward or back a subtree at a time, because after a given click of "next" or "prev" is executed your mouse or finger will be over the next "next" or "prev".
On some phone widths, you end up with the profile and "logout" links right above one another and it's even odds you'll have to log back in on all your device because you'll fat-finger the wrong one and there's no confirmation or anything, just straight fuck off.
No idea why that damned logout link can't be moved to the profile, is anyone really in such a hurry to log out they can't just hit two links?
Especially now that the “next” button has been added. It is very disorientating when I accidentally tap that.
In fact, all tap targets are too small for mobile. Clicking the comments link to open a post is difficult and I sometimes click flag or hide by accident.
- 'prev' / 'next' goes to the adjacent sibling comments
- 'root' goes to the top level comment in the thread (not the post)
They are very useful on mobile if you're deep in a thread, and want to go to the next top-level thread. To do that, press 'root' and then 'next' (or collapse it with [-]).
The larger text looks imbalanced, and I think there are ways to make collapsing threads easier without the eyesore, like changing "[-]" to "collapse thread" or adding a reddit-style bar to the left of the text.
Commenting in case others agree, so the HN team doesn't assume everyone agrees with the proposed change.
[0] https://apps.apple.com/us/app/apollo-for-reddit/id979274575
I'm so used to the Reddit app rif is fun, to a point that any HM apps I have tried feel "wrong" as soon as they're different from it and I constantly feel frustrated.
I ended up just not read HN much on my phone and when I do, I just use the webpage.
Do you know if HN or any third party provides an API so that devs can play around building mobile interfaces ?
I'm also using HACK (same as one of the other commenters in this thread), but it's not quite as nice as Apollo.
https://en.wikipedia.org/wiki/Em_(typography)
There's also a unit called an "en", which was based on the width of "N":
Both px and pt (and cm, mm, in etc.) are absolute (in the sense that they don't depend on the current font size, only on the pixel density and scale factor of the display). So there is no reason to prefer px to the other units.
In traditional typography, pt is relative to the size of a font, but in CSS it is just an absolute measurement like px.
See: https://drafts.csswg.org/css-values-3/#absolute-lengths
The tutorial you link to is wrong, which is weird since it is written by the inventor of CSS! It might be because it is out of date and reflect the original intention of CSS, not how it actually turned out.
Originally, the intention of CSS was that px should correspond to a pixel and pt/mm/in to physical dimensions, so the ratio between px and pt would vary depending on the pixel density. But people started to specify font sizes in px, which meant text would just become unreadably small when high-density displays were introduced. So instead px was redefined as a physical unit rounded to nearest pixel, and the other absolute units defined relative to this.
See: https://drafts.csswg.org/css-values-3/#absolute-lengths
Much terminology have a different meaning in CSS than in traditional typography. For example the em unit does not actually depend on the width of on "m"-letter in the font, rather it depends on the height of the font.
12pt equals 16px, 20pt equals 26.667px. The unitless line-height would be 1.6667. Regardless of how it's written, that's a pretty big value for regular-sized text (compared to larger text for something like a heading). I guess that's helpful in narrow views of nested comments, where the close button might wrap to a new line, below another clickable element.
.comhead {
font-size: 1rem;
line-height: 1.667
}(Not trying to start a debate. Just pointing out that user experience on mobile is subjective, rather than objectively "pretty bad".)
body { margin-top: 0; background-color: #EAEBE3; }
.title { font-size: 14px; }
.titlelink { color: #131010 }
.subtext { font-size: 11px; }
.comment { font-size: 14px; line-height: 1.5; }
.default p { margin-top: 16px; max-width: 100ch; }
https://i.imgur.com/FmbgVOo.png
and moving "Lists" from bottom navigation to the top navigation would good thing.
I don't know how many times I've accidentally flagged a post when using my iPad because the text is so small. And there's no unflag button.
Fortunately, I have a controversial commenting history, so the system only very rarely allows me to flag anything.
I very much appreciate the fact that this wasn't turned into a article three times the size, just the information and relevant code.
In other words, you can't really do it.
On a desktop OS, you should not have issues using pointer devices. (On mobile devices, when using fingers to tap, one normally pinches to enlarge and re-pinches to adjust size... Although I am not really sure if this still works with nowadays' mobile software: I am assuming text reflow, being that strictly required, and last time I checked most implementations in browsers were broken.)
For comfort in readiing, on a desktop OS, one is supposed to quickly adjust the zoom level with [Ctrl]+[Wheel], or [Ctrl]+[+/-] or similar...
Just a few lines of CSS could really improve readability here.
Font size is buried three levels deep under Settings > Accessibility > Font Size
[0]: https://play.google.com/store/apps/details?id=io.github.hidr...
I have an iOS device. The experience might be better on Android.
It was the starting point of my own HN app, but as usual I never finished it.
I'm typing this comment via it, actually.
Writing from it now, it's pretty simple and has everything needed
-- a good starting guide is at https://www.freecodecamp.org/news/what-are-bookmarklets/
-- it's not clear what could be the best method for calling them with a keyboard shortcut (where relevant/applicable), but a few approaches exist: https://superuser.com/questions/387729/creating-hotkeys-in-f...
-- it's not clear how to automate applying one such javascript snippet on each page load of a URL of defined pattern matching - there probably exist at least browser extensions
Userscripts with extensions like tampermonkey.
Obviously, understand that your team may be lean and have other priorities, but maybe hiring a contractor to resolve some these issues would be a way to address concerns for those with sight issues and those browsing on small screens.
Will I successfully update my prescient mumblings such that they actually make sense, or will I delete everything my fat fingers just spent hundreds of seconds editing? Who nose?!
This is an specially irksome bug given that the two buttons are only next to each other for particularly long comments. I should cut back on the waffle.
I suppose that wouldn't help if you opened the comment page on a new tab, though.
The two Screenshots are placed next to each other instead of having the headline between them, and one of them doesn't even render.
I have to use notion at work and if I didn't love my job for other reasons their UI might be enough to make me walk out the door.
Plus: my goodness for a few words and two images this page takes forever to load and render, even with a warm cache. Cutting-edge UX in 2021! hooray!
god speed
[1] https://userstyles.org/styles/97106/hacker-news-zenburn-dark
Reading on mobile devices, or worse, high-DPI e-ink, is a nightmare.
There's supposed to be a custom-per-user CSS hack in the works, but that's been the response for years.
One of the few issues that I've faced is pagination of the comments and occasionally "dang" might pop up to paginate the comments on heavily trending/debated topics.
My 2 cents would be to enable pagination after a set number of comments, so that it doesn't go on and on, on mobiles.
BTW, I really like this kind of website design as its minimal enough to load on terrible connections and easily viewable.
javascript:(()=>document.querySelectorAll('.comhead').forEach(e=>{e.style.fontSize='12pt';e.style.lineHeight='20pt'}))()
I wish HN would borrow one UX person from its own portfolio companies to improve the overall typography and UX.
As there are hundreds of thousands of them on the page, the size is important.
At least the work on mobile chrome. You open a site, then tap the url bar and type the name of the bookmarklet and tap that.
I have one that removes all iframes, getting rid of 90% of ads
.comhead a { padding: 10px 0; margin: -10px 0; }
I thought it was bad but it is actually worse. Maybe accessibility is the argument to make, because my prayers always fell upon deaf ears.
The UX and design could be better, that's true.