The best way to control Claude Code, Codex and more from any computer or phone

main
ts 74 lines 2.72 KB
Raw
1 import { msg } from "gt-react-native";
2 import type { ViewStyle } from "react-native";
3
4 import { m, type MessageResolver } from "../../i18n/messages";
5 import type { MobileThemeVariables } from "../../lib/mobileTheme";
6
7 export const THREAD_LIST_V2_MONO_FONT = "Menlo";
8 export const THREAD_LIST_V2_ROW_CONTENT_CLASS_NAME = "px-5 py-2.5";
9 export const THREAD_LIST_V2_ROW_DIVIDERS = true;
10 export const THREAD_LIST_V2_SIDEBAR_ROW_STYLE = {
11 borderRadius: 12,
12 paddingHorizontal: 12,
13 paddingVertical: 10,
14 } satisfies ViewStyle;
15 export const THREAD_LIST_V2_SIDEBAR_ROW_CONTAINER_STYLE = {
16 borderRadius: 12,
17 overflow: "hidden",
18 } satisfies ViewStyle;
19
20 export const selectedThreadRowColors = {
21 foregroundClassName: "text-thread-selected-foreground",
22 mutedForegroundClassName: "text-thread-selected-foreground-muted",
23 iconTintClassName: "accent-thread-selected-foreground",
24 mutedIconTintClassName: "accent-thread-selected-foreground-muted",
25 };
26
27 export function getThreadListV2NewBranchMenuTitle(_branch: string, resolve: MessageResolver = m) {
28 return resolve(msg("New thread on branch"));
29 }
30
31 export function getThreadListV2RowAppearance(
32 theme: MobileThemeVariables,
33 sidebarPane: boolean,
34 selected: boolean,
35 ) {
36 const selectedBackgroundColor = theme["--color-thread-selected"];
37 const style: ViewStyle | undefined = sidebarPane
38 ? {
39 backgroundColor: selected ? selectedBackgroundColor : theme["--color-drawer"],
40 borderRadius: THREAD_LIST_V2_SIDEBAR_ROW_STYLE.borderRadius,
41 }
42 : undefined;
43 const swipeContainerStyle: ViewStyle | undefined = sidebarPane
44 ? THREAD_LIST_V2_SIDEBAR_ROW_CONTAINER_STYLE
45 : undefined;
46
47 return {
48 className: sidebarPane ? undefined : "bg-screen",
49 interactionClassName: sidebarPane ? "bg-thread-hover" : "bg-row-hover",
50 interactionOpacity: selected ? 0 : 1,
51 foregroundClassName: sidebarPane ? "text-drawer-foreground" : "text-foreground",
52 mutedForegroundClassName: sidebarPane
53 ? "text-drawer-foreground-muted"
54 : "text-foreground-muted",
55 tertiaryForegroundClassName: sidebarPane
56 ? "text-drawer-foreground-muted"
57 : "text-foreground-tertiary",
58 mutedIconTintClassName: sidebarPane
59 ? "accent-drawer-foreground-muted"
60 : "accent-foreground-muted",
61 tertiaryIconTintClassName: sidebarPane
62 ? "accent-drawer-foreground-muted"
63 : "accent-foreground-tertiary",
64 style,
65 cardStyle: sidebarPane ? { ...style, ...THREAD_LIST_V2_SIDEBAR_ROW_STYLE } : undefined,
66 swipeContainerStyle,
67 swipeBackgroundColor: theme[sidebarPane ? "--color-drawer" : "--color-screen"],
68 providerIconSurfaceColor: sidebarPane
69 ? selected
70 ? selectedBackgroundColor
71 : theme["--color-drawer"]
72 : theme["--color-screen"],
73 };
74 }