Settings

Theme

Please add this 1 line, make HN mobile friendly

74 points by Hilyin 12 years ago · 50 comments · 1 min read

Reader

<meta name="viewport" content="width=device-width, initial-scale=1">

kogir 12 years ago

I tried this for a few hours some time ago. It made the site less usable on most Android and iPhone devices with normal smartphone screen sizes. Text in a number of places ran together and comments shrunk to one character per line a few replies down.

So it's not that simple. Real changes to make the site truly responsive are larger and I can't promise they'll come soon.

  • Bahamut 12 years ago

    It's already pretty bad, at least on Android - I have a hard time editing my text when there is a typo somewhere due to the bottom of the text field expanding and including the "reply" button, so I can't select the last line with my fingers.

nrbafna 12 years ago

I saw a comment on HN sometime back and can't seem to find it now, but thought it had some merit. The gist of it was that enabling posts from mobile might lead to lower content quality as typing on phones is tougher and we tend to focus on a quick reply rather than a thought out discussion.

I personally use http://hn.premii.com on mobile & it has a good reading experience.

  • andybak 12 years ago

    It's an orthogonal issue. I would like the official site to be vaguely readable on mobile. Whether they then choose to discourage posting from mobile is a different question.

    (My personal view is that 'mobile' is very difficult to define. If I connect a bluetooth keyboard to a Galaxy Note then why the hell should I be discouraged from posting on the grounds I might post lower quality comments?)

    • repsilat 12 years ago

      Even on my 7-inch tablet, mobile sites are mostly just a pain in the neck. I'll almost always prefer to be served the desktop version served to me (exceptions for sites that expect me to hover my mouse over their content.) In my view mobile sites should mostly be "small display" sites, and they should be served to desktop people with small browser windows, too.

      Worst of all are sites that don't provide a "Full site" link, and don't cooperate with my browser's "View desktop site" option. And don't get me started on "Try our mobile app"...

  • jonalmeida 12 years ago

    I used to use hn.premii.com since sharing articles from there shares the hn.premii.com link which seems to steal the page view from the authors post - I may be wrong though.

    I use the HN Enchancement Suite chrome extension[1] now instead on my desktop and cheeaun.github.io/hackerweb on my mobile.

    [1]: https://chrome.google.com/webstore/detail/bappiabcodbpphnojd...

russellbeattie 12 years ago

No, you cannot just add that to the top of a web page and have it magically transform into a mobile-friendly page. It may look fine on your particular device, but it will probably be completely hosed on everything else.

The viewport meta tag is essentially a switch which tells mobile browsers to not provide a default page width of 980px, auto zoomed out, but to instead use the device's CSS pixel dimensions, with a zoom you define with initial-scale. Note that this is not physical pixel dimensions. A mobile device's CSS pixels are the physical resolution divided by the device's devicePixelRatio, which currently can range from 1 to 3.

Examples:

On an iPhone 5s, which has a physical resolution of 1136x640 and a devicePixelRatio of 2, a viewport with "width=device-width" will create a page that only has 320px in portrait and 553px in landscape in CSS pixels.

On a HTC One, which has a physical resolution of 1920x1080 (1080p) and a devicePixelRatio of 3, the page will have only 360px in portrait and 640px in landscape.

On tablets, CSS pixel portrait width can range from 600px on a Nexus 7 and Kindle Fire HDX, to 768px on an iPad mini non-retina, to 800px on a Nexus 10 or Kindle Fire HDX 8.9".

Using a viewport meta tag needs to be done in combination with CSS media queries (or a very flexible design that doesn't use px for sizes) to ensure that your web page design responds to the various screen sizes without breaking.

Hope that helps clarify things a bit - trust me, it's a common misunderstanding.

DanBC 12 years ago

I am not sure what this is meant to address. The worst thing for mobile users is the teeny tiny voting buttons. I believe that votes are important and are not used enough and part of the reason is fear of accidental downvote.

The other thing that could be fixed is when someone puts a very long unbroken string in a comment without putting it in a code block. This makes the page very wide, and creates an unpleasant experience.

  • emiljbs 12 years ago

    I have 157 karma and I can't downvote anything. How exactly do you downvote on HN? I've never seen anyone explain that (and I can't really see it in the settings either).

nailer 12 years ago

HN needs more than that - enabling it:

http://imgur.com/9fetcE9

Throw the template and CSS, and some sample data on GitHub. HN'd have a working version in 24 hours.

  • Udo 12 years ago

    What's that emulation plugin you're using there?

    • jackmoore 12 years ago

      Chrome's stock developer tools.

      • Udo 12 years ago

        You're right, I never saw it's in there. Sometimes you use a piece of software a lot and yet it's still possible overlook obvious features, I guess :)

        • akx 12 years ago

          Especially since said software auto-updates and adds these features. :) I think the emulation feature is very recent.

        • nailer 12 years ago

          Agreed. I just suggested a "What's New in DevTools" feature to Addy.

mcovey 12 years ago

I have no idea as to the status of userscripts on mobile devices but at least on the desktop they are my go-to for personalizing my internet:

    ("news.ycombinator.com" === window.location.hostname) &&
    (function () {
        var meta = document.createElement("META");
        meta.name = "viewport";
        meta.content = "width=device-width, initial-scale=1";

        if (document.readyState === "complete") {
            document.head.appendChild(meta);
        } else {
            document.addEventListener("DOMContentLoaded", function () {
                document.head.appendChild(meta);
            });
        }
    })();
germs12 12 years ago

Agreed. Seems like a easy win for everyone. Are there any downsides?

mobweb 12 years ago

I use http://ihackernews.com/ all the time on mobile and it's working perfectly. Might want to give it a try!

  • gpmcadam 12 years ago

    Oh, I may start using this on my desktop if only for the collapsing comments!

TheBiv 12 years ago

I think we are all looking at the amount of work that would need to go into this, and not looking at the simple fact that maybe PG doesn't want to manage a mobile site.

If you don't understand what I mean by "manage", then consider yourself lucky as you have not worked in the digital agency world.

  • nailer 12 years ago

    HN's relatively simple, eg it's already a single column layout. Relative widths would do 90% of the job.

    • TheBiv 12 years ago

      I would hazard a guess that it's not how simple the site is or the changes would be, it's a matter of managing it.

nrbafna 12 years ago

On other note -

Is there an extension/app for HN that categorizes the posts into topics (based on some text analysis) & enables the user to filter them out from the feed? Feature akin to what lobste.rs provides.

This will basically enable me to filter out fluff stories that manage to rise up.

jchrisa 12 years ago

I think I saw them experiment with something like this briefly.

robinhoodexe 12 years ago

http://hckrnews.com is rather mobile-friendly (and looks georgeous as well).

  • dfc 12 years ago

    Gorgeous is a little bit of an exaggeration. It looks nice, but I think it fails to reach "gorgeous."

wololo_ 12 years ago

Or you know, make the front-end layer open source s owe can send in PR

zbowling 12 years ago

why not just use an app?

raldi 12 years ago

What will it do?

A pair of before-and-after screenshots would be helpful.

chaoskid 12 years ago

or just use http://ihackernews.com

Istof 12 years ago

or use RSS and format it however you like?

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection