Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions cypress/e2e/start-mobile-overflow.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('start page fits narrow mobile viewports', () => {
for (const width of [320, 375, 390]) {
it(`keeps all page content reachable at ${width}px`, () => {
cy.viewport(width, 812)
cy.visit('/start')

cy.document().then((doc) => {
const style = doc.createElement('style')
style.setAttribute('data-test-unmask', 'overflow')
style.innerHTML =
'html, body { overflow-x: visible !important; width: auto !important; }'
doc.head.appendChild(style)

const viewportWidth = doc.documentElement.clientWidth

expect(doc.documentElement.scrollWidth).to.be.at.most(
viewportWidth
)
expect(doc.body.scrollWidth).to.be.at.most(viewportWidth)
})
})
}
})
8 changes: 4 additions & 4 deletions pages/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Command({ command, event }) {
}

return (
<div className="mt-3 flex items-center gap-3 rounded-xl border border-hairline bg-panel p-3 sm:p-4">
<div className="mt-3 flex min-w-0 items-center gap-3 rounded-xl border border-hairline bg-panel p-3 sm:p-4">
<code className="min-w-0 flex-1 overflow-x-auto whitespace-nowrap text-sm text-ink">
{command}
</code>
Expand Down Expand Up @@ -79,12 +79,12 @@ export default function StartPage() {
</p>

<div
className="mt-10 grid gap-5 md:grid-cols-2"
className="mt-10 grid grid-cols-1 gap-5 md:grid-cols-2"
role="list"
aria-label="Local ways to run OpenAdapt"
>
<article
className="flex h-full flex-col rounded-2xl border border-hairline bg-panel p-5 md:p-6"
className="flex h-full min-w-0 flex-col rounded-2xl border border-hairline bg-panel p-5 md:p-6"
role="listitem"
>
<p className="eyebrow">Command line</p>
Expand Down Expand Up @@ -136,7 +136,7 @@ export default function StartPage() {
</article>

<article
className="flex h-full flex-col rounded-2xl border border-hairline bg-panel p-5 md:p-6"
className="flex h-full min-w-0 flex-col rounded-2xl border border-hairline bg-panel p-5 md:p-6"
role="listitem"
>
<p className="eyebrow">Native app · Beta</p>
Expand Down
Loading