Skip to content

Commit 5b491d5

Browse files
committed
Merge branch 'mobile-app' of github.com:PostHog/Array into mobile-app
2 parents aea34e5 + 5bcf116 commit 5b491d5

File tree

9 files changed

+21
-22
lines changed

9 files changed

+21
-22
lines changed

apps/mobile/src/app/chat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default function ChatScreen() {
5252
options={{
5353
headerShown: true,
5454
headerTitle: "Chat",
55+
headerBackTitle: "",
5556
headerStyle: { backgroundColor: "#09090b" },
5657
headerTintColor: "#fff",
5758
headerTitleStyle: {

apps/mobile/src/app/conversation/[id].tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default function ConversationDetailScreen() {
7979
options={{
8080
headerShown: true,
8181
headerTitle: "Error",
82+
headerBackTitle: "",
8283
headerStyle: { backgroundColor: "#09090b" },
8384
headerTintColor: "#fff",
8485
}}

apps/mobile/src/components/AIMessage.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ActivityIndicator, Text, View } from "react-native";
1+
import { Text, View } from "react-native";
22
import type { AssistantToolCall } from "../types/max";
33
import { ToolCallMessage } from "./ToolCallMessage";
44

@@ -35,12 +35,9 @@ export function AIMessage({
3535
{(content || isLoading) && (
3636
<View className="max-w-[95%] px-4 py-1">
3737
{isLoading && !content ? (
38-
<View className="flex-row items-center gap-2">
39-
<ActivityIndicator size="small" color="#f1a82c" />
40-
<Text className="font-mono text-[13px] text-neutral-400 italic">
41-
{thinkingText || "Generating..."}
42-
</Text>
43-
</View>
38+
<Text className="font-mono text-[13px] text-neutral-400 italic">
39+
{thinkingText || "Generating..."}
40+
</Text>
4441
) : (
4542
<Text className="font-mono text-[13px] text-neutral-200 leading-5">
4643
{content}

apps/mobile/src/components/FailureMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface FailureMessageProps {
77
export function FailureMessage({ content }: FailureMessageProps) {
88
return (
99
<View className="px-4 py-2">
10-
<View className="max-w-[95%] bg-red-500/15 px-3 py-2">
10+
<View className="max-w-[95%] rounded bg-red-500/15 px-3 py-2">
1111
<Text className="font-mono text-[13px] text-red-300 leading-5">
1212
{content || "Something went wrong. Please try again."}
1313
</Text>

apps/mobile/src/components/HumanMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface HumanMessageProps {
77
export function HumanMessage({ content }: HumanMessageProps) {
88
return (
99
<View className="px-4 py-2">
10-
<View className="mt-3 max-w-[95%] bg-amber-500/20 px-3 py-2">
10+
<View className="mt-3 max-w-[95%] rounded bg-amber-500/20 px-3 py-2">
1111
<Text className="font-mono text-[13px] text-amber-100 leading-5">
1212
{content}
1313
</Text>

apps/mobile/src/components/MessagesList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function MessagesList({
110110
</Text>
111111
</View>
112112
}
113-
ListFooterComponent={
113+
ListHeaderComponent={
114114
streamingActive &&
115115
messages.length > 0 &&
116116
messages[messages.length - 1]?.status !== "loading" ? (

apps/mobile/src/components/ToolCallMessage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export function ToolCallMessage({
280280
<Text className="mb-1 font-mono text-[13px] text-neutral-400">
281281
Arguments
282282
</Text>
283-
<View className="bg-amber-500/20 p-2">
283+
<View className="rounded bg-amber-500/20 p-2">
284284
<Text className="font-mono text-[13px] text-amber-100">
285285
{JSON.stringify(args, null, 2)}
286286
</Text>
@@ -292,7 +292,7 @@ export function ToolCallMessage({
292292
<Text className="mb-1 font-mono text-[13px] text-neutral-400">
293293
Result
294294
</Text>
295-
<View className="bg-neutral-800/50 p-2">
295+
<View className="rounded bg-neutral-800/50 p-2">
296296
<Text
297297
className="font-mono text-[13px] text-neutral-300"
298298
numberOfLines={10}

apps/mobile/src/components/VisualizationArtifact.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export function VisualizationArtifact({
166166
if (!renderQueryUrl || !projectId || !accessToken) {
167167
return (
168168
<View className="items-start px-4 py-3">
169-
<View className="max-w-[85%] bg-red-900/50 px-4 py-3">
169+
<View className="max-w-[85%] rounded bg-red-900/50 px-4 py-3">
170170
<Text className="font-mono text-[13px] text-red-300">
171171
Unable to load visualization: Not authenticated
172172
</Text>
@@ -178,7 +178,7 @@ export function VisualizationArtifact({
178178
if (hasError) {
179179
return (
180180
<View className="items-start px-4 py-3">
181-
<View className="max-w-[85%] bg-red-900/50 px-4 py-3">
181+
<View className="max-w-[85%] rounded bg-red-900/50 px-4 py-3">
182182
<Text className="font-mono text-[13px] text-red-300">
183183
{errorMessage || "Failed to load visualization"}
184184
</Text>
@@ -191,7 +191,7 @@ export function VisualizationArtifact({
191191
if (!queryResults) {
192192
return (
193193
<View className="w-full items-start px-4 py-3">
194-
<View className="w-full overflow-hidden bg-dark-border">
194+
<View className="w-full overflow-hidden rounded bg-dark-border">
195195
{content.name && (
196196
<View className="border-gray-700 border-b px-4 py-2">
197197
<Text className="font-mono text-[13px] text-white">
@@ -212,7 +212,7 @@ export function VisualizationArtifact({
212212

213213
return (
214214
<View className="w-full items-start px-4 py-3">
215-
<View className="w-full overflow-hidden bg-dark-border">
215+
<View className="w-full overflow-hidden rounded bg-dark-border">
216216
{/* Header with title */}
217217
{content.name && (
218218
<View className="border-gray-700 border-b px-4 py-2">

apps/mobile/src/stores/maxStore.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface MaxState {
3636
abortController: AbortController | null;
3737

3838
// Actions
39-
askMax: (prompt: string) => Promise<void>;
39+
askMax: (prompt: string, conversationId?: string) => Promise<void>;
4040
stopGeneration: () => void;
4141
resetThread: () => void;
4242
setConversation: (conversation: Conversation | null) => void;
@@ -64,7 +64,7 @@ export const useMaxStore = create<MaxState>((set, get) => ({
6464
conversationLoading: false,
6565
abortController: null,
6666

67-
askMax: async (prompt: string) => {
67+
askMax: async (prompt: string, conversationId?: string) => {
6868
const authState = useAuthStore.getState();
6969

7070
if (
@@ -104,10 +104,10 @@ export const useMaxStore = create<MaxState>((set, get) => ({
104104
trace_id: traceId,
105105
};
106106

107-
// Include conversation ID if we have one
108-
const currentConversation = get().conversation;
109-
if (currentConversation?.id) {
110-
requestBody.conversation = currentConversation.id;
107+
// Include conversation ID - prefer explicit param over store state
108+
const effectiveConversationId = conversationId ?? get().conversation?.id;
109+
if (effectiveConversationId) {
110+
requestBody.conversation = effectiveConversationId;
111111
}
112112
console.log(requestBody);
113113
const response = await fetch(

0 commit comments

Comments
 (0)