diff --git a/apps/web/src/app/(main)/chat/page.tsx b/apps/web/src/app/(main)/chat/page.tsx index 8373bbb..0431e9e 100644 --- a/apps/web/src/app/(main)/chat/page.tsx +++ b/apps/web/src/app/(main)/chat/page.tsx @@ -4,6 +4,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { EmbeddedApp } from "../../../components/embed/embedded-app"; import { api, errorMessage } from "../../../lib/api-client"; import { useApiResource } from "../../../lib/use-api"; +import { useIsMobile } from "../../../hooks/use-is-mobile"; /** * In-app Chat: Element Web, full height inside the Hub shell, signed in as the @@ -59,6 +60,7 @@ function originOf(url: string): string | null { export default function ChatPage(): React.ReactElement { const identity = useApiResource("/matrix/identity", identityView, null); + const isMobile = useIsMobile(); const frameRef = useRef(null); const mints = useRef(0); const tokenSent = useRef(false); @@ -127,6 +129,39 @@ export default function ChatPage(): React.ReactElement { ? ssoUser : undefined; + if (isMobile) { + // Mobile: a framed three-pane Element under the bottom tab bar breaks + // (nested scrolling, keyboard collapse, double chrome) — hand off to the + // standalone app instead (panel consensus: gateway pattern). + return ( +
+

Newsroom chat

+

+ Chat runs best as its own app on mobile — the full three-pane interface gets cramped inside the Hub frame. +

+
+ + Open chat ↗ + + {ssoUser !== null && ( + + Open in a Matrix app + + )} +
+

+ {ssoUser !== null ? `Signed in as ${ssoUser}` : "Sign in on desktop to link your account."} +

+
+ ); + } + return ( session; export default function DrivePage(): React.ReactElement { const { t } = useFilesLang(); const drive = useApiResource("/drive/session", driveView, null); + const isMobile = useIsMobile(); const driveUrl = drive.source === "sample" ? FALLBACK_DRIVE_URL : drive.data?.driveUrl ?? null; const notConfigured = drive.source === "live" && drive.error === null && driveUrl === null; @@ -43,6 +45,26 @@ export default function DrivePage(): React.ReactElement { es: "Inicia sesión una vez dentro de la unidad y quedará abierta. Los archivos de los colectivos están en la pestaña Biblioteca.", }); + if (isMobile) { + // Mobile: the oCIS file browser under the bottom tab bar breaks (nested + // scrolling, double chrome) — hand off to the standalone drive instead + // (panel consensus: gateway pattern). The Library tab is fully native. + return ( +
+

{t({ en: "Drive", es: "Unidad" })}

+

{error ?? notice}

+ +
+ ); + } + return (