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

✨ Show label when live story is updated and user is on last page. #22700

Merged
merged 7 commits into from Jun 12, 2019

Conversation

Enriqe
Copy link
Contributor

@Enriqe Enriqe commented Jun 5, 2019

Follow up for #22519
Partial for #21714

Shows a label when a live story is updated with new pages and the user is on the last page.

Preview:

ezgif-1-0464c6e653dd

EDIT: updated UX
liveupdate

3panelsupdatev2

@lgtm-com
Copy link

lgtm-com bot commented Jun 5, 2019

This pull request introduces 1 alert when merging e009887 into 7d9c822 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@Enriqe
Copy link
Contributor Author

Enriqe commented Jun 10, 2019

Updated the PR with the most recent UX spec. PTAL.

See previews below for reference:
mobileupdate
3panelsupdate

You'll notice that on the three panel view, the pagination button isn't updated when there is a new page. This is tracked here #22770

@newmuis
Copy link
Contributor

newmuis commented Jun 10, 2019

Actual Expected
Screenshot of actual live list indicator UI Mock of expected live list indicator UI

Some quick minor UI nits:

  • Can't tell if it's just because of the low fidelity of the GIF, but it looks like there's only one circle and not two?
  • The font should be bold
  • The mocks look like the corners are not completely sharp; @hongwei1990 can you verify?
  • It looks like there's too much space on the left and/or too little space on the right

Note that I haven't actually taken a look at the code yet; this is all based on the rendering in the GIF

@Enriqe
Copy link
Contributor Author

Enriqe commented Jun 10, 2019

Can't tell if it's just because of the low fidelity of the GIF, but it looks like there's only one circle and not two?

Yep, it's the gif, sorry. Here is a screenshot with a better resolution of how it actually looks. You can see that the font is already bold.

I corrected the opacity of the outer circle to the spec and now it's clearer that there are two circles. I also added a border radius for the box edges but I will increase it to make it look more like the mocks since I didn't get an exact number.

Also added a bit more space on the right.

image

@gmajoulet
Copy link
Contributor

gmajoulet commented Jun 10, 2019 via email

if (!this.isBuilt_) {
return;
}
this.vsync_.mutate(() => {
this.getShadowRoot().setAttribute(MESSAGE_DISPLAY_CLASS, 'noshow');
this.getShadowRoot().setAttribute(message, 'noshow');
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I know this is the type of thing that's very difficult to test (manually, or in any automated fashion), but how do multiple messages override each other? Does the first one just disgust completely once the second one comes in?

I suspect that would be the case, but I'm not actually sure whether that's okay? This can result in weird edge cases when one message is triggered right after another. It's probably fine if it's two audio message since they'd both come from user interactions, but if it's an audio message followed by a live list update, the user won't have had time to read the audio message.

Should we consider queuing the messages like toast frameworks (likely) would?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested it and right now they are both shown, and eventually disappear. Since this seems to be a very specific edge case, do you mind if I address it in a follow-up?

I filed #22778 to keep track.


.i-amphtml-story-has-new-page-circle-icon {
background: rgba(3, 255, 160, 1) !important;
border-radius: 50% !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have a 4px border at rgba(3, 255, 160, 0.5)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did you mean to comment this on the line below of the box-shadow, which represents the outer circle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If so, according to the spec the outer circle is supposed to be 10px in width, while the inner circle is 6px in width.

And if I understand correctly, the box-shadow spread property specifies the radius of the circle. Meaning that if we want a 10px-wide circle, then the want to have a 5px radius. And since the inner circle is a 6px-wide circle (with a radius of 3px), then the box-shadow spread property should be 2px to add up to a total radius of 5px, giving us a 10px-wide outer circle.

Copy link
Contributor Author

@Enriqe Enriqe left a comment

Choose a reason for hiding this comment

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

Could you please post a screenshot of that UI when displayed RTL?

Thanks for bringing it up, I had screwed up RTL with my latest commit. I fixed it now. Here you can see the latest screenshots:

LTR:

image

RTL:

image

@Enriqe
Copy link
Contributor Author

Enriqe commented Jun 11, 2019

This is ready for another review 👍

Copy link
Contributor

@newmuis newmuis left a comment

Choose a reason for hiding this comment

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

Would be good to add a visual test for this; could come as a separate PR

extensions/amp-story/1.0/amp-story-system-layer.css Outdated Show resolved Hide resolved
extensions/amp-story/1.0/amp-story-system-layer.css Outdated Show resolved Hide resolved
@Enriqe
Copy link
Contributor Author

Enriqe commented Jun 11, 2019

Would be good to add a visual test for this; could come as a separate PR

Sounds good, will do in a follow up PR. Thanks both!

@Enriqe Enriqe merged commit 53351cb into ampproject:master Jun 12, 2019
@Enriqe Enriqe deleted the story-updated-label branch June 12, 2019 21:03
thekorn pushed a commit to edelight/amphtml that referenced this pull request Sep 11, 2019
…pproject#22700)

* show label when story is updated and user is on last page.

* better translation label & use same timeoutid.

* revised position and style of label according to newest UX spec.

* add more space on the right of the text and increase border radius.

* fix padding and circle color values.

* fix rtl, add i-amphtml prefix

* fix css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants