-
Notifications
You must be signed in to change notification settings - Fork 591
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
Pro 6518 mobile preview #4720
base: main
Are you sure you want to change the base?
Pro 6518 mobile preview #4720
Conversation
modules/@apostrophecms/ui/ui/apos/scss/global/_device_preview.scss
Outdated
Show resolved
Hide resolved
sourceMap: true | ||
} | ||
} | ||
mediaToContainerQueriesLoader, |
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.
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.
Other stuff:
- On first activation the canvas has no height. I think we’re supposed to simulate actual device heights, but in lieu of not having a height we should set the height to something like 100vh - (admin bar height + canvas margin)
- A small setting label should be above the upper left corner of the canvas
- For now, disable resize
- There needs to be style differentiation between the resized site and the layer the canvas ‘sits on’. The layer behind the canvas should be a light gray while the canvas should be styles as they define. What if they style the ? Currently the refreshable container doesn’t have any style applied and if you style the body you get this. This seems like a big hole. If you style the body things currently look like this
See https://www.sketch.com/s/fbfcda4a-08a4-4c8d-ab88-fdad7532217e/a/ZVqLgA7
- Moving from page to page should preserve your preview setting. Currently it does not.
withdrawn style comment
</script> | ||
<style lang="scss" scoped> | ||
.apos-admin-bar__device-preview-mode { | ||
margin-left: 22px; |
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.
round to 20px (base * 2)
|
||
.apos-admin-bar__device-preview-mode-button { | ||
& + & { | ||
margin-left: 6px; |
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.
Round to 5px (base / 2) ..
Also, this UI seems like flex + gap would be good
// Breakpoints | ||
breakpoints: { | ||
// If we can resize the preview container? | ||
resizable: false, |
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.
move this up a level?
// Screen list with icons | ||
// For adding icons, please refer to the icons documentation | ||
// https://docs.apostrophecms.org/reference/module-api/module-overview.html#icons | ||
screens: { |
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.
breakpoints = screens?
desktop: { | ||
label: 'apostrophe:devicePreviewDesktop', | ||
minWidth: 1024, | ||
icon: 'monitor-icon' | ||
}, |
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.
These need to be able to support heights?
@@ -0,0 +1,71 @@ | |||
module.exports = function (source) { |
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.
The road to hell is paved with good intentions
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.
Stu covered the territory well.
Device heights are part of the tech design and should be implemented, the view should be scaled so that you can see the entire device showing its first page in terms of height, and its scrollbar should be based on its native height. People will want to know what is "above the fold" (might seem a tired concept, but valid for stuff like logos that had better fit on the first screen for instance)
@stuartromanek still working on
the rest is there |
@haroun looked at this again, really shaping up. I committed a few style adjustments rather than go back and forth here. Be sure to pull! I see the page-to-page stuff is still being worked out, no worries there Two main issues I see The content here runs out of the preview container but currently there is no ability to scroll. Fix here is fairly obvious, the container should scroll. If possible, disable scroll on the X axis. Naively
The second issue being that the body styling issue is still not solved. Left has the site's real body style, right its being overridden to provide the canvas background. |
height: screen.height | ||
} | ||
}, | ||
shortcut: `P,${index}` |
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.
shortcut: `P,${index}` | |
shortcut: `P ${index}` |
seems more UX-friendly to me
Summary
Add mobile preview feature to the admin UI
What are the specific steps to test this change?
https://preview.a3.apos.dev/
or
devicePreviewMode
option in your projectWhat kind of change does this PR introduce?
(Check at least one)
Make sure the PR fulfills these requirements:
If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.
Other information: