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-sidebar #2461

Closed
wants to merge 4 commits into from
Closed

amp-sidebar #2461

wants to merge 4 commits into from

Conversation

camelburrito
Copy link
Contributor

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@camelburrito camelburrito force-pushed the sidebar branch 11 times, most recently from 3571d70 to 1ac272c Compare March 6, 2016 04:35
@camelburrito
Copy link
Contributor Author

I signed it!

<table>
<tr>
<td width="40%"><strong>Description</strong></td>
<td>A sidebar provides a way to display meta content intended for temporary access (navigation buttons, chat contact list, etc.),.The sidebar can be revealed by a button tap while the main content remains visually underneath.</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Comma between these two sentences should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

.amp-sidebar-closed amp-sidebar,
.amp-sidebar-open amp-sidebar {
transition: transform 0.5s ease;
will-change: transform
Copy link
Contributor

Choose a reason for hiding this comment

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

semicolon

Copy link
Member

Choose a reason for hiding this comment

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

you might actually want to add will-change to the default state not on the transition state since you want to give the engine a heads up. (this might be too late).

Copy link
Member

Choose a reason for hiding this comment

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

possibly the most optimal place to actually add this is on your click handlers. where open will add it, then close will remove it. the mutate handler callback gives it enough time to get optimized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dropping will-change for now - will consider adding it if the performance is not very good

/** @private @const {boolean} */
this.hasMask_ = false;

if (this.direction_ != 'left' && this.direction_ != 'right') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we supporting dir="rtl" here as well? It could be a source of the default at the very least.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - changed to use dir and inherit dir from the body

return;
}
const mask = this.document_.createElement('div');
mask.setAttribute('class', '-amp-sidebar-mask');
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's still use classList.add() here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

*/
fixIosElasticScrollLeak_() {
this.element.addEventListener('scroll', e => {
this.mutateElement(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't go in the mutateElement, unfortunately. Maybe vsync? Or maybe even direct since this is a hack. But mutate element will increase risk condition too much. So will vsync, so let's start with them stripped and let's see what profiler says.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to work well in mutateElement and the direct approach. removing the mutate now.

@camelburrito camelburrito force-pushed the sidebar branch 8 times, most recently from 7a8f159 to fd240ab Compare March 30, 2016 22:44
- Fix for Ios elastic scrolling
- Fix for viewer top padding.
- Disable touch zoom.
- Review comment fixes.
- Support for dir instead of direction.
- Remove vsync and add a padding fix by creating dummy elements.
- Add more tests.
- linting.

Disable zoom on sidebar open
…ayout type to no-display and add aria support.
@camelburrito
Copy link
Contributor Author

split and submitted as smaller PRs

#2788 , #2792, #2795 , #2811, #2812, #2813, #2823

@camelburrito camelburrito deleted the sidebar branch April 13, 2016 00:16
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

Successfully merging this pull request may close these issues.

6 participants