Skip to content

Commit 3a7523d

Browse files
author
Test
committed
🤖 feat: streamline RN tool rendering with web parity
- Add specialized tool cards (bash, file_read, file_edit_*) with diff syntax highlighting - Implement proper streaming state management matching desktop reducer - Fix reasoning auto-collapse and streaming cursor visibility - Add MessageBubble chrome with consistent action buttons/timestamps - Pin react-native-worklets to 0.5.1 for Expo Go compatibility _Generated with `mux`_ Change-Id: I3d11d83d956a909a52501346b98afeb24eecd40f Signed-off-by: Test <test@example.com>
1 parent 4134924 commit 3a7523d

File tree

7 files changed

+1041
-121
lines changed

7 files changed

+1041
-121
lines changed

apps/mobile/bun.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"expo-blur": "^15.0.7",
1414
"expo-clipboard": "^8.0.7",
1515
"expo-constants": "~18.0.10",
16-
"expo-haptics": "^15.0.7",
16+
"expo-haptics": "~15.0.7",
1717
"expo-router": "~6.0.14",
1818
"expo-secure-store": "~15.0.7",
1919
"expo-status-bar": "^3.0.8",
@@ -22,7 +22,8 @@
2222
"react-native-markdown-display": "^7.0.2",
2323
"react-native-reanimated": "^4.1.3",
2424
"react-native-safe-area-context": "~5.6.0",
25-
"react-native-screens": "4.16.0",
25+
"react-native-screens": "~4.16.0",
26+
"react-native-worklets": "0.5.1",
2627
},
2728
"devDependencies": {
2829
"@types/react": "~19.1.10",
@@ -1071,7 +1072,7 @@
10711072

10721073
"react-native-web": ["react-native-web@0.21.2", "", { "dependencies": { "@babel/runtime": "^7.18.6", "@react-native/normalize-colors": "^0.74.1", "fbjs": "^3.0.4", "inline-style-prefixer": "^7.0.1", "memoize-one": "^6.0.0", "nullthrows": "^1.1.1", "postcss-value-parser": "^4.2.0", "styleq": "^0.1.3" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-SO2t9/17zM4iEnFvlu2DA9jqNbzNhoUP+AItkoCOyFmDMOhUnBBznBDCYN92fGdfAkfQlWzPoez6+zLxFNsZEg=="],
10731074

1074-
"react-native-worklets": ["react-native-worklets@0.6.1", "", { "dependencies": { "@babel/plugin-transform-arrow-functions": "^7.0.0-0", "@babel/plugin-transform-class-properties": "^7.0.0-0", "@babel/plugin-transform-classes": "^7.0.0-0", "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", "@babel/plugin-transform-optional-chaining": "^7.0.0-0", "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", "@babel/plugin-transform-template-literals": "^7.0.0-0", "@babel/plugin-transform-unicode-regex": "^7.0.0-0", "@babel/preset-typescript": "^7.16.7", "convert-source-map": "^2.0.0", "semver": "7.7.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0", "react": "*", "react-native": "*" } }, "sha512-URca8l7c7Uog7gv4mcg9KILdJlnbvwdS5yfXQYf5TDkD2W1VY1sduEKrD+sA3lUPXH/TG1vmXAvNxCNwPMYgGg=="],
1075+
"react-native-worklets": ["react-native-worklets@0.5.1", "", { "dependencies": { "@babel/plugin-transform-arrow-functions": "^7.0.0-0", "@babel/plugin-transform-class-properties": "^7.0.0-0", "@babel/plugin-transform-classes": "^7.0.0-0", "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", "@babel/plugin-transform-optional-chaining": "^7.0.0-0", "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", "@babel/plugin-transform-template-literals": "^7.0.0-0", "@babel/plugin-transform-unicode-regex": "^7.0.0-0", "@babel/preset-typescript": "^7.16.7", "convert-source-map": "^2.0.0", "semver": "7.7.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0", "react": "*", "react-native": "*" } }, "sha512-lJG6Uk9YuojjEX/tQrCbcbmpdLCSFxDK1rJlkDhgqkVi1KZzG7cdcBFQRqyNOOzR9Y0CXNuldmtWTGOyM0k0+w=="],
10751076

10761077
"react-refresh": ["react-refresh@0.14.2", "", {}, "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA=="],
10771078

apps/mobile/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"expo-blur": "^15.0.7",
2020
"expo-clipboard": "^8.0.7",
2121
"expo-constants": "~18.0.10",
22-
"expo-haptics": "^15.0.7",
22+
"expo-haptics": "~15.0.7",
2323
"expo-router": "~6.0.14",
2424
"expo-secure-store": "~15.0.7",
2525
"expo-status-bar": "^3.0.8",
@@ -28,7 +28,8 @@
2828
"react-native-markdown-display": "^7.0.2",
2929
"react-native-reanimated": "^4.1.3",
3030
"react-native-safe-area-context": "~5.6.0",
31-
"react-native-screens": "~4.16.0"
31+
"react-native-screens": "~4.16.0",
32+
"react-native-worklets": "0.5.1"
3233
},
3334
"devDependencies": {
3435
"@types/react": "~19.1.10",

apps/mobile/src/messages/MessageBubble.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,17 @@ export function MessageBubble(props: MessageBubbleProps): JSX.Element {
3232
const variant = props.variant ?? "assistant";
3333

3434
const timestamp = useMemo(() => {
35-
if (typeof props.message.timestamp === "number") {
36-
return formatTimestamp(props.message.timestamp);
35+
const ts = "timestamp" in props.message ? props.message.timestamp : undefined;
36+
if (typeof ts === "number") {
37+
return formatTimestamp(ts);
3738
}
3839
return null;
39-
}, [props.message.timestamp]);
40+
}, [props.message]);
4041

4142
const isLastPartOfMessage = useMemo(() => {
42-
if (
43-
"isLastPartOfMessage" in props.message &&
44-
props.message.isLastPartOfMessage &&
45-
"isPartial" in props.message &&
46-
props.message.isPartial === false
47-
) {
48-
return true;
49-
}
50-
return false;
43+
// Simply check if this is marked as the last part
44+
// Don't require isPartial === false, as that flag can be stale during streaming
45+
return "isLastPartOfMessage" in props.message && props.message.isLastPartOfMessage === true;
5146
}, [props.message]);
5247

5348
const showMetaRow = variant === "user" || isLastPartOfMessage;

0 commit comments

Comments
 (0)