App icon indicating copy to clipboard operation
App copied to clipboard

[$175] mweb - Password-protected PDF screen is cut-off in landscape mode

Open applause-bot[bot] opened this issue 6 days ago • 10 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.5.54-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://github.com/Expensify/App/pull/107691 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: iphone 11/26.2 chrome browser App Component: Other

Action Performed:

Precondition: User have a password-protected PDF into chat

Steps:

  1. Open password-protected PDF
  2. Tap Enter the password
  3. While the password field is focused, rotate the device to landscape

Expected Result:

Screen should be fully visible

Actual Result:

Password-protected PDF is cut-off and arrows are overlapped Also, arrows overlaps with Confirm button in portrait mode

Workaround:

Unknown

Platforms:

  • [ ] Android: App
  • [ ] Android: mWeb Chrome
  • [x] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [ ] Windows: Chrome
  • [ ] MacOS: Chrome Safari

Screenshots/Videos

Bug7324376_1795634527872!IMG_6863

https://github.com/user-attachments/assets/7632d822-daf6-4309-9e0c-6dc02699e69f

View all open jobs on GitHub

Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7324376

Upwork Automation - Do Not Edit

applause-bot[bot] avatar Nov 25 '26 19:11 applause-bot[bot]

While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/576ff57c80462896bf77fb11a02d2f7270adbf3fb72a3a5b186755e197bbe6da

https://platform.applause.com/services/links/v1/external/9eaeb9b50ef0f71b09b89cd7e8fbc8b5b6dcde5953fd145ce15e7f3a00213a92

applause-bot[bot] avatar Nov 25 '26 19:11 applause-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)

Job added to Upwork: https://www.upwork.com/jobs/~022125679146736407760

🤖 Web test steps verification results: ⚠️ partial

Setup blocker on dev NewDot web: the 390×844 viewport exposed zero accessible nodes, and the app session remained suspended. No product failure was established.

Blocked web page at 390×844 viewport
Step Status
Open password-protected PDF.Blocked: no chat or attachment fixture was reachable.
Blocked web page at 390×844 viewport
⚠️
Tap Enter the password and focus input.Blocked: the PDF password form was unavailable.
⚠️
Rotate to landscape while input remains focused.Blocked: no password input could be focused. Desktop emulation also cannot verify the real iOS keyboard.
Related issue: Password input closes after rotating to landscape concerns selection/focus loss, not necessarily this layout defect.
⚠️
Entire password form remains visible and reachable without clipping.Preliminary analysis—low confidence for clipping: the password-form style sets width and flex basis but no vertical bound on its existing ScrollView. This is a plausible short-viewport weakness, but does not explain the reported right-edge truncation conclusively.
Missing evidence: measure viewport, carousel-cell, PDF-canvas and form bounds before focus and after rotation. Distinguish stale horizontal sizing from vertical overflow before choosing a clipping fix; adding scrolling alone is insufficient because a ScrollView already exists.
⚠️
Navigation arrows do not overlap each other or Confirm in landscape or portrait.Root cause supported by code—medium confidence: absolute, high-z-index arrows overlay the carousel, while the full-width password form reserves no navigation gutters. Consequently, an arrow can cover Confirm whenever their vertical positions intersect—even in portrait, without selection changing.
Recommended direction: reserve sufficient navigation space around the protected-PDF form, or obtain design agreement to suppress arrows while the form is displayed. Validate this separately from clipping; neither is yet a verified complete fix.
Alternative checked: phone landscape remains narrow layout, so switching to desktop form width is not supported as the explanation. Static positioning also does not establish arrows overlapping each other. Runtime verification remains blocked.
⚠️

view run · no recording available

MelvinBot avatar Nov 25 '26 19:11 MelvinBot

Proposal

