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

Data page should be v2 #1728

Closed
6 tasks
jdlrobson opened this issue Dec 14, 2018 · 0 comments
Closed
6 tasks

Data page should be v2 #1728

jdlrobson opened this issue Dec 14, 2018 · 0 comments

Comments

@jdlrobson
Copy link
Collaborator

Bug

Evidence: What is happening? What are the symptoms? (screenshot here if possible)

Visit https://openlibrary.org/data
on a mobile device. The page is not mobile optimised:

Expectation: What should by happening?

it should be limited to the viewport like the home page https://openlibrary.org

Details: Logged in? Browser type/version? Operating system? Production/dev/local? (if relevant)

All mobile devices

Solution: Proposed solution? Solution requirements?

To migrate a page do the following

  • Set v2 on the page object passed to any templates (e.g. 8d79b57)
  • confirm #test-body-mobile is present in the HTML
  • Load the page and view source. Identify all script tags in the page
  • Ensure the inline scripts in the page are wrapped in a window.q handler
  • Test the page - is everything working as before?
  • Open the page in a mobile browser - is everything working as before. Do any components need optimising for mobile?

Using the window.q handler

e.g.

$( function () {
  doSomething();
} )

becomes:

window.q.push( function () {
  doSomething();
} )

Here's an example for the subject page: 0abff2f

Optimising the page for mobile

Do not change any CSS, instead move any problematic styles on mobile into a media query scoped to desktop. Problematic style properties tend to be float, width and problems relating to the box-sizing model.

Any inline styles should be moved into a component or the legacy.less file.

Here's an example for the subject page:
0fd34b5

jdlrobson added a commit to jdlrobson/openlibrary that referenced this issue Dec 15, 2018
Maintaining both v2 and v1 is becoming a bit of a burden
and resulting in various issues (such as analytics code which
expects a more modern version of jQuery).

I'm pretty confident at this point that we can deploy the
"nuclear" option and make v2 the default.

v2 boolean flags are left in tact as I'm not sure if they serve
any other purposes (for example in API requests)

"Mr President, it is not only possible, it is essential."
Dr Strangelove or: How I learned to stop worrying about making
Open Library mobile friendly

While this makes Open Library fully responsive, there are lots of
opportunities to improve the UI further in mobile.. there's a long
road ahead!

Untested but should also fix: internetarchive#1728 internetarchive#1727

Fixes: internetarchive#679
jdlrobson added a commit to jdlrobson/openlibrary that referenced this issue Dec 15, 2018
Maintaining both v2 and v1 is becoming a bit of a burden
and resulting in various issues (such as analytics code which
expects a more modern version of jQuery).

I'm pretty confident at this point that we can deploy the
"nuclear" option and make v2 the default.

v2 boolean flags are left in tact as I'm not sure if they serve
any other purposes (for example in API requests)

"Mr President, it is not only possible, it is essential."
Dr Strangelove or: How I learned to stop worrying about making
Open Library mobile friendly

While this makes Open Library fully responsive, there are lots of
opportunities to improve the UI further in mobile.. there's a long
road ahead!

Untested but should also fix: internetarchive#1728 internetarchive#1727

Fixes: internetarchive#679
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

1 participant