-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Remove white space mobile view for product page #655
Changes from all commits
f444f26
75a15a0
87d531a
73e2c44
9e5da6c
cb84008
f4843fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,5 +54,8 @@ window.ProductModel = { | |
}; | ||
|
||
window.addEventListener('DOMContentLoaded', () => { | ||
if (Shopify.designMode) { | ||
document.querySelectorAll("[data-shopify-xr-hidden]").forEach(element => element.classList.add('hidden')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this Editor Mobile view, I feel that second button could be displayed inside the editor instead of adding The weird part about it, though, is that merchants wouldn't be able to launch the actual XR (so the button would act as disabled). AFAIK, the I’m also okay with this current solution as it matches the decision we previously made (to have a whitespace). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had a conversation with Ludo on this and I feel like it makes sense to keep it hidden on the browser since this can only be used on the actual device (and it wouldnt work). This way we are also consistent with other themes. @melissaperreault Let me know your thoughts - we can always create a follow up enhancement issue There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to show the button and then use some sort of notification or alert to explain to the merchant that on a mobile device this would activate "view in your space" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But then not all mobile device support the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @LucasLacerdaUX is bringing a good point. We'll need to keep monitoring merchant's experience when they want to validate how the feature will work/display for them and their customers when editing their theme. If they don't see any button in the editor view, regardless if it is compatible or not, they might think it is a bug and could contact support advisor, etc. I am surprised we don't have any insights on that experience yet, isn't it something that was happening on Debut and Narrative already? On the other side, we don't want to show an invalid layout to merchants as they would again perceive it as a bug because they wouldn't be able to compare what is the reality for the same reasons. A potential missed opportunity is to have a fallback CTA label/tooltip in place that informs buyers there is a 3D model available and that they should consider viewing this product on the proper device to have the right experience. cc. @bldelgado Do you recall if this was explored? 🤔 For the short term, I don't mind having this fix until we find the right experience, but in the meantime, I would hope that merchants help docs could inform merchants that they could never see the
I don't think this is the biggest concern as the theme color scheme doesn't allow you to tweak granular colors like that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Most Android/Apple devices will support it. It does not require an app and uses the native functionality of |
||
} | ||
if (window.ProductModel) window.ProductModel.loadShopifyXR(); | ||
}); |
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.
This is overriding the
display: none
we added below:Can you please verify if we need the
.button
before the.product__xr-button
? I don't remember why I added it in the first place, maybe we had some conflict / specificity issue before.EDIT: Now I remember why I added this

.button
. It was being used to override thehover
style, so I believe you don't need it on the main selector and can update it to look like that (and ignore the suggestion in my next comment)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.
It still seems to hide it properly with

display: none !important
applied to it from thehidden
class. From here:So maybe we just don't need that other display none 🤔
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.
That JS solution is only applied on Design Mode. The issue I mentioned above, related to the CSS property, is applied both inside and outside the Editor.
Before / After (outside the Theme Editor)

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.
I can see needing the class
button
because we have a modifier class right after 🤔button--full-width
Good catch on the flex. I am reverting that and will try to align it on the
ipad
breakdown differentlyThere 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.
Ah gotcha, I was focusing on the Editor 🤦 but I see it on the "live" version 👍 good catch.
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.
Oh, I wasn't suggesting to remove the
button
class from the element. Sorry, that was a bit confusing on my first comment.My suggestion was to reduce the specificity from the CSS selector (except on

:hover
):If not possible, then you can apply the solution in my next comment below - to increase the specificity on the selector inside the media query.
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.
I apologize - I misunderstood your comment 😅 I removed the specificity on
product__xr-button
and kept the display flex and it seems to work on all of the scenarios: 1) mobile screens on desktop 2) editor view on mobile 3) actual devices on mobile and tablet