Reproduced the arrow overlap on staging (mWeb, iPhone-sized 390px viewport with touch, a chat containing a normal PDF and a password-protected PDF). Open the protected PDF → "enter the password" → tap the cell: the carousel arrow shows, vertically centered in the cell. With the full 844px height it sits below Confirm, but once the visible height shrinks to what the iOS keyboard leaves (~420px), the arrow lands on top of Confirm (Confirm at y=188–240, arrow centered at ~y=240). I couldn't emulate the real iOS keyboard plus a landscape rotation (that needs the mobile UA's narrow-layout landscape), so the cut-off part below is based on the code.

What is the root cause of that problem?

Arrows over the form (portrait and landscape). The carousel arrows are absolutely positioned on top of the carousel cell (CarouselButtons, styles.attachmentArrow with a high zIndex). The password-protected PDF renders PDFPasswordForm full-width inside that same cell, with no space reserved for the arrows. On touch devices the arrows start visible (useCarouselArrows → useState(canUseTouchScreen)), and every tap on the form toggles them back on through the pager context (BaseAttachmentViewPdf → onTap → useCarouselContextEvents.handleTap). So whenever the Confirm button and an arrow share the same vertical position, the arrow covers Confirm, and tapping the field to type brings the arrows back.

The carousel already has a mechanism for "content that needs the whole cell": while a PDF or image is zoomed, handleScaleChange hides the arrows and handleTap ignores taps. A locked PDF showing the password form is never fed into that mechanism, so the arrows behave as if a normal page were shown.

Cut-off in landscape (from code, not reproduced). getPDFPasswordFormStyle gives the form width/flexBasis: '100%' of the carousel cell. On web the cell width comes from windowWidth (AttachmentCarouselView, cellWidth). On mWeb with the soft keyboard open, the rotation is reported while the input is focused, so the cell and form keep their pre-rotation sizing until the next layout. The form is laid out for the old width and is cut off on the right.

What changes do you think we should make in order to solve the problem?

  1. Hide the carousel arrows while the password form is shown, reusing the zoom path:
    • Add an onPasswordFormVisibilityChange(isVisible) action to AttachmentCarouselPagerContext (next to onTap / onScaleChanged).
    • PDFView calls it when PDFPreviewer renders the password form and when the PDF unlocks. PDFPasswordForm mounting and unmounting are the signal.
    • In useCarouselContextEvents, while the form is visible: call onRequestToggleArrows(false) and make handleTap a no-op, exactly like the zoomed state. On unlock, restore the arrows.
    • Users can still change attachments by swiping. On desktop with a mouse nothing changes, because the form is narrow there (350px) and doesn't reach the arrows.
  2. Make the form follow the current viewport on rotation:
    • Have the form size itself from its container (flex: 1, width: '100%', maxWidth from the narrow-layout width) instead of a fixed flexBasis: '100%' that's computed from a stale cell width.
    • Keep the form's existing ScrollView scrollable vertically (flexGrow: 1 on the content) so the field and Confirm stay reachable in the short landscape viewport.

Tests:

  • Unit test for useCarouselContextEvents: with the form visible, handleTap doesn't show the arrows. On unlock, the arrows come back.
  • UI test for PDFView: the pager action is called when the password form renders and when it goes away.
  • Manual test on iOS Safari/Chrome: portrait (Confirm not covered) and rotating to landscape with the field focused.

What alternative solutions did you explore? (Optional)

  • Add horizontal padding to the form equal to the arrow width. On a ~375px phone this squeezes the field and button a lot, and the arrows would still float over the PDF info message. Hiding them (the zoom pattern) is consistent with existing behaviour.
  • Only hide the arrows while the keyboard is open. In portrait the arrows overlap Confirm even before the keyboard opens (reported in the issue), so this wouldn't cover it.

Xch4rt avatar Nov 25 '26 19:11 Xch4rt

@brunovjk Melvin's analysis leaves the landscape cut-off open and only points at the form's missing vertical bound, but the clipping is horizontal: the carousel sizes every cell from windowWidth, while BaseModal always pads the modal by the left/right safe-area insets.

https://github.com/Expensify/App/blob/384aa905484e6a7818870d38254484b74d14138a/src/components/Attachments/AttachmentCarousel/AttachmentCarouselView/index.tsx#L85-L88

