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
16 changes: 2 additions & 14 deletions apps/mobile/src/components/AndroidAnchoredMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { MenuAction, MenuComponentProps } from "@react-native-menu/menu";
import { BlurView } from "expo-blur";
import type { ReactNode } from "react";
import { useCallback, useEffect, useRef, useState } from "react";
import type { StyleProp, ViewStyle } from "react-native";
Expand All @@ -8,11 +7,11 @@ import { useKeyboardState } from "react-native-keyboard-controller";
import Animated, { FadeIn } from "react-native-reanimated";

import { appBlurTargetRef } from "../lib/appBlurTarget";
import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
import { cn } from "../lib/cn";
import { type AppSymbolName, SymbolView } from "./AppSymbol";
import { AppText as Text } from "./AppText";
import { OverlayPortal } from "./OverlayPortal";
import { GlassBackdrop } from "./GlassBackdrop";

const MENU_WIDTH = 250;
const SCREEN_MARGIN = 12;
Expand Down Expand Up @@ -79,8 +78,6 @@ export function AndroidAnchoredMenu(props: AndroidAnchoredMenuProps) {
const anchorRef = useRef<View>(null);
const overlayRef = useRef<View>(null);

const { themeAppearance } = useAppearancePreferences();
const isDarkMode = themeAppearance === "dark";
const keyboardVisible = useKeyboardState((state) => state.isVisible);
const keyboardHeight = useKeyboardState((state) => state.height);
const close = useCallback(() => {
Expand Down Expand Up @@ -227,16 +224,7 @@ export function AndroidAnchoredMenu(props: AndroidAnchoredMenuProps) {
: { bottom: (rootHeight ?? 0) - local.y + ANCHOR_GAP }),
}}
>
{/* Frosted backdrop: blur of the app content behind the menu,
washed with the translucent card tone so rows keep contrast. */}
<BlurView
blurMethod="dimezisBlurView"
blurTarget={appBlurTargetRef}
intensity={40}
tint={isDarkMode ? "dark" : "light"}
className="absolute inset-0"
/>
<View className="absolute inset-0 bg-card-translucent" />
<GlassBackdrop blurTarget={appBlurTargetRef} />
{/* keyboardShouldPersistTaps: the menu often opens over an
active editor; the first item tap must act, not just
dismiss the keyboard. */}
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/src/components/AppSymbol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import IconSearch from "@tabler/icons-react-native/IconSearch";
import IconServer from "@tabler/icons-react-native/IconServer";
import IconSettings from "@tabler/icons-react-native/IconSettings";
import IconSparkles from "@tabler/icons-react-native/IconSparkles";
import IconStack2 from "@tabler/icons-react-native/IconStack2";
import IconSun from "@tabler/icons-react-native/IconSun";
import IconTerminal2 from "@tabler/icons-react-native/IconTerminal2";
import IconTextDecrease from "@tabler/icons-react-native/IconTextDecrease";
Expand All @@ -100,6 +101,7 @@ const ANDROID_ICON_BY_SF_SYMBOL: Partial<Record<SFSymbol, Icon>> = {
"arrow.right.circle": IconArrowRightCircle,
"arrow.triangle.branch": IconGitBranch,
"arrow.triangle.pull": IconGitPullRequest,
"square.3.layers.3d": IconStack2,
"arrow.turn.left.up": IconArrowBackUp,
"arrow.up": IconArrowUp,
"arrow.up.circle": IconArrowUpCircle,
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/components/ComposerToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function ComposerInlineControl(props: {
readonly icon?: ComponentProps<typeof SymbolView>["name"];
readonly iconNode?: ReactNode;
readonly label: string;
readonly maxWidth?: number;
readonly maxWidth?: ViewStyle["maxWidth"];
readonly onPress?: () => void;
readonly selected?: boolean;
readonly static?: boolean;
Expand Down
53 changes: 53 additions & 0 deletions apps/mobile/src/components/GlassBackdrop.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { BlurView } from "expo-blur";
import { useContext, type RefObject } from "react";
import { Platform, StyleSheet, View, type ColorValue } from "react-native";

import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider";
import { GlassBlurTargetContext } from "../lib/glassBlurTarget";
import { themeColorWithAlpha } from "../lib/mobileTheme";

/** Frosted backdrop for containers that clip their children to their shape. */
export function GlassBackdrop(props: {
readonly fallbackColor?: ColorValue;
readonly blurTarget?: RefObject<View | null>;
}) {
const { themeAppearance } = useAppearancePreferences();
const inheritedBlurTarget = useContext(GlassBlurTargetContext);
const target = props.blurTarget ?? inheritedBlurTarget;
const supportsBlur =
Platform.OS === "ios" ||
(Platform.OS === "android" && Platform.Version >= 31 && target !== undefined);
const colorStyle =
props.fallbackColor === undefined
? undefined
: { backgroundColor: themeColorWithAlpha(String(props.fallbackColor), 1) };

return (
<>
{/* Android samples a separate target. An opaque backing prevents any
transparent pixels in that sample from exposing the unblurred feed.
iOS samples its actual backdrop, so a backing there would hide it. */}
{Platform.OS === "android" ? (
<View pointerEvents="none" className="absolute inset-0 bg-card" style={colorStyle} />
) : null}
{supportsBlur ? (
<BlurView
pointerEvents="none"
blurTarget={target}
blurMethod="dimezisBlurViewSdk31Plus"
intensity={80}
tint={themeAppearance === "dark" ? "dark" : "default"}
style={StyleSheet.absoluteFill}
/>
) : null}
<View
pointerEvents="none"
className="absolute inset-0 bg-card"
style={[
colorStyle,
{ opacity: supportsBlur ? (themeAppearance === "dark" ? 0.25 : 0.55) : 1 },
]}
/>
</>
);
}
30 changes: 3 additions & 27 deletions apps/mobile/src/components/GlassSurface.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { BlurView } from "expo-blur";
import { GlassView, isGlassEffectAPIAvailable } from "expo-glass-effect";
import { useContext, type ReactNode, type Ref, type RefObject } from "react";
import type { ReactNode, Ref, RefObject } from "react";
import {
Platform,
StyleSheet,
useColorScheme,
View,
type ColorValue,
Expand All @@ -13,8 +11,7 @@ import {
import { withUniwind } from "uniwind";

import { cn } from "../lib/cn";
import { GlassBlurTargetContext } from "../lib/glassBlurTarget";
import { themeColorWithAlpha } from "../lib/mobileTheme";
import { GlassBackdrop } from "./GlassBackdrop";

// Explicit mappings keep the native glassEffectStyle enum out of style-array conversion.
const ThemedGlassView = withUniwind(GlassView, {
Expand Down Expand Up @@ -51,13 +48,6 @@ export function GlassSurface({
...props
}: GlassSurfaceProps) {
const isDarkMode = useColorScheme() === "dark";
const inheritedBlurTarget = useContext(GlassBlurTargetContext);
const target = blurTarget ?? inheritedBlurTarget;
const supportsBlur =
Platform.OS === "ios" ||
(Platform.OS === "android" && Platform.Version >= 31 && target !== undefined);
const backgroundColor =
fallbackColor === undefined ? undefined : themeColorWithAlpha(String(fallbackColor), 1);
const supportsGlass = Platform.OS === "ios" && isGlassEffectAPIAvailable();
const surfaceStyle: ViewStyle = {
borderRadius: 32,
Expand Down Expand Up @@ -113,21 +103,7 @@ export function GlassSurface({
)}
style={[surfaceStyle, style]}
>
{supportsBlur ? (
<BlurView
pointerEvents="none"
blurTarget={target}
blurMethod="dimezisBlurViewSdk31Plus"
intensity={80}
tint={isDarkMode ? "dark" : "default"}
style={StyleSheet.absoluteFill}
/>
) : null}
<View
pointerEvents="none"
className="absolute inset-0 bg-card"
style={{ backgroundColor, opacity: supportsBlur ? (isDarkMode ? 0.25 : 0.55) : 1 }}
/>
<GlassBackdrop blurTarget={blurTarget} fallbackColor={fallbackColor} />
{children}
</View>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function makeThread(
interactionMode: "default",
branch: null,
worktreePath: null,
pullRequests: [],
latestTurn: null,
createdAt: "2026-06-01T00:00:00.000Z",
updatedAt: "2026-06-01T00:00:00.000Z",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/homeListItems.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function makeThread(id: string, projectId: ProjectId): EnvironmentThreadShell {
interactionMode: "default",
branch: null,
worktreePath: null,
pullRequests: [],
latestTurn: null,
createdAt: "2026-06-01T00:00:00.000Z",
updatedAt: "2026-06-01T00:00:00.000Z",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/homeThreadList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function makeThread(
interactionMode: "default",
branch: null,
worktreePath: null,
pullRequests: [],
latestTurn: null,
createdAt: "2026-06-01T00:00:00.000Z",
updatedAt: "2026-06-01T00:00:00.000Z",
Expand Down
4 changes: 4 additions & 0 deletions apps/mobile/src/features/home/homeThreadList.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { threadPullRequestSearchTerms } from "@t3tools/shared/threadPullRequests";
import {
buildProjectGroups,
derivePhysicalProjectKey,
Expand Down Expand Up @@ -311,6 +312,9 @@ export function buildHomeThreadGroups(input: {
: group.threads.filter(
(thread) =>
thread.title.toLocaleLowerCase().includes(query) ||
threadPullRequestSearchTerms(thread).some((term) =>
term.toLocaleLowerCase().includes(query),
) ||
input.matchedThreadKeys?.has(
threadSearchMatchKey({
environmentId: thread.environmentId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export function HardwareKeyboardCommandProvider({
? null
: resolveThreadReferenceCopyTarget({
threadId: activeThread?.id ?? activeThreadRef.threadId,
pullRequests: activeThread?.pullRequests,
linkedPullRequestUrl:
(activeThread?.linkedPullRequest ?? activeThread?.branchPullRequest)?.url ?? null,
}),
Expand Down
35 changes: 18 additions & 17 deletions apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
ComposerActionButton,
ComposerInlineControl,
ComposerToolbarRow,
ComposerToolbarScroller,
} from "../../components/ComposerToolbar";
import { AndroidScreenHeader } from "../../components/AndroidScreenHeader";
import { ComposerAttachmentButton } from "../../components/ComposerAttachmentButton";
Expand Down Expand Up @@ -1345,21 +1344,23 @@ export function NewTaskDraftScreen(props: {
onPickMedia={handlePickMedia}
onPickFiles={handlePickFiles}
/>
<ComposerToolbarScroller align="end" contentPaddingRight={0} fadeSurface="sheet">
<ComposerInlineControl
accessibilityLabel="Model and reasoning settings"
disabled={isComposerInteractionLocked}
emphasized
iconNode={
<ProviderIcon
provider={flow.selectedModelOption?.providerDriver}
size={16}
/>
}
label={flow.selectedModelOption?.label ?? "Choose model"}
maxWidth={152}
onPress={settingsSheetPresentation.open}
/>
<View className="min-w-0 flex-1 flex-row items-center justify-end gap-2">
<View className="min-w-0 shrink">
<ComposerInlineControl
accessibilityLabel="Model and reasoning settings"
disabled={isComposerInteractionLocked}
emphasized
iconNode={
<ProviderIcon
provider={flow.selectedModelOption?.providerDriver}
size={16}
/>
}
label={flow.selectedModelOption?.label ?? "Choose model"}
maxWidth="100%"
onPress={settingsSheetPresentation.open}
/>
</View>
{flow.planModeEnabled ? (
<ComposerInlineControl
accessibilityHint={`Switches to ${flow.interactionMode === "plan" ? "Build" : "Plan"} mode`}
Expand All @@ -1380,7 +1381,7 @@ export function NewTaskDraftScreen(props: {
showChevron={false}
/>
) : null}
</ComposerToolbarScroller>
</View>
</>
)}
<ComposerDictationPrimaryAction
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/features/threads/ThreadComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -780,15 +780,15 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
onPickMedia={props.onPickDraftMedia}
onPickFiles={props.onPickDraftFiles}
/>
<View className="min-w-0 shrink" style={{ maxWidth: 152 }}>
<View className="min-w-0 shrink">
<ComposerInlineControl
accessibilityLabel="Model and reasoning settings"
emphasized
iconNode={
<ProviderIcon provider={currentModelOption?.providerDriver} size={16} />
}
label={currentModelOption?.label ?? currentModelSelection.model}
maxWidth={152}
maxWidth="100%"
onPress={openSettings}
/>
</View>
Expand Down
15 changes: 9 additions & 6 deletions apps/mobile/src/features/threads/ThreadFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2866,13 +2866,16 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
entry.type === "message" ? `message:${entry.message.role}` : entry.type
}
getFixedItemSize={getFixedItemSize}
// LegendList swaps its position and size component types when this
// becomes undefined, remounting the feed and replaying row entrances.
// Keep those containers mounted while ordinary updates stay immediate.
// Android can retain stale native row positions when layout transitions
// race the measurements arriving during sync, even with duration 0.
// Keep its rows on LegendList's non-animated positioning path. On iOS,
// keep a transition installed between disclosures so containers don't remount.
itemLayoutAnimation={
disclosureToggleSettling
? THREAD_FEED_LAYOUT_TRANSITION
: THREAD_FEED_IMMEDIATE_TRANSITION
Platform.OS === "android"
? undefined
: disclosureToggleSettling
? THREAD_FEED_LAYOUT_TRANSITION
: THREAD_FEED_IMMEDIATE_TRANSITION
}
onItemSizeChanged={handleItemSizeChanged}
// Measure rows well before they scroll into view so estimate鈫抋ctual
Expand Down
Loading
Loading