Skip to content
TypeScript

fix(mobile): tab bar hides with the push, logo fits the iPad sidebar, Android rail holds still (#26241)

Julius Marminge2de4762e4b59
diff --git a/apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt b/apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt
index 32969b1b715..736f7cd3019 100644
--- a/apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt
+++ b/apps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3WorkspaceNavigationModule.kt
@@ -320,11 +320,14 @@ class T3WorkspaceNavigationView(
)
}
}
+ // Other tabs keep the button's slot so the destinations below never move between tabs.
if (selectedTab == "threads") {
newThreadButton(fraction) {
expanded = false
onNewThread(emptyMap<String, Any>())
}
+ } else {
+ Spacer(Modifier.padding(top = 12.dp).height(FAB_SIZE))
}
Spacer(Modifier.weight(1f))
tabs.forEach { tab ->
diff --git a/apps/mobile/src/components/CompactBrandTitle.tsx b/apps/mobile/src/components/CompactBrandTitle.tsx
index e19bbaf209c..7a251a2e57c 100644
--- a/apps/mobile/src/components/CompactBrandTitle.tsx
+++ b/apps/mobile/src/components/CompactBrandTitle.tsx
@@ -10,6 +10,8 @@ import { IPAD_HOME_TITLE_OFFSET } from "../lib/layoutMetrics";
import { resolveMobileStageLabel } from "../lib/mobileBranding";
import { useAndroidControlSizing } from "./ui/useAndroidControlSizing";
+const BRAND_MAX_FONT_SCALE = 1.4;
+
export function brandTitleOffset(): number {
if (Platform.OS !== "ios") return 0;
return Platform.isPad && !NATIVE_WORKSPACE_COLUMNS_SUPPORTED ? IPAD_HOME_TITLE_OFFSET : 0;
@@ -49,8 +51,10 @@ export function CompactBrandTitle(
]}
>
<T3Wordmark colorClassName="accent-icon" height={Math.round(15 * scale)} />
+ {/* A logo beside a fixed-size wordmark: it may grow with Dynamic Type, not crowd the bar. */}
<Text
allowFontScaling={props.allowFontScaling}
+ maxFontSizeMultiplier={BRAND_MAX_FONT_SCALE}
className="font-t3-medium text-foreground-muted"
style={{ fontSize: 21 * scale, letterSpacing: -0.5 * scale }}
>
@@ -67,6 +71,7 @@ export function CompactBrandTitle(
>
<Text
allowFontScaling={props.allowFontScaling}
+ maxFontSizeMultiplier={BRAND_MAX_FONT_SCALE}
className="font-t3-bold text-foreground-muted uppercase"
style={{ fontSize: 9 * scale, letterSpacing: 0.9 * scale }}
>
diff --git a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
index 8103e349231..e2697f4e4d2 100644
--- a/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
+++ b/apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx
@@ -490,6 +490,14 @@ function WorkspaceStackView(props: ViewProps & { readonly nativeColumns: boolean
const presentation = props.descriptors[route.key]?.options.presentation;
return presentation !== undefined && presentation !== "card";
});
+ // The root's willDisappear reaches JS frames into the push, so hide the dock in the commit that
+ // pushes; the native events still own every later change, including back gestures.
+ const topDetailKey = projection.detail.at(-1)?.key;
+ const [pushedDetailKey, setPushedDetailKey] = useState(topDetailKey);
+ if (pushedDetailKey !== topDetailKey) {
+ setPushedDetailKey(topDetailKey);
+ if (topDetailKey !== undefined && primaryVisible) setPrimaryVisible(false);
+ }
// Detail-only histories must stay single-stack: placeholder descriptors cannot own sidebar actions or setOptions.
const primaryRoute = projection.primary;
if (!primaryRoute) return <V5StackView {...props} />;
diff --git a/apps/mobile/src/features/sharing/IncomingShareProvider.tsx b/apps/mobile/src/features/sharing/IncomingShareProvider.tsx
index 6c03a4110da..b9c48bd68a1 100644
--- a/apps/mobile/src/features/sharing/IncomingShareProvider.tsx
+++ b/apps/mobile/src/features/sharing/IncomingShareProvider.tsx
@@ -229,6 +229,11 @@ function getIncomingShareSnapshot() {
}
function reportRefreshFailure(cause: unknown) {
+ console.warn(
+ "[incoming-share] refresh failed",
+ cause,
+ cause instanceof Error ? cause.cause : null,
+ );
const error = cause instanceof Error ? cause : new Error("Could not import shared content.");
Dialog.alert("Could not import shared content", error.message, [
{ text: "Dismiss", style: "cancel" },
diff --git a/apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx b/apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx
index 171c6960ff7..fd382d1de0a 100644
--- a/apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx
+++ b/apps/mobile/src/features/workspace/WorkspaceRootScreen.tsx
@@ -62,7 +62,7 @@ function WorkspaceRootTitle(props: {
return (
<View style={{ width: props.maxWidth, minHeight: 32, justifyContent: "center" }}>
<WorkspaceConnectionTitle
- brand={<CompactBrandTitle accessibilityLabel={`T3 Code, ${tabTitle}`} />}
+ brand={<CompactBrandTitle accessibilityLabel={`T3 Code, ${tabTitle}`} fit />}
maxWidth={props.maxWidth}
onPress={props.onOpenEnvironments}
/>
@@ -95,14 +95,15 @@ function WorkspaceRootContent() {
const keyboardHeight = useKeyboardState((keyboard) => keyboard.height);
const workspace = useWorkspaceTabs()!;
const { state } = workspace;
+ // Settings is a workspace tab too; its list takes the place of the selected tab's.
+ const settingsOpen = workspace.settingsOpen;
const renderHeaderTitle = () => (
<WorkspaceRootTitle
- maxWidth={Math.max(0, width - 160)}
+ // Settings adds its scope filter beside search.
+ maxWidth={Math.max(0, width - 160 - (settingsOpen ? 44 : 0))}
onOpenEnvironments={() => openSettings(navigation, "SettingsEnvironments")}
/>
);
- // Settings is a workspace tab too; its list takes the place of the selected tab's.
- const settingsOpen = workspace.settingsOpen;
const tab = state.tabs[settingsOpen ? "settings" : state.selectedTab];
const bottomClearance =
layout.primarySidebarOverlaysContent && state.selectedTab === "usage"