https://github.com/Expensify/App/blob/384aa905484e6a7818870d38254484b74d14138a/src/components/Modal/BaseModal.tsx#L309-L318

So in landscape on a notched iPhone each cell is wider than the visible list by insets.left + insets.right, and the right side of the password input and the Confirm button is clipped. I tested this locally with the safe-area insets emulated at 48px — the cell stayed 780px while the list showed 684px, and subtracting the modal's horizontal safe-area padding where cellWidth is computed made the form fit. That fixes it in the one place that produces the width, and it changes nothing wherever the side insets are 0 (portrait, desktop).

Happy to put up a full proposal for this if that's useful.

yusufdeveloper2903 avatar Nov 25 '26 20:11 yusufdeveloper2903

Proposal

Please re-state the problem that we are trying to solve in this issue.

On mobile web (and touch devices), when opening a password-protected PDF in an attachment carousel with multiple attachments:

  1. Tapping enter the password shows PDFPasswordForm, and the carousel navigation arrows (< / >) overlap the Confirm button in portrait mode (especially when the keyboard reduces the viewport height) and in landscape mode.
  2. When rotating a notched mobile device (e.g., iPhone 11 on mWeb Chrome) into landscape mode while the password field is focused, the right side of the password input (including the visibility eye icon) and the Confirm button are cut off past the right edge of the screen.

What is the root cause of that problem?

There are two distinct root causes behind the two symptoms visible in the issue screenshot and reproduction video:

  1. Landscape horizontal cut-off — AttachmentCarouselView computes cellWidth from raw windowWidth without accounting for BaseModal's horizontal safe-area padding (insets.left / insets.right):

    • AttachmentModalContainer (src/pages/media/AttachmentModalScreen/AttachmentModalContainer/index.tsx) renders inside BaseModal (src/components/Modal/BaseModal.tsx).
    • BaseModal computes paddings = StyleUtils.getModalPaddingStyles({..., insets}) (src/components/Modal/BaseModal.tsx:309-318,425), which always applies paddingLeft: safeAreaPaddingLeft ?? 0 and paddingRight: safeAreaPaddingRight ?? 0 (src/styles/utils/index.ts:747-759).
    • On a notched iPhone rotated to landscape on mWeb, useResponsiveLayout keeps shouldUseNarrowLayout = true because isSmallScreenWidth = windowWidth <= mobileResponsiveWidthBreakpoint || isInLandscapeMode (src/hooks/useResponsiveLayout/index.ts:44), while insets.left and insets.right become non-zero (notch / home indicator safe areas). <HeaderWithBackButton> uses flex layout inside the padded modal container, so its < Attachment title and download icon fit properly inside the safe area.
    • However, web AttachmentCarouselView (src/components/Attachments/AttachmentCarousel/AttachmentCarouselView/index.tsx:93) computes: cellWidth = PixelRatio.roundToNearestPixel(windowWidth - (modalStyles.marginHorizontal + modalStyles.borderWidth) * 2) ignoring paddingLeft and paddingRight and never measuring the carousel container's actual rendered width. Because modalStyles.marginHorizontal and borderWidth are 0 in narrow/landscape layout, cellWidth equals the full windowWidth — wider than AttachmentCarouselView's own inner container by paddingLeft + paddingRight.
    • Inside that oversized cell (renderItem at AttachmentCarouselView/index.tsx:216), MobilePDFGestureCanvas (src/components/PDFView/index.tsx:135,153) locks canvasSize.width to the oversized cell width, and PDFPasswordForm renders with styles.getPDFPasswordFormStyle(shouldUseNarrowLayout) (width: '100%'), overflowing and clipping the right edge of both the Password input (cutting off the eye toggle) and the Confirm button.
  2. Carousel arrows overlapping the Confirm button in portrait and landscape:

    • CarouselButtons (src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx:46-83) positions the previous/next buttons absolutely (styles.attachmentArrow with zIndex: 23), vertically centered inside styles.attachmentCarouselContainer.
    • On touch devices, useCarouselArrows (src/components/Attachments/AttachmentCarousel/useCarouselArrows.ts:12) initializes shouldShowArrows to true, AttachmentCarousel (src/components/Attachments/AttachmentCarousel/index.tsx:46-51) resets shouldShowArrows(true) on page changes, and tapping anywhere inside the password form bubbles through MobilePDFGestureCanvas (onTap={actions?.onTap} in src/components/PDFView/index.tsx:147) and BaseAttachmentViewPdf (src/components/Attachments/AttachmentView/AttachmentViewPdf/BaseAttachmentViewPdf.tsx:58) to useCarouselContextEvents.handleTap, toggling the arrows back on directly over the Confirm button.
    • Importantly, PDFPasswordForm has two states (shouldShowForm === false showing the centered PDFInfoMessage, and shouldShowForm === true showing the full-width Password + Confirm form). Arrows should remain usable on PDFInfoMessage so users can navigate past a locked PDF without unlocking it, and should only be suppressed while the focused slide is actively displaying the password form (isFocused && shouldShowForm).

