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