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 orientation and device attributes on the amp-story element. #21301
Conversation
c20d8c6
to
e0c64fe
Compare
I think the |
I've been playing a bit with these and tried to think of how our product will evolve. I'll use an example to make it easier to follow: I'm publisher X, and I write 30 stories. I design a nice template that's using My point is that I can see cases where we'll want multiple attributes, like for example: Option A Option B Option C What do you think? |
Sorry about the double notification, there's also the option D where we remove the |
e0c64fe
to
ade2296
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :) Only one question I'm curious about
@gmajoulet Thanks for thinking this through! I think your comment brings an important point to the surface: the distinction between the device (or its capabilities) and the "UI type." Currently, we're kind of conflating the two. In your example, a publisher might want to style a story differently on Google Home Hub because of its capabilities (e.g. smaller screen real estate). A UI type, on the other hand, should generally describe the presentation of the content. An example is our current "3 panels" vs. "fullbleed" UI types; they are both reasonable choices given the same device and set of capabilities; it's just the publisher's decision to choose between those two. I actually think that it is working as intended that we "Can't introduce specific mobile modes like google-home-hub without breaking most publishers;" new UI presentations should always be opt-in, for a publisher. |
So that'd give Can you please confirm these next steps?
|
Yes, I think you've interpreted what I'm saying correctly. For action item (2), I think we should decide whether it's actually useful to expose this type of information, or whether this is a case where publishers are better off using media queries. I've been against using media queries because publishers are really trying to discern the UI type. But if there's a UI type that works across multiple screen sizes (say, the |
ade2296
to
c8104d9
Compare
Thanks for all the feedback :) PTAL |
I think this is the part that I disagree with; we are really encoding more than just "landscape" vs. "portrait" into this attribute, and I think it will help us not have breakages in the future to truly treat this as an enum. It doesn't matter so much for the store, since its state is internal, but I think it matters just in terms of how we think about the attribute. By "landscape" here, we really mean "16:9ish, with a bit of flexibility/responsiveness", but would not, for example, expect 4:1 to work. Similarly, we'd want the flexibility down the line to be able to add a separate "4:1ish, with a bit of flexibility/responsiveness"
I think this is a very important distinction; so important, that we should try to capture it in the name and/or values of the attribute. |
Do you want to turn it into an enum now, or whenever we want to introduce these?
s/orientation/story-orientation? The orientation attribute is on the |
Doesn't seem like it would be too bad to migrate to an enum now? But, more importantly, the attribute values can basically never be changed after we release this, so I think I'd like them to not be "portrait" and "landscape", but rather something closer to what we really mean. Maybe we say something like Sorry for the back and forth here, but I think this is actually really important to get right if it's how we tell publishers to style their stories |
Sounds good, let's sync in person about this and update this thread. :) A few thoughts though: Also, what does it mean for We need to find the sweet spot between what allows publishers to create great stories, and what's easy to use and maintain. |
Synced offline and I'm thoroughly convinced that my feedback in my previous comment was a bad idea 😄 But, it alludes to a larger problem: orientation isn't quite granular enough to let publishers get what they want. For example, iPhone 5 and iPhone X are both portrait, but have drastically different displays. The conclusion we came to is: media queries give this flexibility, but we need to figure out how to make them work based on the size of the story page instead of the size of the viewport. @gmajoulet and I will investigate. |
c8104d9
to
4490a9e
Compare
I'll try to summarize all the conversations we had in a few sentences:
(3) would rely on (2), so I think we still want this PR in, WDYT? |
4490a9e
to
eb4a3db
Compare
PTAL |
Adds a
[orientation=landscape|portrait]
attributes on the<amp-story>
element, meant to make CSS styling across experiences and orientations easier for publishers.This orientation attribute describes how the story is displayed, and not the viewport, like would a CSS media query. Eg: for the desktop three panels UI, the orientation will be
portrait
, when the viewport is actuallylandscape
.Part of #21661