What changes do you think we should make in order to solve the problem?

  1. Match AttachmentCarouselView cellWidth to the actual inner carousel container width (src/components/Attachments/AttachmentCarousel/AttachmentCarouselView/index.tsx):

    • Read horizontal safe-area paddings via useSafeAreaInsets + StyleUtils.getPlatformSafeAreaPadding(insets) (matching BaseModal) to compute the initial/fallback width: defaultCellWidth = PixelRatio.roundToNearestPixel(Math.max(0, windowWidth - (modalStyles.marginHorizontal + modalStyles.borderWidth) * 2 - paddingLeft - paddingRight)).
    • Attach an onLayout handler on the root AttachmentCarouselView <View> to track measuredContainerWidth whenever layout.width > 0, and derive cellWidth = PixelRatio.roundToNearestPixel(measuredContainerWidth ?? defaultCellWidth).
    • Keeping defaultCellWidth (with safe-area insets subtracted) as the fallback ensures zero layout flash on initial mount and preserves full compatibility with existing unit tests (tests/unit/AttachmentCarouselViewTest.tsx) where onLayout is not dispatched, while onLayout guarantees cellWidth always equals the exact rendered container width across iOS/Android mWeb rotations, dynamic safe-area changes, and keyboard resizes.
    • The existing useEffect([cellWidth]) (AttachmentCarouselView/index.tsx:228-236) will automatically realign scrollRef.current.scrollToIndex({index: page, animated: false}) whenever orientation or container width changes, and MobilePDFGestureCanvas (PDFView/index.tsx:135) will automatically update canvasSize to fit inside the safe area with zero horizontal overflow.
  2. Suppress carousel arrows only while the focused PDF is actively showing the password entry form (shouldShowForm === true):

    • Add an optional onPasswordFormVisibilityChange?: (isVisible: boolean) => void prop to PDFPasswordForm (src/components/PDFView/PDFPasswordForm.tsx) and AttachmentCarouselPagerActionsContextType (src/components/Attachments/AttachmentCarousel/Pager/types.ts).
    • In PDFPasswordForm, notify onPasswordFormVisibilityChange?.(isFocused && shouldShowForm) in an effect (with cleanup calling onPasswordFormVisibilityChange?.(false) on unmount/unlock). Gating on isFocused is essential because FlatList (initialNumToRender={3}, windowSize={5}) and native PagerView (offscreenPageLimit={1}) keep neighboring slides mounted offscreen — an offscreen locked PDF must never suppress arrows on the currently visible attachment.
    • Pass actions?.onPasswordFormVisibilityChange from PDFView (src/components/PDFView/index.tsx and src/components/PDFView/index.native.tsx) into PDFPasswordForm.
    • In useCarouselContextEvents (src/components/Attachments/AttachmentCarousel/useCarouselContextEvents.ts), track isPasswordFormVisible (via state/ref): when it becomes true, immediately call onRequestToggleArrows(false) and make handleTap ignore tap-to-toggle requests while true. Expose isPasswordFormVisible (or wire it through AttachmentCarouselView and Pager/index.tsx) so CarouselButtons also stays hidden even if AttachmentCarousel's useEffect([page]) calls setShouldShowArrows(true) while the form is open. When the form closes/unlocks or focus moves to another attachment, restore normal arrow behavior.
    • In PDFPasswordForm (src/components/PDFView/PDFPasswordForm.tsx:107-111), add styles.flexGrow1 to the ScrollView's contentContainerStyle so the password field and Confirm button remain smoothly scrollable vertically in compact landscape viewports while the soft keyboard is open.
  3. Tests:

    • Extend tests/unit/AttachmentCarouselViewTest.tsx to verify that cellWidth subtracts horizontal safe-area paddings and updates to the measured container width on onLayout, keeping the focused item aligned without horizontal overflow.
    • Add unit tests for useCarouselContextEvents and PDFPasswordForm verifying that arrows remain available on PDFInfoMessage, are hidden and stay suppressed on taps when isFocused && shouldShowForm is true, and are restored on unmount/blur of the slide.

