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

improve display on mobile phones #40

Merged
merged 6 commits into from
May 18, 2023
Merged

improve display on mobile phones #40

merged 6 commits into from
May 18, 2023

Conversation

domel
Copy link
Contributor

@domel domel commented May 7, 2023

Improvement display on mobile phones and other small devices + whitespaces in styles


Preview | Diff

improve display on mobile phones and other small devices + whitespaces in styles
@domel domel requested review from gkellogg and hartig May 7, 2023 16:50
@domel domel added the spec:editorial Minor issue or proposed change in the specification (markup, typo, informative text) label May 7, 2023
@hartig
Copy link
Contributor

hartig commented May 8, 2023

@domel Do you have a concrete example where this change makes a difference and what this difference looks like?

@domel
Copy link
Contributor Author

domel commented May 8, 2023

@hartig yes, actually on any mobile device this page (and others display badly). The most common issue is with tables that extend beyond the right margin. The result is a scroll on the x-axis, which is very annoying and unreadable. You can check this on your smartphone or in a desktop browser by pressing F12.

@hartig
Copy link
Contributor

hartig commented May 8, 2023

What do you mean by "this page"? This one here on github? That one looks fine in my mobile browser. Here's a screenshot:

Screenshot_20230508-112641

Can you please point out concrete tables in the actual spec draft that you have a problem with, ideally using screenshots (and, ideally, screenshots before and after the changes in this PR).

@domel
Copy link
Contributor Author

domel commented May 8, 2023

I mean spec document. All tables have problems. If uou want I can take a screenshot later.

@domel
Copy link
Contributor Author

domel commented May 8, 2023

Screenshot_2023-05-08-12-40-27-563_org mozilla firefox

@domel
Copy link
Contributor Author

domel commented May 8, 2023

Screenshot_2023-05-08-12-43-21-447_org mozilla firefox
After this PR

@domel
Copy link
Contributor Author

domel commented May 8, 2023

I'm a bit surprised that you don't see the differences between these two websides of spec. I specifically tested it on 43 different devices and it displays the same bad everywhere. It is worth remembering that nowadays more traffic is generated by mobile browsers than by desktop browsers. IMO it's worth taking care of these users. Maybe I'm weird or maybe it's because I used to be a front-end developer.

@pfps
Copy link
Contributor

pfps commented May 8, 2023

Just because there is more traffic from mobile browsers in general doesn't mean that there is any significant traffic to W3C recommendations from mobile browsers. If this change makes viewing worse from larger-screen devices then it needs to be rethought.

1 similar comment
@pfps
Copy link
Contributor

pfps commented May 8, 2023

Just because there is more traffic from mobile browsers in general doesn't mean that there is any significant traffic to W3C recommendations from mobile browsers. If this change makes viewing worse from larger-screen devices then it needs to be rethought.

@domel
Copy link
Contributor Author

domel commented May 8, 2023

@pfps If you think that the current desktop view is not good enough, I can improve it so that different styles are for desktop and different for mobile devices.

@domel domel requested a review from gkellogg May 8, 2023 17:01
@domel
Copy link
Contributor Author

domel commented May 8, 2023

you can check again

@afs
Copy link
Contributor

afs commented May 8, 2023

There are three or four cases here:

  • PC Full screen (wide)
  • PC - narrow window
  • Tablet (landscape/portrait)
  • Phone (landscape/portrait)

Concepts isn't a good example - it has two tables, both of which are additionally style with ".simple" but I do see a worsening:

PC - narrow window: Chrome : different tabs, same window.

main
Screenshot from 2023-05-08 17-34-57

rwd
image

SPARQL Query:
A little narrowed than the concepts screenshots.

main
Screenshot from 2023-05-08 17-56-23

rwd
Screenshot from 2023-05-08 17-56-47

Would break-word would be better? It then should not spill the right-hand-side and it does not break the rule numbering at least for PC-narrow.

I've uploaded SPARQL query from "main", from "rwd" and with work-break to make it easier to try out at different widths and different devices:

https://afs.github.io/sparql-respec/Screen/sparql-query/index.html#sparqlGrammar

https://afs.github.io/sparql-respec/Screen/sparql-query-rwd/index.html#sparqlGrammar

