Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): add an accessible view for streamed browser tabs #25308

Openshivamhwp(GitHub profile, opens in a new tab)wants to merge 51 commits intomain fromrefs/pull/25308/headopened View on GitHub

Showing 22 changed files with 77 additions and 48 deletions (loading 21).

x
0 of 22 viewed, 22 left
77 additions and 48 deletionsapps/mobile/src/features/browser/PreviewStreamWebView.tsxModified
View file
@@ -12,6 +12,7 @@
} from "@t3tools/client-runtime/preview/server-browser-stream";
import type { EnvironmentId, PreviewStreamHostSetup } from "@t3tools/contracts";
import {
+ useCallback,
useEffectEvent,
useImperativeHandle,
useLayoutEffect,
@@ -164,6 +165,8 @@
...props
}: PreviewStreamConfiguration & NativeStreamBridge) {
const [attempt, setAttempt] = useState(0);
+ // Outlives reconnects, which remount the document view.
+ const [accessible, setAccessible] = useState(false);
const [previousAccess, setPreviousAccess] = useState(props.access);
// Wait for refreshed access, including cookie credentials with unchanged JSON.
if (props.access !== previousAccess) {
@@ -185,6 +188,8 @@
{...props}
ref={ref}
configuration={configuration}
+ accessible={accessible}
+ onAccessibleChange={setAccessible}
onUnauthorized={() => {
const refusals = ++unauthorized.current;
if (refusals >= MAX_REFUSALS) return false;
@@ -225,8 +230,12 @@