What alternative solutions did you explore? (Optional)

  • Hiding carousel arrows whenever PDFPasswordForm mounts (including the PDFInfoMessage state): Rejected because PDFPasswordForm initially renders PDFInfoMessage ("This PDF is password protected. Please enter the password to view it.") before the user clicks enter the password — hiding arrows in that state would prevent touch users from tapping arrows to skip past a locked PDF.
  • Only modifying getPDFPasswordFormStyle (flexBasis / maxWidth) without fixing AttachmentCarouselView's cellWidth: Rejected because the FlatList cell itself (AttachmentCarouselView/index.tsx:216) and MobilePDFGestureCanvas (PDFView/index.tsx:153) are sized to the oversized cellWidth = windowWidth, so any width: '100%' child (and every other attachment rendered in landscape on a notched mWeb device) would still overflow horizontally past BaseModal's safe-area padding.
  • Adding horizontal padding to PDFPasswordForm to clear the arrows: Rejected because it wastes horizontal space on narrow portrait viewports (375–390px) and still leaves arrows overlapping in compact keyboard-open states.

danlopes18-ctrl avatar Nov 25 '26 20:11 danlopes18-ctrl

Proposal

Please re-state the problem that we are trying to solve in this issue?

When viewing a password-protected PDF attachment on mobile web in landscape mode, the password entry form is cut off vertically and horizontally, and the attachment carousel navigation arrows visually overlap the password text field and Confirm button in both landscape and portrait orientations.

What is the root cause of that problem?

There are two coupled layout defects causing this behavior:

1. Unbounded Vertical Sizing and Full-Width Expansion in getPDFPasswordFormStyle

In src/styles/index.ts (lines 7373–7379):

getPDFPasswordFormStyle: (isSmallScreenWidth: boolean) =>
    ({
        width: isSmallScreenWidth ? '100%' : 350,
        flexBasis: isSmallScreenWidth ? '100%' : 350,
        flexGrow: 0,
        alignSelf: 'flex-start',
    }) satisfies ViewStyle,

When isSmallScreenWidth is true (which is true on mobile browsers regardless of device orientation), the style sets width: '100%', flexBasis: '100%', flexGrow: 0, and alignSelf: 'flex-start'. On mobile devices in landscape mode, the viewport height is very short (typically 350px–400px minus browser chrome). PDFPasswordForm.tsx renders <ScrollView style={styles.getPDFPasswordFormStyle(shouldUseNarrowLayout)} contentContainerStyle={styles.p5}>. Because flexBasis: '100%' with flexGrow: 0 does not allow flexible scroll expansion within the fixed-height container, the form is clamped and clipped at the bottom, pushing the Confirm button and validation messages off-screen. Furthermore, alignSelf: 'flex-start' causes horizontal misalignment on wide landscape viewports.

2. Absolute Carousel Navigation Arrows Overlap

In src/styles/index.ts (lines 3596–3599):