https://afs.github.io/sparql-respec/Screen/sparql-query-break-word/index.html#sparqlGrammar

@pfps pfps added the needs discussion Proposed for discussion in an upcoming meeting label May 8, 2023
@gkellogg
Copy link
Member

gkellogg commented May 8, 2023

I think word-break probably works better. There's only so far we can go to make these tables look reasonable on a phone, but some provisions for different breaks probably makes sense on sufficiently small windows, and the media query is the right way to go.

@afs
Copy link
Contributor

afs commented May 8, 2023

The "media" seems to stop zooming out to see the table, whereas the current set up does (Chrome on a OnePlus6).

@TallTed
Copy link
Member

TallTed commented May 9, 2023

@TallTed
Copy link
Member

TallTed commented May 9, 2023

The Web-Developer Extension can be helpful for previewing such things in various screensizes (click to activate the extension, then the Resize tab, then View Responsive Layouts). If the preset sizes are not sufficient, you can Edit Resize Dimensions....

I would not expect many people with the tiniest phone screens to try to read docs like these thereon. Tablets, large phone screens, desktop, and printout should be our primary concerns.

@afs
Copy link
Contributor

afs commented May 9, 2023

@TallTed - no longer relevant, due to later changes, and the setting is deprecated.

https://afs.github.io/sparql-respec/Screen/

@domel
Copy link
Contributor Author

domel commented May 9, 2023

I would not expect many people with the tiniest phone screens to try to read docs like these thereon. Tablets, large phone screens, desktop, and printout should be our primary concerns.

I may not be representative but I read W3C specs on a smartphone 90% of the time.

@TallTed
Copy link
Member

TallTed commented May 10, 2023

@domel — What's your smartphone's screen size & resolution?

My current iPhone 12 Pro Max is 6.7″, and 1284 x 2778 pixels at ~458 ppi. I could read most W3 TRs on it, but I find the touch environment ill-suited to my web surfing.

The original iPhone was ~3.5", 320 x 480 pixels at 163 ppi, and I think very few — even fewer than those who would use their phone to read W3 TRs — are still using such. These would be the people "with the tiniest phone screens" I referred to.

I also think that those who are most likely to read W3 TRs on phone screens are also the most likely to have the largest phone screens with the most pixels available.

@pfps pfps removed the needs discussion Proposed for discussion in an upcoming meeting label May 11, 2023
code { color: #ff4500; } /* Old W3C Style */
div.abnf { margin-left: 1em; }
@media (max-width: 850px) {
table { overflow-wrap: anywhere !important; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What effect does !important have here?

@TallTed
Copy link
Member

TallTed commented May 17, 2023

The most complex table in this doc is labeled A list of the RDF-compatible XSD types, with short descriptions" (and that trailing quotation mark should be deleted), in §5.1 The XML Schema Built-in Datatypes. This table currently exhibits mid-word breakage enabling the table to fit within the smaller windows, instead of keeping words unbroken and overflowing window width.

I'm wondering, why are the CSS changes not the same for all documents? Possibly because they were created over time, and hence got different CSS to start? It seems to me it would be better to make the same CSS apply to all the documents, though I'm sure this will entail a fairly large piece of work.

gkellogg added a commit that referenced this pull request May 17, 2023
@gkellogg
Copy link
Member

I fixed the trailing quote issue.

@domel
Copy link
Contributor Author

domel commented May 18, 2023

I'm wondering, why are the CSS changes not the same for all documents? Possibly because they were created over time, and hence got different CSS to start? It seems to me it would be better to make the same CSS apply to all the documents, though I'm sure this will entail a fairly large piece of work.

Unfortunately, HTML in documents is very dirty and heterogeneous. Probably because a lot of people edited them for many years. I think I'll try to unify the specs structure in the near future, but it's a complicated endeavor that will take me a couple of weeks. Of course, I think it lends itself to new PRs.

@gkellogg gkellogg merged commit d310888 into main May 18, 2023
@gkellogg gkellogg deleted the rwd branch May 18, 2023 16:02
pfps added a commit that referenced this pull request Jul 20, 2023
gkellogg pushed a commit that referenced this pull request Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:editorial Minor issue or proposed change in the specification (markup, typo, informative text)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants