Settings sections render blank in portrait #1

Closed
opened 2026-11-01 10:59:18 +11:00 by litruv · 2 comments
Owner

The settings window does not render in portrait on the Capacitor Android app. Opening a settings section, for example Account, shows a blank screen. In landscape the same sections render normally.

Areas worth checking:

  • a settings layout that places the list and the content side by side, where the content pane is hidden or zero-width below a breakpoint
  • a media query, fixed width, or fixed height in the settings CSS that only applies in landscape
  • the mobile overlay: overlay/src/app/pages/client/ClientLayout.tsx, overlay/src/app/pages/MobileFriendly.tsx, overlay/src/app/components/mobile/MobileSwipeGestureHost.tsx
  • a responsive hook or folds breakpoint that reports the wrong value before the first resize event

Diagnosis is running separately. The fix belongs in cinny if the layout is shared, or in the mobile overlay if it is mobile-specific.

The settings window does not render in portrait on the Capacitor Android app. Opening a settings section, for example Account, shows a blank screen. In landscape the same sections render normally. Areas worth checking: - a settings layout that places the list and the content side by side, where the content pane is hidden or zero-width below a breakpoint - a media query, fixed width, or fixed height in the settings CSS that only applies in landscape - the mobile overlay: `overlay/src/app/pages/client/ClientLayout.tsx`, `overlay/src/app/pages/MobileFriendly.tsx`, `overlay/src/app/components/mobile/MobileSwipeGestureHost.tsx` - a responsive hook or folds breakpoint that reports the wrong value before the first resize event Diagnosis is running separately. The fix belongs in `cinny` if the layout is shared, or in the mobile overlay if it is mobile-specific.
Author
Owner

Root cause, code evidence only. No Android device or emulator was available, so this was not reproduced on hardware.

  • overlay/src/app/components/page/Page.tsx:25 — if (compact && showCompactMaster) { return <Box ...>{nav}</Box>; } drops children on this branch.
  • overlay/src/app/hooks/useCompactNav.ts:26 — useShowCompactMasterView() is compact && isListRoute. isListRoute matches the current pathname against LIST_ROUTE_PATHS at useCompactNav.ts:11. Settings is a modal, not a route, so opening it from /home leaves the pathname a list route and showCompactMaster stays true.
  • cinny/src/app/features/settings/Settings.tsx:276 — on mobile, once a page is selected, nav is passed as undefined. The branch at Page.tsx:25 then renders nothing at all.
  • cinny/src/app/features/settings/Settings.tsx:119-122 — activePage starts as undefined on mobile, so the first paint shows only the list.
  • Settings is mounted from cinny/src/app/pages/client/sidebar/SettingsTab.tsx:194-196, inside the client route, which is why the pathname is still a list route.
  • useScreenSize.ts:20 — MOBILE_BREAKPOINT = 750. A portrait phone is below it, so compact is true. Landscape is above it, so the last branch renders both nav and children. That is the portrait/landscape difference.

Ruled out: PageNav fixed widths (style.css.ts:9,12) — PageNav sets grow and shrink on mobile, so it is not zero-width. CompactDetailLayer pointerEvents: none in mobile-gestures.css.ts affects taps, not visibility. MobileFriendly.tsx is a pass-through. MobileSwipeGestureHost.tsx does not swallow the outlet. No landscape-only media query in the settings CSS.

Fix applied: Page.tsx:25 now reads if (compact && showCompactMaster && nav). When nav is empty there is no master list to protect, so the code falls through to the compact detail branch, which renders children. The original guard still applies when the master list is present.

Not verified on device. Needs a portrait run on a phone, or a browser at 390x844 with the overlay applied.

Root cause, code evidence only. No Android device or emulator was available, so this was not reproduced on hardware. - `overlay/src/app/components/page/Page.tsx:25` — `if (compact && showCompactMaster) { return <Box ...>{nav}</Box>; }` drops `children` on this branch. - `overlay/src/app/hooks/useCompactNav.ts:26` — `useShowCompactMasterView()` is `compact && isListRoute`. `isListRoute` matches the current pathname against `LIST_ROUTE_PATHS` at `useCompactNav.ts:11`. Settings is a modal, not a route, so opening it from `/home` leaves the pathname a list route and `showCompactMaster` stays true. - `cinny/src/app/features/settings/Settings.tsx:276` — on mobile, once a page is selected, `nav` is passed as `undefined`. The branch at `Page.tsx:25` then renders nothing at all. - `cinny/src/app/features/settings/Settings.tsx:119-122` — `activePage` starts as `undefined` on mobile, so the first paint shows only the list. - Settings is mounted from `cinny/src/app/pages/client/sidebar/SettingsTab.tsx:194-196`, inside the client route, which is why the pathname is still a list route. - `useScreenSize.ts:20` — `MOBILE_BREAKPOINT = 750`. A portrait phone is below it, so `compact` is true. Landscape is above it, so the last branch renders both `nav` and `children`. That is the portrait/landscape difference. Ruled out: `PageNav` fixed widths (`style.css.ts:9,12`) — `PageNav` sets `grow` and `shrink` on mobile, so it is not zero-width. `CompactDetailLayer` `pointerEvents: none` in `mobile-gestures.css.ts` affects taps, not visibility. `MobileFriendly.tsx` is a pass-through. `MobileSwipeGestureHost.tsx` does not swallow the outlet. No landscape-only media query in the settings CSS. Fix applied: `Page.tsx:25` now reads `if (compact && showCompactMaster && nav)`. When `nav` is empty there is no master list to protect, so the code falls through to the compact detail branch, which renders `children`. The original guard still applies when the master list is present. Not verified on device. Needs a portrait run on a phone, or a browser at 390x844 with the overlay applied.
Author
Owner

Verified in a headless browser at 390x844 with the overlay applied, using a stub homeserver so the client shell renders.

A/B on the same session, opening Settings from #/home:

  • guard removed (if (compact && showCompactMaster)): the modal renders empty — no tabbable node, focus-trap error, nothing to tap.
  • guard present (if (compact && showCompactMaster && nav)): the settings list renders, and selecting a section renders its content.

The root cause is as reported: nav is undefined on mobile once a section is selected, so the compact master branch returns an empty box over the modal.

Fixed in 9de71b7.

Verified in a headless browser at 390x844 with the overlay applied, using a stub homeserver so the client shell renders. A/B on the same session, opening Settings from `#/home`: - guard removed (`if (compact && showCompactMaster)`): the modal renders empty — no tabbable node, focus-trap error, nothing to tap. - guard present (`if (compact && showCompactMaster && nav)`): the settings list renders, and selecting a section renders its content. The root cause is as reported: `nav` is `undefined` on mobile once a section is selected, so the compact master branch returns an empty box over the modal. Fixed in [9de71b7](https://git.ruv.wtf/litruv/cinny-mobile/commit/9de71b766d589f44f0f94a8adc2366e0aeaebf97).
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: litruv/cinny-mobile#1