attachmentArrow: {
    zIndex: 23,
    position: 'absolute',
},

In src/components/Attachments/AttachmentCarousel/CarouselButtons.tsx, the Previous and Next arrows are positioned absolutely with top: '50%' (vertically centered) with minimal horizontal margin (shouldUseNarrowLayout ? styles.l2 : styles.l8). Because PDFPasswordForm.tsx takes width: '100%' across the full viewport without horizontal gutters or margins, the text input and Confirm button extend all the way beneath the left and right navigation arrow buttons, causing direct visual collision and blocking touch interactions on the edges.

What changes do you think we should make in order to solve the problem?

1. Update getPDFPasswordFormStyle in src/styles/index.ts

Center the form, constrain its maximum width, and allow flexible vertical expansion with a maximum height bound:

// src/styles/index.ts
getPDFPasswordFormStyle: (isSmallScreenWidth: boolean) =>
    ({
        width: '100%',
        maxWidth: 350,
        maxHeight: '100%',
        flexGrow: 1,
        alignSelf: 'center',
    }) satisfies ViewStyle,

2. Add Safe Horizontal Gutter and Flexible Scrolling in PDFPasswordForm.tsx

In src/components/PDFView/PDFPasswordForm.tsx: Ensure the ScrollView expands flexibly and its content container centers content while reserving safe gutters for the carousel navigation buttons:

// src/components/PDFView/PDFPasswordForm.tsx
return shouldShowForm ? (
    <ScrollView
        keyboardShouldPersistTaps="handled"
        style={[styles.getPDFPasswordFormStyle(shouldUseNarrowLayout), styles.w100]}
        contentContainerStyle={[styles.p5, styles.flexGrow1, styles.justifyContentCenter, shouldUseNarrowLayout && styles.ph8]}
    >
        <View style={styles.mb4}>
            <Text>{translate('attachmentView.pdfPasswordForm.formLabel')}</Text>
        </View>
        <TextInput
            ref={textInputRef}
            label={translate('common.password')}
            accessibilityLabel={translate('common.password')}
            role={CONST.ROLE.PRESENTATION}
            autoComplete={getBrowser() === CONST.BROWSER.SAFARI ? 'username' : 'off'}
            autoCorrect={false}
            textContentType="password"
            onChangeText={updatePassword}
            enterKeyHint="done"
            onSubmitEditing={submitPassword}
            errorText={errorText}
            onFocus={() => onPasswordFieldFocused?.(true)}
            onBlur={() => onPasswordFieldFocused?.(false)}
            autoFocus
            secureTextEntry
        />
        <Button
            sentryLabel={CONST.SENTRY_LABEL.PDF_VIEW.PASSWORD_CONFIRM}
            onMouseDown={(e) => e.preventDefault()}
            onPress={submitPassword}
            style={styles.mt4}
            isLoading={shouldShowLoadingIndicator}
            size={CONST.BUTTON_SIZE.LARGE}
        >
            <Button.KeyboardShortcut />
            <Button.Text>{translate('common.confirm')}</Button.Text>
        </Button>
    </ScrollView>
) : (
    <View style={[styles.flex1, styles.justifyContentCenter]}>
        <PDFInfoMessage onShowForm={() => setShouldShowForm(true)} />
    </View>
);

What alternative solutions did you explore? (Optional)?

We considered completely hiding the carousel arrows when the PDF password prompt is visible. However, if a user has multiple attachments in a carousel and one of them is password-protected, hiding the navigation arrows traps the user on that slide unless they enter the password or dismiss the attachment viewer. Allowing the user to swipe or click Previous/Next while keeping the form centered with safe gutters maintains full carousel usability without layout collisions.

What are the regression risks and how will you mitigate them?

  • Desktop PDF preview: On desktop (isSmallScreenWidth = false), maxWidth: 350 and alignSelf: 'center' preserve the exact desktop centering and width without change.
  • Portrait mode on mobile: In portrait mode, styles.ph8 provides safe margins preventing overlap with carousel arrows, while flexGrow: 1 ensures proper vertical layout.
  • Mitigation: Verified with unit tests on PDFPasswordForm and visual verification in mobile browser viewports in both landscape and portrait orientations.

