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

✨<amp-next-page> v2 default and templated footers (more articles box) #26610

Merged
merged 10 commits into from
Feb 11, 2020

Conversation

wassgha
Copy link
Contributor

@wassgha wassgha commented Feb 4, 2020

Screen Shot 2020-02-03 at 11 26 33 PM

Changes

  • Implements a default footer/"more articles box" that can be customized with CSS and that shows articles that have not been loaded. Appears in two cases: when a page fails to load/fetch/insert, and when the user scrolls so fast to the bottom of the page that inserting a new article would cause a layout shift.
  • Changes the default separator to render the title and image of the upcoming article
  • Shortens class names of public CSS for the separator and footer elements
  • Allows the default separator element to truncate the article's title if necessary
  • Fixes a bug that caused an assertion to fail (where the page was at a state where it was both un-inserted yet visible which should never happen)
  • Fixes bug where the separator would be visible even if the page fails to load or is still fetching

@wassgha wassgha marked this pull request as ready for review February 6, 2020 19:04
buildDefaultFooter_() {
const html = htmlFor(this.getHost_());
return html`
<div class="amp-next-page-footer" aria-label="Read more articles"></div>
Copy link
Member

Choose a reason for hiding this comment

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

What happens with i18n for this aria-label?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Blocked by #4146 I don't think there's a nice way to do it so far. Lightbox and carousel controls do the same.

Copy link
Member

Choose a reason for hiding this comment

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

Let's expose this as an optional data-read-more-label then.

extensions/amp-next-page/1.0/service.js Show resolved Hide resolved
extensions/amp-next-page/1.0/service.js Outdated Show resolved Hide resolved
extensions/amp-next-page/1.0/service.js Outdated Show resolved Hide resolved
extensions/amp-next-page/1.0/service.js Outdated Show resolved Hide resolved
extensions/amp-next-page/1.0/service.js Show resolved Hide resolved
extensions/amp-next-page/1.0/page.js Outdated Show resolved Hide resolved
extensions/amp-next-page/1.0/page.js Outdated Show resolved Hide resolved
extensions/amp-next-page/1.0/service.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants