The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): fit large thread titles in Arrange threads (#23499)
Co-authored-by: GPT-6.1 Sol <noreply@openai.com> Co-authored-by: maria-rcks <maria@kuuro.net>
Victor Vogel committed
Oct 30, 2026 at 15:52 UTC
269357ccd9d3e38367248707e3931e0e7dfe76aa
3 files changed
+50
-14
apps/mobile/src/features/threads/ThreadArrangementSheet.tsx
+22
-14
@@ -5,7 +5,7 @@ import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell
5
import { effectiveSnoozed } from "@t3tools/client-runtime/state/thread-settled";
6
import { sortInboxThreadsByReturn } from "@t3tools/client-runtime/state/thread-inbox";
7
import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
8
-import { Animated, FlatList, Modal, Pressable, View } from "react-native";
8
+import { Animated, FlatList, Modal, Pressable, useWindowDimensions, View } from "react-native";
9
import { Gesture, GestureDetector, GestureHandlerRootView } from "react-native-gesture-handler";
10
import Reanimated, { ReduceMotion, useAnimatedStyle, withTiming } from "react-native-reanimated";
11
import { threadDragGapOffset } from "./threadDragGap";
@@ -14,6 +14,7 @@ import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
14
import { AppText as Text } from "../../components/ui/AppText";
15
import { SymbolView } from "../../components/ui/AppSymbol";
16
import { scopedThreadKey } from "../../lib/scopedEntities";
17
+import { deriveThreadArrangementSizing } from "../../lib/layout";
18
import { environmentServerConfigsAtom } from "../../state/server";
19
import { threadListEnvironmentsAtom } from "../../state/presentation";
20
import { environmentThreadShells } from "../../state/threads";
@@ -39,9 +40,8 @@ import {
40
} from "./threadListV2";
41
import { useThreadListNow } from "./use-thread-list-now";
42
import { useThreadListV2ShelfPreferences } from "./use-thread-list-v2-shelf-preferences";
43
+import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
44
43
-const ROW_HEIGHT = 56;
44
-const HEADER_HEIGHT = 48;
45
const keyOf = (thread: EnvironmentThreadShell) => scopedThreadKey(thread.environmentId, thread.id);
46
type Section = "pinned" | "active" | "snoozed" | "settled";
47
type Destination = Exclude<ThreadMoveDestination, string>;
@@ -163,6 +163,12 @@ function DragHandle(props: {
163
}
164
165
function ThreadArrangementSheet(props: { onClose: () => void }) {
166
+ const { appearance } = useAppearancePreferences();
167
+ const { fontScale } = useWindowDimensions();
168
+ const { rowHeight, headerHeight } = deriveThreadArrangementSizing({
169
+ baseFontSize: appearance.baseFontSize,
170
+ fontScale,
171
+ });
172
const threads = useAtomValue(environmentThreadShells.navigationThreadShellsAtom);
173
const configs = useAtomValue(environmentServerConfigsAtom);
174
const listEnvironments = useAtomValue(threadListEnvironmentsAtom);
@@ -230,20 +236,20 @@ function ThreadArrangementSheet(props: { onClose: () => void }) {
236
let offset = 0;
237
for (const section of ["pinned", "active", "snoozed", "settled"] as const) {
238
if (section === "snoozed" && sections[section].length === 0) continue;
233
- result.push({ key: section, section, offset, height: HEADER_HEIGHT });
234
- offset += HEADER_HEIGHT;
239
+ result.push({ key: section, section, offset, height: headerHeight });
240
+ offset += headerHeight;
241
if ((section === "snoozed" || section === "settled") && !expanded[section]) continue;
242
for (const thread of section === "settled" ? visibleSettled : sections[section]) {
237
- result.push({ key: keyOf(thread), section, thread, offset, height: ROW_HEIGHT });
238
- offset += ROW_HEIGHT;
243
+ result.push({ key: keyOf(thread), section, thread, offset, height: rowHeight });
244
+ offset += rowHeight;
245
}
246
if (section === "settled" && settledCount > visibleSettled.length) {
241
- result.push({ key: "settled-more", section, more: true, offset, height: ROW_HEIGHT });
242
- offset += ROW_HEIGHT;
247
+ result.push({ key: "settled-more", section, more: true, offset, height: rowHeight });
248
+ offset += rowHeight;
249
}
250
}
251
return result;
246
- }, [sections, expanded, visibleSettled, settledCount]);
252
+ }, [sections, expanded, visibleSettled, settledCount, rowHeight, headerHeight]);
253
const list = useRef<FlatList<Row>>(null);
254
const geometry = useRef({ height: 0, offset: 0 });
255
const drag = useRef<Drag | null>(null);
@@ -261,7 +267,9 @@ function ThreadArrangementSheet(props: { onClose: () => void }) {
267
setPreview(null);
268
}
269
const orderVersion = rows
264
- .map((row) => `${row.key}:${row.thread?.pinOrderKey}:${row.thread?.activeOrderKey}`)
270
+ .map(
271
+ (row) => `${row.key}:${row.height}:${row.thread?.pinOrderKey}:${row.thread?.activeOrderKey}`,
272
+ )
273
.join("|");
274
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- cancels the in-progress drag gesture when the thread order changes underneath it
275
useEffect(() => {
@@ -282,7 +290,7 @@ function ThreadArrangementSheet(props: { onClose: () => void }) {
290
current.translation = translation;
291
const { height, offset } = geometry.current;
292
const y = current.startY + translation;
285
- translateY.setValue(Math.max(0, Math.min(height - ROW_HEIGHT, y - ROW_HEIGHT / 2)));
293
+ translateY.setValue(Math.max(0, Math.min(height - rowHeight, y - rowHeight / 2)));
294
const contentY = Math.max(0, y + offset);
295
const target =
296
latest.current.rows.find((row) => contentY < row.offset + row.height) ??
@@ -321,7 +329,7 @@ function ThreadArrangementSheet(props: { onClose: () => void }) {
329
orderVersion,
330
sourceSection: row.section,
331
thread: row.thread,
324
- startY: row.offset + ROW_HEIGHT / 2 - geometry.current.offset,
332
+ startY: row.offset + row.height / 2 - geometry.current.offset,
333
translation: 0,
334
destination: null,
335
};
@@ -554,7 +562,7 @@ function ThreadArrangementSheet(props: { onClose: () => void }) {
562
<Animated.View
563
pointerEvents="none"
564
className="absolute left-5 right-5 justify-center rounded-xl border border-border bg-screen px-4"
557
- style={{ top: 0, height: ROW_HEIGHT, transform: [{ translateY }] }}
565
+ style={{ top: 0, height: rowHeight, transform: [{ translateY }] }}
566
>
567
<Text
568
numberOfLines={visiblePreview.destination?.section ? 1 : 2}
apps/mobile/src/lib/layout.test.ts
+13
@@ -4,11 +4,24 @@ import {
4
alignListPaneToHinge,
5
deriveLayout,
6
deriveThreadFeedInitialContentInset,
7
+ deriveThreadArrangementSizing,
8
deriveThreadWorkLogSizing,
9
deriveWorkspacePaneLayout,
10
isPrimarySidebarPinned,
11
} from "./layout";
12
13
+describe("thread arrangement text sizing", () => {
14
+ it("fits two title lines and section labels with combined app and system text scaling", () => {
15
+ const sizing = deriveThreadArrangementSizing({ baseFontSize: 22, fontScale: 1.3 });
16
+ expect(sizing.rowHeight).toBeGreaterThanOrEqual(2 * 32 * 1.3 + 10);
17
+ expect(sizing.headerHeight).toBeGreaterThanOrEqual(26 * 1.3 + 24);
18
+ expect(deriveThreadArrangementSizing({ baseFontSize: 16, fontScale: 1 })).toEqual({
19
+ rowHeight: 56,
20
+ headerHeight: 48,
21
+ });
22
+ });
23
+});
24
+
25
describe("thread work-log text sizing", () => {
26
it.each([
27
{ baseFontSize: 16, fontScale: 1.25, estimatedRowHeight: 28 },
apps/mobile/src/lib/layout.ts
+15
@@ -19,6 +19,21 @@ export const ANDROID_READING_MAX_WIDTH = 640;
19
// min-h-8 uses the 14px rem configured in metro.config.js.
20
export const THREAD_WORK_ROW_MIN_HEIGHT = 28;
21
22
+export function deriveThreadArrangementSizing(input: {
23
+ readonly baseFontSize: number;
24
+ readonly fontScale: number;
25
+}) {
26
+ const bodyLineHeight = scaledTypographyLineHeight(MOBILE_TYPOGRAPHY.body, input.baseFontSize);
27
+ const headerLineHeight = scaledTypographyLineHeight(
28
+ MOBILE_TYPOGRAPHY.footnote,
29
+ input.baseFontSize,
30
+ );
31
+ return {
32
+ rowHeight: Math.max(56, Math.ceil(2 * bodyLineHeight * input.fontScale) + 10),
33
+ headerHeight: Math.max(48, Math.ceil(headerLineHeight * input.fontScale) + 24),
34
+ };
35
+}
36
+
37
export function deriveThreadWorkLogSizing(input: {
38
readonly baseFontSize: number;
39
readonly fontScale: number;