Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/mobile/src/components/CompactBrandTitle.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
Expand All@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
Expand All@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
allowFontScaling={props.allowFontScaling}
Comment thread
cursor[bot] marked this conversation as resolved.
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
Expand All@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}

export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}

export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/home/AndroidHomeFab.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
31 changes: 19 additions & 12 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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={
Expand All@@ -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}
Expand Down
33 changes: 21 additions & 12 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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(() => {
Expand DownExpand Up@@ -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}>
Expand Down
133 changes: 21 additions & 112 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All@@ -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";
Expand All@@ -39,7 +38,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,
Expand DownExpand Up@@ -96,48 +94,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;
Expand DownExpand Up@@ -194,16 +151,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,
Expand DownExpand Up@@ -776,8 +730,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
Expand DownExpand Up@@ -806,19 +758,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
Expand DownExpand Up@@ -1314,7 +1257,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,
Comment thread
cursor[bot] marked this conversation as resolved.
paddingTop: topListInset,
},
]}
Expand All@@ -1333,65 +1279,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]">
Expand All@@ -1416,12 +1331,6 @@ function ThreadNavigationSidebarPane(
}

const styles = StyleSheet.create({
headerButtonGroup: {
alignItems: "center",
borderRadius: 22,
flexDirection: "row",
overflow: "hidden",
},
threadList: {
flex: 1,
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/mobile/src/components/CompactBrandTitle.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
Expand All@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
Expand All@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
allowFontScaling={props.allowFontScaling}
Comment thread
cursor[bot] marked this conversation as resolved.
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
Expand All@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}

export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}

export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/home/AndroidHomeFab.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
31 changes: 19 additions & 12 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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={
Expand All@@ -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}
Expand Down
33 changes: 21 additions & 12 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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(() => {
Expand DownExpand Up@@ -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}>
Expand Down
133 changes: 21 additions & 112 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All@@ -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";
Expand All@@ -39,7 +38,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,
Expand DownExpand Up@@ -96,48 +94,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;
Expand DownExpand Up@@ -194,16 +151,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,
Expand DownExpand Up@@ -776,8 +730,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
Expand DownExpand Up@@ -806,19 +758,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
Expand DownExpand Up@@ -1314,7 +1257,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,
Comment thread
cursor[bot] marked this conversation as resolved.
paddingTop: topListInset,
},
]}
Expand All@@ -1333,65 +1279,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]">
Expand All@@ -1416,12 +1331,6 @@ function ThreadNavigationSidebarPane(
}

const styles = StyleSheet.create({
headerButtonGroup: {
alignItems: "center",
borderRadius: 22,
flexDirection: "row",
overflow: "hidden",
},
threadList: {
flex: 1,
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/mobile/src/components/CompactBrandTitle.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
Expand All@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
Expand All@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
allowFontScaling={props.allowFontScaling}
Comment thread
cursor[bot] marked this conversation as resolved.
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
Expand All@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}

export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}

export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/home/AndroidHomeFab.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
31 changes: 19 additions & 12 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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={
Expand All@@ -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}
Expand Down
33 changes: 21 additions & 12 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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(() => {
Expand DownExpand Up@@ -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}>
Expand Down
133 changes: 21 additions & 112 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All@@ -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";
Expand All@@ -39,7 +38,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,
Expand DownExpand Up@@ -96,48 +94,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;
Expand DownExpand Up@@ -194,16 +151,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,
Expand DownExpand Up@@ -776,8 +730,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
Expand DownExpand Up@@ -806,19 +758,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
Expand DownExpand Up@@ -1314,7 +1257,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,
Comment thread
cursor[bot] marked this conversation as resolved.
paddingTop: topListInset,
},
]}
Expand All@@ -1333,65 +1279,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]">
Expand All@@ -1416,12 +1331,6 @@ function ThreadNavigationSidebarPane(
}

