fix(COT-120): Fix dialog OK button clipped/inaccessible on small mobile viewports#188
Conversation
…l screens Agent-Logs-Url: https://github.com/Coteh/wordle-clone/sessions/2566ffb1-0cff-450b-b931-4e0a7f5d4c82 Co-authored-by: Coteh <[email protected]>
Deploying wordle-clone with
|
| Latest commit: |
ca31bd4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b3144b0c.wordle-clone-8k1.pages.dev |
| Branch Preview URL: | https://copilot-fix-dialog-ok-button.wordle-clone-8k1.pages.dev |
Test Results 16 files ±0 101 suites ±0 5m 17s ⏱️ +9s For more details on these failures, see this check. Results for commit ca31bd4. ± Comparison against base commit a864999. ♻️ This comment has been updated with latest results. |
|
@copilot Can you remove the padding you added to the dialog so that the content will once again go to the edges of the dialog? |
…dges Agent-Logs-Url: https://github.com/Coteh/wordle-clone/sessions/24ce9b91-f912-4d34-bf15-f4a8627a4f1f Co-authored-by: Coteh <[email protected]>
|
@copilot That padding removal still didn't seem to remove the upper and lower padding. Can you readd the padding I asked you to remove earlier, as I like the left and right padding. I just want the upper and lower paddings gone. It's possible it might be something in the parent element doing this. |
…on dialog-content Agent-Logs-Url: https://github.com/Coteh/wordle-clone/sessions/561100d0-c975-4b56-ac75-db4d12c6e75b Co-authored-by: Coteh <[email protected]>
Done in de7c147. The top/bottom gap was coming from the browser's default padding on the |
|
@copilot The dialogs were given space at the top before to make room for the X (close) button. That spacing is gone now, when it should be there. Also, the changelog dialog content now has more horizontal space to the point where you can scroll horizontally, when you shouldn't be able to do that; all the changelog content should be in view and within the padding. |
… overflow in dialog-content Agent-Logs-Url: https://github.com/Coteh/wordle-clone/sessions/039ef221-9ce3-450a-90e9-d4a63fb4f811 Co-authored-by: Coteh <[email protected]>
Fixed in 6e808d9:
|
|
@copilot Even though the left and right padding hasn't changed, Also, remove the horizontal scrolling lock for now. I don't want to paper over any potential issues. |
Fixed in 4459331:
|
|
@copilot Can you take a look at the specific customizations I specified for the changelog dialog? I'm wondering why the changelog dialog looks smaller now than before... |
Fixed in ca31bd4. The root cause: the changelog dialog's JS Updated the changelog dialog's style options to add them back explicitly:
|
On older/smaller mobile devices (e.g. iPhone 6), dialogs extended beyond the viewport height with no clamping, leaving the OK button visually squished or completely inaccessible. The root cause was twofold: no
max-heighton.dialog, and.dialog-contentusingposition: absolutewithjustify-content: center— a combination that causes content to be clipped symmetrically at both ends when overflowing, making the top unreachable and the bottom hidden.CSS changes (
index.css).dialog— addmax-height: 90vhto cap dialog height; adddisplay: flex; flex-direction: columnto enable proper flex child sizing; addpadding: 0to suppress the browser's UApadding: 1em(top/bottom gap); increasewidth: 300px→340px(and250px→290pxin themax-width: 320pxmedia query) to absorb the 2×1emhorizontal padding that was previously included in the visual width via the old absolute-positioned layout.dialog-content— replace absolute positioning (position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); height: 100%) withflex: 1; min-height: 0so it fills the bounded dialog and shrinks correctly; changejustify-content: center→flex-startto avoid the overflow+center clipping bug;overflow: auto→overflow-y: auto; setpadding: 2rem 2rem 0(left/right padding preserved, top padding retained for close-button clearance, no bottom padding)JS changes (
src/index.js)renderDialogstyle options to restore original visual dimensions after the browser UA padding reset:width: "calc(75% + 2em)",height: "calc(75% + 2em)",maxWidth: "640px". The old absolute-positioned.dialog-contentmeasuredwidth: 100%against the dialog's padding box (content + 2×1emside padding), so the dialog appeared 40px wider/taller than the specified percentage. Thecalcvalues restore that visual size explicitly.Tests (
cypress/e2e/game/viewport.cy.js)Screenshots
Migration dialog at 375×667 (iPhone 6 size):
How to Play dialog at 375×667:
Original prompt