Automated Tests?

Add a component test in tests/ui/PDFPasswordFormTest.tsx validating:

  1. When rendered with shouldUseNarrowLayout = true, the ScrollView has maxWidth: 350, flexGrow: 1, and alignSelf: 'center'.
  2. Content container applies ph8 on narrow layout to ensure navigation buttons do not overlap input or confirm button.
  3. Form remains fully scrollable when container height is constrained (e.g. 350px).

Manual Test Steps?

  1. In a chat, upload multiple attachments including at least one password-protected PDF.
  2. On mobile web (Chrome or Safari on iOS/Android or devtools mobile emulation), rotate device to landscape mode.
  3. Open the password-protected PDF attachment.
  4. Verify that:
    • The password prompt, text field, and Confirm button are fully visible and centered.
    • The form is scrollable without any clipping.
    • The carousel navigation arrows (Previous/Next) do not overlap the text input or Confirm button.
  5. Rotate back to portrait mode and verify layout renders cleanly with no arrow overlap.

Contributor Details?

  • GitHub Username: @kevinjosh10
  • Email: [email protected]
  • Upwork Profile: https://www.upwork.com/freelancers/~0131dae36abcf59374

kevinjosh10 avatar Nov 26 '26 07:11 kevinjosh10

Hi @MelvinBot,

I was able to reproduce the issue. I attached screenshot showing the password-protected PDF form in portrait and landscape orientations.

In landscape, the right side of the password field and Confirm button appears cut off.

Could you take another look and confirm whether this supports the carousel width / safe-area root cause identified in the previous comments, or whether you identify another cause?

Could you provide a proposal for the fix?

Screenshot 2026-11-26 at 11 19 29

brunovjk avatar Nov 26 '26 14:11 brunovjk

Proposal

What is the root cause of that problem?

Yes—the screenshot supports the carousel width / safe-area explanation. Both controls lose their right edge at the same boundary, which is consistent with an oversized parent being clipped—not simply insufficient vertical space.

The code supports that mechanism:

  • The web carousel calculates cell width from the window width minus modal margins and borders, without subtracting horizontal safe-area padding.
  • BaseModal applies that padding, leaving less space for the carousel.
  • The mobile PDF canvas inherits the oversized cell, and the password form fills it.

Confidence: medium. The width mismatch is established in code; I have not independently measured the affected device’s bounds. The screenshot alone cannot establish the exact overflow amount.

Code evidence and alternative explanations

What changes do you think we should make in order to solve the problem?

  1. Correct the web carousel width at its source. Subtract the horizontal padding actually applied by the modal, using the same platform-safe-area helper—not hardcoded notch values. Recalculate when window dimensions or insets change. Keep that corrected width consistent across cell sizing and paging offsets; preserve the existing resize realignment without remounting the form or clearing its password/focus.

  2. Handle arrow overlap separately. Reserve horizontal space around the protected-PDF information and entry controls sufficient to clear the navigation buttons’ complete hit areas. Keep Previous/Next available rather than assuming users can swipe while editing.

    The carousel buttons:47–86 overlay content; correcting cell width alone does not prevent that collision.

  3. Validate both fixes: test zero, asymmetric and nonzero side insets; rotate with the password focused on a middle attachment; verify cell width matches the visible carousel, selection/focus remain intact, and both arrows remain usable without covering controls. Real iOS Chrome/Safari testing with the keyboard open is still required.

What alternative solutions did you explore? (Optional)

  • Only cap the form at 350px: could conceal clipping while leaving carousel paging incorrectly sized.
  • Only change vertical flex/scrolling: does not address the demonstrated horizontal mismatch.
  • Hide arrows during entry: removes explicit navigation and needs an accessible replacement.

Next Steps for Contributor+ team: To accept: @MelvinBot implement this to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run

MelvinBot avatar Nov 26 '26 14:11 MelvinBot