const styles = StyleSheet.create({
headerButtonGroup: {
alignItems: "center",
borderRadius: 22,
flexDirection: "row",
overflow: "hidden",
},
threadList: {
flex: 1,
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/mobile/src/components/CompactBrandTitle.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
Expand All@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
Expand All@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
allowFontScaling={props.allowFontScaling}
Comment thread
cursor[bot] marked this conversation as resolved.
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
Expand All@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}

export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}

export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/home/AndroidHomeFab.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
31 changes: 19 additions & 12 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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={
Expand All@@ -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}
Expand Down
33 changes: 21 additions & 12 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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(() => {
Expand DownExpand Up@@ -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}>
Expand Down
133 changes: 21 additions & 112 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All@@ -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";
Expand All@@ -39,7 +38,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,
Expand DownExpand Up@@ -96,48 +94,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;
Expand DownExpand Up@@ -194,16 +151,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,
Expand DownExpand Up@@ -776,8 +730,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
Expand DownExpand Up@@ -806,19 +758,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
Expand DownExpand Up@@ -1314,7 +1257,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,
Comment thread
cursor[bot] marked this conversation as resolved.
paddingTop: topListInset,
},
]}
Expand All@@ -1333,65 +1279,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]">
Expand All@@ -1416,12 +1331,6 @@ function ThreadNavigationSidebarPane(
}

const styles = StyleSheet.create({
headerButtonGroup: {
alignItems: "center",
borderRadius: 22,
flexDirection: "row",
overflow: "hidden",
},
threadList: {
flex: 1,
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/mobile/src/components/CompactBrandTitle.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
Expand All@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
Expand All@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
allowFontScaling={props.allowFontScaling}
Comment thread
cursor[bot] marked this conversation as resolved.
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
Expand All@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}

export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}

export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/home/AndroidHomeFab.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
31 changes: 19 additions & 12 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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={
Expand All@@ -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}
Expand Down
33 changes: 21 additions & 12 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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(() => {
Expand DownExpand Up@@ -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}>
Expand Down
133 changes: 21 additions & 112 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All@@ -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";
Expand All@@ -39,7 +38,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,
Expand DownExpand Up@@ -96,48 +94,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;
Expand DownExpand Up@@ -194,16 +151,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,
Expand DownExpand Up@@ -776,8 +730,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
Expand DownExpand Up@@ -806,19 +758,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
Expand DownExpand Up@@ -1314,7 +1257,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,
Comment thread
cursor[bot] marked this conversation as resolved.
paddingTop: topListInset,
},
]}
Expand All@@ -1333,65 +1279,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]">
Expand All@@ -1416,12 +1331,6 @@ function ThreadNavigationSidebarPane(
}

const styles = StyleSheet.create({
headerButtonGroup: {
alignItems: "center",
borderRadius: 22,
flexDirection: "row",
overflow: "hidden",
},
threadList: {
flex: 1,
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/mobile/src/components/CompactBrandTitle.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
Expand All@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
Expand All@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
allowFontScaling={props.allowFontScaling}
Comment thread
cursor[bot] marked this conversation as resolved.
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
Expand All@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}

export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}

export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/home/AndroidHomeFab.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
31 changes: 19 additions & 12 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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={
Expand All@@ -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}
Expand Down
33 changes: 21 additions & 12 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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(() => {
Expand DownExpand Up@@ -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}>
Expand Down
133 changes: 21 additions & 112 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All@@ -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";
Expand All@@ -39,7 +38,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,
Expand DownExpand Up@@ -96,48 +94,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;
Expand DownExpand Up@@ -194,16 +151,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,
Expand DownExpand Up@@ -776,8 +730,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
Expand DownExpand Up@@ -806,19 +758,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
Expand DownExpand Up@@ -1314,7 +1257,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,
Comment thread
cursor[bot] marked this conversation as resolved.
paddingTop: topListInset,
},
]}
Expand All@@ -1333,65 +1279,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]">
Expand All@@ -1416,12 +1331,6 @@ function ThreadNavigationSidebarPane(
}

const styles = StyleSheet.create({
headerButtonGroup: {
alignItems: "center",
borderRadius: 22,
flexDirection: "row",
overflow: "hidden",
},
threadList: {
flex: 1,
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/mobile/src/components/CompactBrandTitle.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
Expand All@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
Expand All@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
allowFontScaling={props.allowFontScaling}
Comment thread
cursor[bot] marked this conversation as resolved.
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
Expand All@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}

export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}

export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/home/AndroidHomeFab.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
31 changes: 19 additions & 12 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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={
Expand All@@ -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}
Expand Down
33 changes: 21 additions & 12 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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(() => {
Expand DownExpand Up@@ -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}>
Expand Down
133 changes: 21 additions & 112 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All@@ -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";
Expand All@@ -39,7 +38,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,
Expand DownExpand Up@@ -96,48 +94,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;
Expand DownExpand Up@@ -194,16 +151,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,
Expand DownExpand Up@@ -776,8 +730,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
Expand DownExpand Up@@ -806,19 +758,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
Expand DownExpand Up@@ -1314,7 +1257,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,
Comment thread
cursor[bot] marked this conversation as resolved.
paddingTop: topListInset,
},
]}
Expand All@@ -1333,65 +1279,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]">
Expand All@@ -1416,12 +1331,6 @@ function ThreadNavigationSidebarPane(
}

const styles = StyleSheet.create({
headerButtonGroup: {
alignItems: "center",
borderRadius: 22,
flexDirection: "row",
overflow: "hidden",
},
threadList: {
flex: 1,
},
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/mobile/src/components/CompactBrandTitle.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,7 @@ export function brandTitleOffset(nativeLeadingItem: boolean): number {
*/
export function CompactBrandTitle(
props: {
readonly allowFontScaling?: boolean;
readonly nativeLeadingItem?: boolean;
} = {},
) {
Expand All@@ -57,6 +58,7 @@ export function CompactBrandTitle(
>
<T3Wordmark color={iconColor} height={15} />
<Text
allowFontScaling={props.allowFontScaling}
style={{
color: mutedColor,
fontFamily: "DMSans-Medium",
Expand All@@ -75,6 +77,7 @@ export function CompactBrandTitle(
}}
>
<Text
allowFontScaling={props.allowFontScaling}
Comment thread
cursor[bot] marked this conversation as resolved.
style={{
color: mutedColor,
fontFamily: "DMSans-Bold",
Expand All@@ -91,7 +94,7 @@ export function CompactBrandTitle(
}

export function renderCompactBrandTitle() {
return <CompactBrandTitle />;
return <CompactBrandTitle allowFontScaling={Platform.OS === "ios"} />;
}

export function renderCompactBrandHeaderItems(): NativeStackHeaderItem[] {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/home/AndroidHomeFab.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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;
Expand Down
31 changes: 19 additions & 12 deletions apps/mobile/src/features/home/HomeRouteScreen.tsx
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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={
Expand All@@ -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}
Expand Down
33 changes: 21 additions & 12 deletions apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -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";
Expand DownExpand Up@@ -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(() => {
Expand DownExpand Up@@ -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}>
Expand Down
133 changes: 21 additions & 112 deletions apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
import type {
EnvironmentProject,
EnvironmentThreadShell,
Expand All@@ -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";
Expand All@@ -39,7 +38,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,
Expand DownExpand Up@@ -96,48 +94,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;
Expand DownExpand Up@@ -194,16 +151,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,
Expand DownExpand Up@@ -776,8 +730,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
Expand DownExpand Up@@ -806,19 +758,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
Expand DownExpand Up@@ -1314,7 +1257,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,
Comment thread
cursor[bot] marked this conversation as resolved.
paddingTop: topListInset,
},
]}
Expand All@@ -1333,65 +1279,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]">
Expand All@@ -1416,12 +1331,6 @@ function ThreadNavigationSidebarPane(
}

const styles = StyleSheet.create({
headerButtonGroup: {
alignItems: "center",
borderRadius: 22,
flexDirection: "row",
overflow: "hidden",
},
threadList: {
flex: 1,
},
Expand Down
Loading
Loading