Live data from Hacker News

Just because I have a vertical screen doesn’t mean I’m on a phone

shkspr.mobi

241–250 of 399 posts

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#241

Earlier quoted context omitted.

> Because HN is designed so simply, you can trivially get the layout you want (half width lines) and I can also get the layout I want. Except you're ignoring mobile devices.

No, the say that HN does it works regardless of screen width. If the site were to assign a fixed width, it would conflict with mobile devices.

This is why CSS has "max-width".

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#242
post #236

Earlier quoted context omitted.

> Lay out content based on the viewport width, in CSS pixels. This is wrong because the viewport width is not the same as the monitor width or the DPI: especially on big monitors running the browser fullscreen is very hard to use (my browser rarely exceeds more than ~50% width on a 2560x1440 monitor and even when i use a 1366x768 monitor - which btw is at 22", not some tiny laptop one - i very rarely use it maximized…

The viewport width is the browser width, not the screen width. What are you saying is wrong with using the viewport width?

Uh, i wrote "viewport width is not the same as the monitor width", this is the same as what you wrote.

As for why it is wrong, it is because you can't rely on it to make a Mobile vs Desktop distinction - i already provided an example why.

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#243
post #54
post #20

I feel like this is a more complex problem to solve than it seems at face value or the author implies, especially considering tablets of varying dpi. CSS dpi media queries are unsupported in Safari mobile and desktop, so that increases the complexity significantly. Beyond that, the fact is most web layout is still done in px or other non-fraction-of-the-width units, so it’s often a matter of the wider layout simply b…

There’s a good reason why there are no real DPI media queries: You should not decide how big things appear on the screen, that’s up to the user. The user has the ability to change resolution or to change the website’s zoom level, you should never access the real size and decide that a button must be exactly 1cm wide in real life on every screen for everyone. Just design for the default and then people will zoom or ch…

What about the min-resolution media query?

  @media only screen and (-webkit-min-device-pixel-ratio: 1.3),
 only screen and (min-resolution: 120dpi)
 {
  /* High DPI code */
 }

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#244
post #48

Sites are not detecting a portrait screen and deciding that they're displaying on a phone. Someone who switches their monitor to portrait, or resizes a window to be taller than it is wide, is still going to get the desktop view. In this case the author is scaling their resolution, and so their browser is presenting itself to sites as 720px wide. Sites see that and show a layout optimized for a screen of that width. T…

  @media and (pointer: fine) {
      your computer specific CSS rules goes here
  }
No reason to tell a tall window it is on a phone.

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#245
Forget the arguments about counting pixels for a moment... Mobile browsers have a "request desktop site" switch that seems to work pretty reliably, even though the viewport is still tall.

Yet when I tile my browser to the left or right of my giant 4k display, I frequently get a mobile site with text that you can read from across the street. Is there a way to jusr get a "request desktop site" switch that performs the same magic on my desktop browser?

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#246
post #48

Sites are not detecting a portrait screen and deciding that they're displaying on a phone. Someone who switches their monitor to portrait, or resizes a window to be taller than it is wide, is still going to get the desktop view. In this case the author is scaling their resolution, and so their browser is presenting itself to sites as 720px wide. Sites see that and show a layout optimized for a screen of that width. T…

I would add to this that the specific sites in question have fairly unreasonable media-queries: The Guardian breaks to mobile at 980px, and Just Eat at 1024px . On my MacBook Pro with default scaling, these are both more than 50% the width of the monitor; i.e. if I size the window to half-screen, I'm in mobile mode on these sites. For reference, in sites I make I usually set the mobile breakpoint closer to 768px (not…

iphoneX looks like it has a css px width of 812px. They may also be trying to capture tablets, which are pushing above 1024 css px.

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#247
post #236

Earlier quoted context omitted.

The viewport width is the browser width, not the screen width. What are you saying is wrong with using the viewport width?

Uh, i wrote "viewport width is not the same as the monitor width", this is the same as what you wrote. As for why it is wrong, it is because you can't rely on it to make a Mobile vs Desktop distinction - i already provided an example why.

"Mobile vs desktop" is not a distinction websites should be making. Sites should make the best use they can of the available horizontal space.

It's still not clear to me where you think this approach gives bad results?

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#248

As a product manager, my immediate response is... not worth the time. You've chosen to have a unique setup, which is fine, but your use case represents some absolutely miniscule fraction of users. On top of that, it's not even that websites are unusable, just that they're not ideal. When you decide to do weird/special/unique stuff, don't expect the world to adapt to you. You can rotate your monitor back or live with…

You don't need to rotate your screen; just shrink your browser. I know that lots of people like to use fullscreen windows, but that makes me feel claustrophobic; text ought to be formatted in narrower columns for comfortable reading, so I like narrower browsers. This often fools websites into sending me the phone layout, which is unhelpful and annoying.

So what's your solution? How do we differentiate between a tablet user and someone who decided to shrink their windows?

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#249

As a product manager, my immediate response is... not worth the time. You've chosen to have a unique setup, which is fine, but your use case represents some absolutely miniscule fraction of users. On top of that, it's not even that websites are unusable, just that they're not ideal. When you decide to do weird/special/unique stuff, don't expect the world to adapt to you. You can rotate your monitor back or live with…

> You've chosen to have a unique setup,

But is this unique? Lots of people prefer to have windows that are significantly taller than wide - just like books are. I'd love to see some hard data on this.

> The idea that companies should spend engineering/QA/PM resources to deal with this is... vain.

/eyeroll

Re: Just because I have a vertical screen doesn’t mean I’m on a phone

#250
post #96

I feel like I must be missing something, because I don't understand this author's point at all. "Lots of websites think “Vertical Screen == Mobile User”!" No, they don't - They think a 720px wide screen is a tablet user, which is probably a fair assumption. I could equally write "Just because I browse zoomed in 500% doesn't mean I'm on a mobile" When you zoom in, things get bigger, so fewer of them will fit on the sc…

Why don't browsers tell the server whether the user has a touch screen? This seems like a perfectly reasonable thing that the website should know before delivering the page, and users who are hyper privacy focused could toggle a setting to not send this info.
Post reply on HN