Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

fix(mobile): restore Android tablet thread controls, clean up header (#5385)

Alex2d2efff28c4f
diff --git a/apps/mobile/src/components/CompactBrandTitle.tsx b/apps/mobile/src/components/CompactBrandTitle.tsx
index 28f7cfe57..bfba418c9 100644
--- a/apps/mobile/src/components/CompactBrandTitle.tsx
+++ b/apps/mobile/src/components/CompactBrandTitle.tsx
@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
+ readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
+ allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
+ allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}
export function renderCompactBrandTitle() {
- return <CompactBrandTitle />;
+ return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}
export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
diff --git a/apps/mobile/src/features/home/AndroidHomeFab.tsx b/apps/mobile/src/features/home/AndroidHomeFab.tsx
index 5c7d5a0b9..c57964fce 100644
--- a/apps/mobile/src/features/home/AndroidHomeFab.tsx
+++ b/apps/mobile/src/features/home/AndroidHomeFab.tsx
@@ -6,8 +6,8 @@ import { SymbolView } from "../../components/AppSymbol";
import { useThemeColor } from "../../lib/useThemeColor";
/**
- * Android-only wrapper that overlays a bottom-right new-task FAB on the home
- * screen. Other platforms render children unchanged.
+ * Android-only wrapper that overlays a bottom-right new-task FAB on a thread
+ * list. Other platforms render children unchanged.
*/
export function AndroidHomeFabLayout(props: {
readonly onStartNewTask: () => void;
diff --git a/apps/mobile/src/features/home/HomeRouteScreen.tsx b/apps/mobile/src/features/home/HomeRouteScreen.tsx
index 8061b1d1e..beabf66d9 100644
--- a/apps/mobile/src/features/home/HomeRouteScreen.tsx
+++ b/apps/mobile/src/features/home/HomeRouteScreen.tsx
@@ -2,6 +2,7 @@ import * as Arr from "effect/Array";
import * as Order from "effect/Order";
import { useNavigation } from "@react-navigation/native";
import { useEffect, useMemo, useState } from "react";
+import { Platform } from "react-native";
import { NativeHeaderToolbar, NativeStackScreenOptions } from "../../native/StackHeader";
import { useProjects, useThreadShells } from "../../state/entities";
@@ -106,7 +107,11 @@ export function HomeRouteScreen() {
return (
<>
<NativeStackScreenOptions
- options={{ title: "", headerTitle: "", unstable_headerLeftItems: () => [] }}
+ options={
+ Platform.OS === "android"
+ ? { headerShown: false }
+ : { title: "", headerTitle: "", unstable_headerLeftItems: () => [] }
+ }
/>
<WorkspaceSidebarToolbar
afterSidebarButton={
@@ -129,18 +134,20 @@ export function HomeRouteScreen() {
onStartNewTask={() => navigation.navigate("NewTaskSheet", { screen: "NewTask" })}
>
<>
- {/* Restore the compact title after the split branch blanks the detail
- header. The brand slot doubles as the connection status surface:
- while an environment reconnects, the lockup fades to a status label
- in place (no layout shift in the list below). */}
+ {/* Restore the header after leaving split view; screen options are
+ shallow-merged. The brand slot also doubles as the connection
+ status surface while an environment reconnects. */}
<NativeStackScreenOptions
- options={getConnectionAwareBrandHeaderOptions({
- onOpenEnvironments: () =>
- navigation.navigate("SettingsSheet", {
- screen: "SettingsContent",
- params: { screen: "SettingsEnvironments" },
- }),
- })}
+ options={{
+ ...getConnectionAwareBrandHeaderOptions({
+ onOpenEnvironments: () =>
+ navigation.navigate("SettingsSheet", {
+ screen: "SettingsContent",
+ params: { screen: "SettingsEnvironments" },
+ }),
+ }),
+ headerShown: true,
+ }}
/>
<HomeHeader
environments={environments}
diff --git a/apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx b/apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
index e00433de0..9ea8eb88d 100644
--- a/apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
+++ b/apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
@@ -45,6 +45,7 @@ import {
parseActiveThreadPath,
useHardwareKeyboardCommand,
} from "../keyboard/hardwareKeyboardCommands";
+import { AndroidHomeFabLayout } from "../home/AndroidHomeFab";
import { HomeListOptionsProvider } from "../home/home-list-options";
import { ThreadNavigationSidebar } from "../threads/ThreadNavigationSidebar";
import { WORKSPACE_PANE_TIMING } from "./workspace-pane-animation";
@@ -435,6 +436,10 @@ function AdaptiveWorkspaceLayoutContent(
});
}, [navigation]);
+ const handleStartNewTask = useCallback(() => {
+ navigation.navigate("NewTaskSheet", { screen: "NewTask" });
+ }, [navigation]);
+
// Minted here (root stack navigation) so the sidebar pane stays free of
// navigation hooks — on iOS it renders inside an independent nav tree.
const handleOpenEnvironmentSettings = useCallback(() => {
@@ -528,18 +533,22 @@ function AdaptiveWorkspaceLayoutContent(
pointerEvents={panes.primarySidebarVisible ? "auto" : "none"}
style={sidebarAnimatedStyle}
>
- <ThreadNavigationSidebar
- width={layout.listPaneWidth}
- visible={panes.primarySidebarVisible}
- onRequestVisibility={revealPrimarySidebar}
- selectedThreadKey={selectedThreadKey}
- onOpenSettings={handleOpenSettings}
- onOpenEnvironmentSettings={handleOpenEnvironmentSettings}
- onNewThreadInProject={handleNewThreadInProject}
- onSelectThread={handleSelectThread}
- onSearchQueryChange={setPrimarySidebarSearchQuery}
- searchQuery={primarySidebarSearchQuery}
- />
+ <View className="flex-1" style={{ width: layout.listPaneWidth }}>
+ <AndroidHomeFabLayout onStartNewTask={handleStartNewTask}>
+ <ThreadNavigationSidebar
+ width={layout.listPaneWidth}
+ visible={panes.primarySidebarVisible}
+ onRequestVisibility={revealPrimarySidebar}
+ selectedThreadKey={selectedThreadKey}
+ onOpenSettings={handleOpenSettings}
+ onOpenEnvironmentSettings={handleOpenEnvironmentSettings}
+ onNewThreadInProject={handleNewThreadInProject}
+ onSelectThread={handleSelectThread}
+ onSearchQueryChange={setPrimarySidebarSearchQuery}
+ searchQuery={primarySidebarSearchQuery}
+ />
+ </AndroidHomeFabLayout>
+ </View>
</Animated.View>
) : null}
<View className="flex-1 overflow-hidden bg-screen" collapsable={false}>
diff --git a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
index 856e5ac23..6feca0013 100644
--- a/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
+++ b/apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
@@ -1,4 +1,3 @@
-import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
@@ -14,16 +13,16 @@ import { AsyncResult } from "effect/unstable/reactivity";
import type { EnvironmentId } from "@t3tools/contracts";
import { sortPinnedThreadsByOrderKey } from "@t3tools/client-runtime/state/thread-sort";
import type { ChangeRequestSettleSource } from "@t3tools/client-runtime/state/thread-settled";
-import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from "react";
-import type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent } from "react-native";
+import { useCallback, useEffect, useMemo, useRef, useState } from "react";
+import type { LayoutChangeEvent } from "react-native";
import { Platform, Pressable, StyleSheet, TextInput, View } from "react-native";
import { Gesture, GestureDetector } from "react-native-gesture-handler";
import type { SwipeableMethods } from "react-native-gesture-handler/ReanimatedSwipeable";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import type { SearchBarCommands } from "react-native-screens";
-import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
import { AppText as Text } from "../../components/AppText";
+import { CompactBrandTitle } from "../../components/CompactBrandTitle";
import { ControlPillMenu } from "../../components/ControlPill";
import { SymbolView } from "../../components/AppSymbol";
import { NATIVE_LIQUID_GLASS_SUPPORTED } from "../../native/native-glass";
@@ -40,7 +39,6 @@ import { usePendingNewTasks } from "../../state/use-pending-new-tasks";
import { useWorkspaceState } from "../../state/workspace";
import { useSavedRemoteConnections } from "../../state/use-remote-environment-registry";
import { useHardwareKeyboardCommand } from "../keyboard/hardwareKeyboardCommands";
-import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
import {
hasCustomHomeListOptions,
PROJECT_SORT_OPTIONS,
@@ -97,48 +95,7 @@ type SidebarListItem =
| ThreadListV2ListItem
| { readonly type: "v2-show-more"; readonly key: string; readonly hiddenCount: number };
-/**
- * Shared capsule behind the sidebar header buttons — a native liquid-glass
- * surface on iOS 26+, a tinted pill everywhere else.
- */
-function SidebarHeaderButtonGroup(props: {
- readonly children: ReactNode;
- readonly colorScheme: "light" | "dark";
-}) {
- const fallbackBackground = useThemeColor("--color-glass-surface");
- const fallbackBorder = useThemeColor("--color-header-border");
- if (isLiquidGlassSupported) {
- return (
- <LiquidGlassView
- colorScheme={props.colorScheme}
- effect="regular"
- interactive
- style={styles.headerButtonGroup}
- >
- {props.children}
- </LiquidGlassView>
- );
- }
-
- return (
- <View
- style={[
- styles.headerButtonGroup,
- { backgroundColor: fallbackBackground, borderColor: fallbackBorder },
- { borderWidth: StyleSheet.hairlineWidth },
- ]}
- >
- {props.children}
- </View>
- );
-}
-
const SIDEBAR_STICKY_HEADER_HEIGHT = 106;
-const SIDEBAR_STICKY_HEADER_FADE_HEIGHT = 44;
-const SIDEBAR_HEADER_WASH_OPACITY = {
- dark: [0.22, 0.14, 0.04],
- light: [0.46, 0.3, 0.08],
-} as const;
interface ThreadNavigationSidebarProps {
readonly width: number;
@@ -195,16 +152,13 @@ function ThreadNavigationSidebarPane(
props: ThreadNavigationSidebarProps & { readonly nativeChrome: boolean },
) {
const insets = useSafeAreaInsets();
- const { themeAppearance: colorScheme } = useAppearancePreferences();
const projects = useProjects();
const threads = useThreadShells();
const { environments: workspaceEnvironments, state: catalogState } = useWorkspaceState();
const { savedConnectionsById } = useSavedRemoteConnections();
- const [headerIsOverContent, setHeaderIsOverContent] = useState(false);
const searchInputRef = useRef<TextInput>(null);
const searchBarRef = useRef<SearchBarCommands>(null);
const openSwipeableRef = useRef<SwipeableMethods | null>(null);
- const headerIsOverContentRef = useRef(false);
const sidebarScrollGesture = useMemo(() => Gesture.Native(), []);
const {
archiveThread,
@@ -780,8 +734,6 @@ function ThreadNavigationSidebarPane(
const borderColor = useThemeColor("--color-border");
const mutedColor = useThemeColor("--color-foreground-muted");
const placeholderColor = useThemeColor("--color-placeholder");
- const headerFadeColor = String(backgroundColor);
- const headerWashOpacity = SIDEBAR_HEADER_WASH_OPACITY[colorScheme];
const [measuredHeaderHeight, setMeasuredHeaderHeight] = useState<number | null>(null);
// The sticky header (title row, search field, optional connection status)
// is measured so the list inset always matches its real height — no
@@ -810,19 +762,10 @@ function ThreadNavigationSidebarPane(
},
[props.onSelectThread],
);
- const handleScroll = useCallback((event: NativeSyntheticEvent<NativeScrollEvent>) => {
- const next = event.nativeEvent.contentOffset.y > 6;
- if (headerIsOverContentRef.current === next) {
- return;
- }
- headerIsOverContentRef.current = next;
- setHeaderIsOverContent(next);
- }, []);
const handleScrollBeginDrag = useCallback(() => {
openSwipeableRef.current?.close();
}, []);
const { swipeEnabled, scrollGateHandlers } = useSwipeableScrollGate({
- onScroll: handleScroll,
onScrollBeginDrag: handleScrollBeginDrag,
});
// Project shells load after the first rows draw, so the maps they feed have
@@ -1321,7 +1264,10 @@ function ThreadNavigationSidebarPane(
contentContainerStyle={[
styles.threadListContent,
{
- paddingBottom: 16 + insets.bottom,
+ paddingBottom:
+ Platform.OS === "android"
+ ? Math.max(insets.bottom, 16) + 88 - insets.bottom
+ : 16 + insets.bottom,
paddingTop: topListInset,
},
]}
@@ -1340,65 +1286,34 @@ function ThreadNavigationSidebarPane(
<View
className="absolute inset-x-0 top-0 z-[4]"
+ collapsable={false}
onLayout={handleStickyHeaderLayout}
- pointerEvents="box-none"
- style={{ paddingTop: insets.top }}
+ pointerEvents="auto"
+ style={{
+ paddingTop: insets.top,
+ backgroundColor,
+ }}
>
- <View
- className="absolute inset-x-0 top-0"
- pointerEvents="none"
- accessibilityElementsHidden
- importantForAccessibility="no-hide-descendants"
- style={{ height: stickyHeaderHeight + SIDEBAR_STICKY_HEADER_FADE_HEIGHT }}
- >
- <Svg width="100%" height="100%">
- <Defs>
- <LinearGradient id="sidebar-header-wash" x1="0%" x2="0%" y1="0%" y2="100%">
- <Stop
- offset="0%"
- stopColor={headerFadeColor}
- stopOpacity={headerIsOverContent ? headerWashOpacity[0] : 0}
- />
- <Stop
- offset="58%"
- stopColor={headerFadeColor}
- stopOpacity={headerIsOverContent ? headerWashOpacity[1] : 0}
- />
- <Stop
- offset="88%"
- stopColor={headerFadeColor}
- stopOpacity={headerIsOverContent ? headerWashOpacity[2] : 0}
- />
- <Stop offset="100%" stopColor={headerFadeColor} stopOpacity={0} />
- </LinearGradient>
- </Defs>
- <Rect width="100%" height="100%" fill="url(#sidebar-header-wash)" />
- </Svg>
- </View>
<View className="h-[50px] flex-row items-end gap-0.5 pr-2 pl-5">
{/* Title slot doubles as the connection status surface: while an
- environment reconnects, "Threads" fades to a status label in
+ environment reconnects, the brand fades to a status label in
place (no layout shift in the list below). */}
<WorkspaceConnectionTitle
grow
onPress={props.onOpenEnvironmentSettings}
size="pageTitle"
brand={
- <Text className="flex-1 text-[34px] font-t3-bold text-foreground" numberOfLines={1}>
- Threads
- </Text>
+ <View className="h-11 flex-1 justify-center">
+ <CompactBrandTitle allowFontScaling={false} />
+ </View>
}
/>
- <SidebarHeaderButtonGroup colorScheme={colorScheme}>
+ <View className="flex-row items-center gap-2.5">
<ControlPillMenu actions={listMenuActions} onPressAction={handleListMenuAction}>
- <SidebarFilterButton
- grouped
- accessibilityLabel="Filter and sort threads"
- icon={filterIcon}
- />
+ <SidebarFilterButton accessibilityLabel="Filter and sort threads" icon={filterIcon} />
</ControlPillMenu>
- <SidebarHeaderActions grouped onOpenSettings={props.onOpenSettings} />
- </SidebarHeaderButtonGroup>
+ <SidebarHeaderActions onOpenSettings={props.onOpenSettings} />
+ </View>
</View>
<View className="mx-4 mt-[9px] h-[38px] flex-row items-center gap-1.5 rounded-xl bg-sidebar-search pr-2.5 pl-[11px]">
@@ -1423,12 +1338,6 @@ function ThreadNavigationSidebarPane(
}
const styles = StyleSheet.create({
- headerButtonGroup: {
- alignItems: "center",
- borderRadius: 22,
- flexDirection: "row",
- overflow: "hidden",
- },
threadList: {
flex: 1,
},
diff --git a/apps/mobile/src/features/threads/sidebar-filter-button.tsx b/apps/mobile/src/features/threads/sidebar-filter-button.tsx
index 0c33da436..1895ef0d4 100644
--- a/apps/mobile/src/features/threads/sidebar-filter-button.tsx
+++ b/apps/mobile/src/features/threads/sidebar-filter-button.tsx
@@ -1,5 +1,5 @@
import { SymbolView } from "../../components/AppSymbol";
-import { Pressable, StyleSheet } from "react-native";
+import { Pressable } from "react-native";
import { useThemeColor } from "../../lib/useThemeColor";
@@ -10,31 +10,17 @@ export type SidebarFilterButtonIcon =
export function SidebarFilterButton(props: {
readonly accessibilityLabel: string;
readonly icon: SidebarFilterButtonIcon;
- /** Rendered inside a shared capsule group — no own background/border. */
- readonly grouped?: boolean;
}) {
const iconColor = useThemeColor("--color-foreground");
- const pressedBackgroundColor = useThemeColor("--color-subtle");
- const idleBackgroundColor = useThemeColor("--color-glass-surface");
- const borderColor = useThemeColor("--color-header-border");
return (
<Pressable
- className="h-11 w-[50px] cursor-pointer items-center justify-center rounded-[22px]"
+ className="size-11 cursor-pointer items-center justify-center rounded-full bg-subtle active:opacity-70"
accessibilityLabel={props.accessibilityLabel}
accessibilityRole="button"
hitSlop={4}
- style={({ pressed }) => [
- props.grouped
- ? { backgroundColor: pressed ? pressedBackgroundColor : "transparent", borderWidth: 0 }
- : {
- backgroundColor: pressed ? pressedBackgroundColor : idleBackgroundColor,
- borderColor,
- borderWidth: StyleSheet.hairlineWidth,
- },
- ]}
>
- <SymbolView name={props.icon} size={20} tintColor={iconColor} type="monochrome" />
+ <SymbolView name={props.icon} size={16} tintColor={iconColor} type="monochrome" />
</Pressable>
);
}
diff --git a/apps/mobile/src/features/threads/sidebar-header-actions.tsx b/apps/mobile/src/features/threads/sidebar-header-actions.tsx
index b0f5f1131..9ce77f899 100644
--- a/apps/mobile/src/features/threads/sidebar-header-actions.tsx
+++ b/apps/mobile/src/features/threads/sidebar-header-actions.tsx
@@ -1,43 +1,28 @@
import { SymbolView } from "../../components/AppSymbol";
-import { Pressable, StyleSheet, View } from "react-native";
+import { Pressable, View } from "react-native";
import { useThemeColor } from "../../lib/useThemeColor";
export interface SidebarHeaderActionsProps {
readonly onOpenSettings: () => void;
- /** Rendered inside a shared capsule group — buttons drop their own chrome. */
- readonly grouped?: boolean;
}
function FallbackHeaderButton(props: {
readonly accessibilityLabel: string;
readonly icon: "gearshape" | "square.and.pencil";
- readonly grouped?: boolean;
readonly onPress: () => void;
}) {
const iconColor = useThemeColor("--color-foreground");
- const pressedBackgroundColor = useThemeColor("--color-subtle");
- const idleBackgroundColor = useThemeColor("--color-glass-surface");
- const borderColor = useThemeColor("--color-header-border");
return (
<Pressable
- className="h-11 w-[50px] items-center justify-center rounded-[22px]"
+ className="size-11 items-center justify-center rounded-full bg-subtle active:opacity-70"
accessibilityLabel={props.accessibilityLabel}
accessibilityRole="button"
hitSlop={4}
onPress={props.onPress}
- style={({ pressed }) => [
- props.grouped
- ? { backgroundColor: pressed ? pressedBackgroundColor : "transparent", borderWidth: 0 }
- : {
- backgroundColor: pressed ? pressedBackgroundColor : idleBackgroundColor,
- borderColor,
- borderWidth: StyleSheet.hairlineWidth,
- },
- ]}
>
- <SymbolView name={props.icon} size={20} tintColor={iconColor} type="monochrome" />
+ <SymbolView name={props.icon} size={18} tintColor={iconColor} type="monochrome" />
</Pressable>
);
}
@@ -47,7 +32,6 @@ export function SidebarHeaderActions(props: SidebarHeaderActionsProps) {
<View className="flex-row items-center gap-0.5">
<FallbackHeaderButton
accessibilityLabel="Open settings"
- grouped={props.grouped}
icon="gearshape"
onPress={props.onOpenSettings}
/>