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

Add Twentyseventeen Infinite Scroll support #5940

Conversation

stoyan0v
Copy link
Contributor

Fixes #5920

Infinite Scroll not working with Twenty Seventeen

Changes proposed in this Pull Request:

Add twentyseventeen.php file in infinite-scroll/themes that includes the correct template parts.
Add styles that match the Twenty Seventeen structure

Testing instructions:

  • Activate Twenty Seventeen and Infinite Scroll and verify that the posts are loaded.

@jeherve jeherve added [Feature] Infinite Scroll [Pri] Normal [Status] Needs Review This PR is ready for review. [Team] tdiv [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Dec 19, 2016
@jeherve jeherve modified the milestones: 4.6, 4.5.1 Dec 19, 2016
@dereksmart dereksmart modified the milestones: 4.5, 4.5.1 Jan 3, 2017
@samhotchkiss
Copy link
Contributor

@mendezcode is on maintenance this week, and should be able to take a look!

@samhotchkiss samhotchkiss modified the milestones: 4.6, 4.5 Jan 6, 2017
@laurelfulford
Copy link
Contributor

Thanks for this PR, @stoyan0v!

Overall it looks good! I did a review and found some issues - most are quite small and nitpicky, please don't be daunted by the length:

Functional

  • Twenty Seventeen has two footer widget spaces — sidebar-2 and sidebar-3. The infinite scroll setting just need to check for widgets in these spaces to see whether it should be switched to click-to-scroll. There's an example of this in the code for Twenty Thirteen.

  • In some themes we also check for other content under the posts — usually a social media menu — to see if infinite scroll should be click-to-scroll (there’s an example of that in the Affinity theme here with the affinity_has_footer_widgets() function). Since Twenty Seventeen's social links only show in the footer area, what do you think about adding a check for it, too?

Code

  • Very minor, but there are a couple tabs on empty lines, and one after the code ends in the RTL styles -- specifically on lines 116 and 124 on empty lines, and on 137 after the opening curly bracket.

Visual

  • The #infinite-footer never displays for me, and the regular footer is visible briefly when you get to the end of the posts, before new posts are loaded. I'm not sure if this is intentional - if not, there are some example styles to hide the different footers under the "Do it With Style" header here.

  • The infinite loader doesn’t appear to be aligned correctly. When there are no sidebar widgets, the posts display in the right column, and the loader appears centred to the page (example). When there are sidebar widgets, the posts appear in the left column, and the loader appears flush to the left (example). It seems like it should be centred under the posts column in both cases.

  • Not sure if this is intentional, but some styles don’t appear to be correct for the theme:

    • The fonts Merriweather and Georgia aren't used in the theme
    • The colour blue is used for hover styles in the infinite scroll styles, but the theme is monochromatic. Both can be seen with the 'Older Posts' button, regular and hover, compared to the theme’s button styles, regular and hover.
    • There's a body:not(.custom-background-image) selector, but the theme doesn’t support custom backgrounds (this may be a standard infinite scroll style though - I noticed it's in the other default themes' styles).
    • It's less noticeable, but the infinite footer styles also don't use the theme's colours for links which are #222222 for regular links and #767676 on hover.
  • Twenty Seventeen has two custom colour options - a dark colour scheme, and a "custom" scheme determined by a hue slider. For the dark scheme, the 'Older Posts' button colour should change to a lighter shade using the .colors-dark class added to the body. For the custom hue slider scheme, a .colors-custom class is added but the colour that's used is dynamic. It should be possible to inherit the colour most of the time, but some elements may need to stay greyscale. These schemes can be tested under Customizer > Colors.

Some of the theme's styles can be a bit confusing when it comes to the different layouts, and different colour schemes. Please let me know if I can help at all with adjusting those styles, or if you have any questions at all about the above!

@jeherve jeherve added [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Jan 9, 2017
@jeherve jeherve modified the milestones: 2/17 - February, 4.7.0 - March 2017 Jan 30, 2017
@samhotchkiss samhotchkiss removed this from the 4.7.0 - March 2017 milestone Feb 3, 2017
@stoyan0v
Copy link
Contributor Author

stoyan0v commented Feb 7, 2017

Hey @laurelfulford, thank you for the review and sorry for late response.
I've addressed most of the issues, and I think that I will have the final version by the end of the week.

There is something that I would like to discuss.
When we use custom color scheme, I'm unable to style the button with appropriate color.
The problem is that "Infinite Scroll" style the #infinite-handle span element instead the button.
I've tried to style the button, so it can inherit the theme styles, but then infinity.css overwrites it, because it has larger selector #infinite-handle span button ( the theme uses .colors-custom button).

So it seems that the button can't be styled using css only. There is a filter that we can use twentyseventeen_custom_colors_css and we can add our styles, but I am not sure that we need this for only 2 css rows.

Let me know what do you think, and again thank you for your review.

@jeherve jeherve added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Feb 8, 2017
@laurelfulford
Copy link
Contributor

Thanks @stoyan0v!

When we use custom color scheme, I'm unable to style the button with appropriate color.

Ah, too bad! I wasn't sure it would be possible, since the styles are applied to a span rather than the button for infinite scroll. Thanks for giving that a shot!

Using twentyseventeen_custom_colors_css does seem like a bit of overkill for this one case - I'd personally be fine with the button just staying greyscale for the custom colour scheme, like it is with the default colours.

@jeherve jeherve added [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Feb 14, 2017
@stoyan0v stoyan0v force-pushed the fix/add-twentyseventeen-infinite-scroll-support branch from b9410f7 to ea2da6d Compare February 15, 2017 12:27
@jeherve jeherve added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Feb 15, 2017
@laurelfulford
Copy link
Contributor

Sorry for the delay @stoyan0v !

Overall, this is looking great - thank you for putting in all this work!

I found a couple small things from the original list, but they’re very nitpicky:

  • In the twentyseventeen_has_footer_widgets() function, the social menu ID used doesn’t match what’s used in the theme (I think it might be from the example I provided). It should be has_nav_menu( 'social' ).

  • For the infinite scroll button, the colour updates look good! I would just suggest a small change: right now the button text colour is #777 when using the dark scheme, which is a bit lighter than other buttons and has low contrast on hover: https://cloudup.com/caLxRSdTw2C Can this be updated to #222 like the others?

  • Lastly, just some small code formatting things in the CSS:

    • Lines 116 and 122 - code is indented with spaces instead of tabs (in both CSS files)
    • Line 146 - space at end of line (in both CSS files)
    • Line 161 - space at end of line (only in twentyseventeen.css)
    • Line 164 - tab on an otherwise empty line (in both CSS files).

That’s it! Just let me know if you have any questions at all about the above!

@jeherve jeherve added [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Feb 21, 2017
@stoyan0v
Copy link
Contributor Author

Hey @laurelfulford, thanks again for your review.

I have addressed these small issues, so I will appreciate if you can have a look again ( maybe for last time 😄 ).

@jeherve jeherve added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Feb 22, 2017
@laurelfulford
Copy link
Contributor

Thanks @stoyan0v! Everything looks good to me - I have no further changes 👍

Copy link
Member

@zinigor zinigor left a comment

Choose a reason for hiding this comment

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

Tested on twentyseventeen both with footer widgets and without them - works fine!

@zinigor zinigor added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Feb 27, 2017
@ericswpark
Copy link

Hi, I would really like this merged in as soon as possible because it's a PITA to press pages when I scroll to the end. Thanks!

/**
* Add theme support for infinite scroll
*/
function twentyseventeen_infinite_scroll_init() {
Copy link
Member

@dereksmart dereksmart Feb 28, 2017

Choose a reason for hiding this comment

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

hey @stoyan0v! this all looks great and I'd really like to merge this today to make it into the next release.

My only request is to please name space the functions in this file with jetpack_ to eliminate any possibility of redeclaration. Thanks!

(mostly looking at twentyseventeen_has_footer_widgets(), the rest will probably be fine but won't hurt to change for consistency)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @dereksmart. I have namespaced all functions for twentyseventeen.
I didn't add the prefix in the beginning, because the functions in other theme files don't have such( twentysixteen.php, twentyfifteen.php etc ) . So I think that it will be nice to add such prefix to all themes too. I can prepare a separate PR if you agree with me.

Copy link
Member

Choose a reason for hiding this comment

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

@stoyan0v thanks, yes that makes sense and a PR would be most welcome :)

@jeherve jeherve dismissed dereksmart’s stale review February 28, 2017 14:05

Functions are now namespaced.

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This looks good. Merging!

@jeherve jeherve merged commit b46cf65 into Automattic:master Feb 28, 2017
@jeherve jeherve added [Status] Has Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Feb 28, 2017
jeherve added a commit that referenced this pull request Feb 28, 2017
@georgestephanis
Copy link
Member

Added this to phabricator for the wpcom merge of it as D4556

dereksmart pushed a commit that referenced this pull request Feb 28, 2017
* Changelog: update stable tag and move changelog to changelog.txt

Also remove old releases from readme.txt to keep the changelog tab short.

* Changelog: add #5883

Also update the filter's docblock to match new version.

* Changelog: add #5938

* Changelog: add #6298

* Changelog: add #3405

* Changelog: add #5941

* Changelog: add #6239

* Changelog: add #6281

* Changelog: add #6303

* Changelog: add #6018

* Changelog: add #6300

* Changelog: add #6296

* Changelog: add #6130

* Changelog: add #6292

* Readme: remove extra "on".

* Changelog: add #6307

* Changelog: add #3297

* Changelog: add #6275

* Changelog: add #6321

* Changelog: add #6297

* Readme: update the support forum link anchor.

Anchor changed when WordPress.org forums were updated to bbPress 2

* Readme: update list of a12s, it wasn't up to date anymore!

* Changelog: add #6338

* Changelog: add #6337

* Changelog: add #6335

* Changelog: add #6333

* Testing List: first version of the 4.7 testing list.

* Changelog: add #6332

* Changelog: add #6325

* Changelog: add #6326

* Changelog: add #6339

* Changelog: add #6342

* Changelog: add #6343

* Changelog: add #6346

* Changelog: add #6347

* Changelog: add #6279

* Changelog: add #6306

* Changelog: add #6312

* Changelog: add #6316

* Changelog: add #6171

* Changelog: add #6317

* Changelog: add #6246

* Changelog: add #6263

* Changelog: add #4220

* Changelog: add #5888

* Changelog: add #3406

* Changelog: add #3637

* Changelog: add #6320

* Changelog: add #5992

* Changelog: add #6322

* Changelog: add #6324

* Changelog: add #6352

* Changelog: add #6355

* Changelog: add #6360

* Changelog: add #6362

* Changelog: add #6369, #6382

* Changelog: add #6370

* Changelog: add #6375

* Changelog: add #6383

* Changelog: add #6384

* Changelog: add #6386

* Changelog: add #6395

* Changelog: add #6403

* Changelog: add #6406

* Changelog: add #6418

* Changelog: add #6419

* Changelog: add #6434

* Changelog: add #6446

* Changelog: add #6006

* Changelog: add #6096

* Changelog: add #6399

* Changelog: fix typo.

@see #6331 (comment)

* Changelog: add #6440

* Changelog: add #6443

* Changelog: add #6445

* Changelog: add #6463

* Changelog: add #6468

* Changelog: add #6471

* Changelog: add #6474

* Changelog: add #6480

* Changelog: add #6497

* Changelog: add #6499

* Changelog: add #6514

* Changelog: add #6267

* Changelog: add #5940

* Changelog: add #6492

* Changelog: add #5281

* Changelog: add #6327

* Changelog: add #6451

* Changelog: add #6525

* Changelog: add #6530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Infinite Scroll [Pri] Normal [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants