Skip to content

Commit d7506a2

Browse files
feat(agents-mobile): Add agent signal controls (#4391)
## Summary - Add mobile agent signal support, including stop controls in the composer and a signal submenu in the session menu. - Pass composer/drawer inset into the embedded chat log so timeline content scrolls behind the native controls. - Align mobile embedded chat message widths and fade masking with the native composer layout. ## Test plan - pnpm --filter @electric-ax/agents-mobile typecheck - pnpm --filter @electric-ax/agents-server-ui typecheck - ReadLints on recently edited files Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8803b36 commit d7506a2

11 files changed

Lines changed: 568 additions & 102 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@electric-ax/agents-mobile': patch
3+
'@electric-ax/agents-server-ui': patch
4+
---
5+
6+
Add mobile agent signal controls. The mobile chat composer now shows a stop control while a run is active, the session menu exposes all entity signal types in a child menu, and the embedded chat timeline accounts for the native composer/drawer inset with aligned message widths and bottom fade masking.

‎packages/agents-mobile/app/session.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type SessionDomEmbedProps = {
3333
theme: `light` | `dark`
3434
scrollToBottomSignal?: number
3535
inlineQueuedMessages?: Array<OptimisticInboxMessage>
36+
bottomInset?: number
3637
onRequestOpenEntity: (entityUrl: string) => Promise<void>
3738
style?: StyleProp<ViewStyle>
3839
matchContents?: boolean
@@ -83,9 +84,9 @@ export default function SessionRoute(): React.ReactElement {
8384
() => ({
8485
top: embedTop,
8586
width: windowDimensions.width,
86-
height: Math.max(0, windowDimensions.height - embedTop - composerInset),
87+
height: Math.max(0, windowDimensions.height - embedTop),
8788
}),
88-
[composerInset, embedTop, windowDimensions.height, windowDimensions.width]
89+
[embedTop, windowDimensions.height, windowDimensions.width]
8990
)
9091
const embedSize = useMemo(
9192
() => ({
@@ -130,6 +131,7 @@ export default function SessionRoute(): React.ReactElement {
130131
theme={scheme}
131132
scrollToBottomSignal={chatLogScrollSignal}
132133
inlineQueuedMessages={inlineQueuedMessages}
134+
bottomInset={composerInset}
133135
serverHeaders={serverHeaders}
134136
onRequestOpenEntity={async (target) => openSession(target)}
135137
dom={domOptions(styles, embedSize, tokens.bg)}

‎packages/agents-mobile/src/components/Icon.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export type IconName =
3131
| `swap`
3232
| `chat`
3333
| `database`
34+
| `radio`
3435
| `arrow-up`
36+
| `square`
3537

3638
const PATHS: Record<IconName, string> = {
3739
back: `M15 18l-6-6 6-6`,
@@ -52,7 +54,9 @@ const PATHS: Record<IconName, string> = {
5254
swap: `M7 4l-3 3 3 3M4 7h13M17 14l3 3-3 3M20 17H7`,
5355
chat: `M4 4h16v12H8l-4 4Z`,
5456
database: `M5 5c0-1.1 3.1-2 7-2s7 .9 7 2v14c0 1.1-3.1 2-7 2s-7-.9-7-2V5ZM5 12c0 1.1 3.1 2 7 2s7-.9 7-2`,
57+
radio: `M4.9 19.1a10 10 0 0 1 0-14.2M7.8 16.2a6 6 0 0 1 0-8.4M10.6 13.4a2 2 0 0 1 0-2.8M14 12h.01M16.2 7.8a6 6 0 0 1 0 8.4M19.1 4.9a10 10 0 0 1 0 14.2`,
5558
'arrow-up': `M12 19V5M5 12l7-7 7 7`,
59+
square: `M7 7h10v10H7z`,
5660
}
5761

5862
export function Icon({
@@ -76,6 +80,14 @@ export function Icon({
7680
)
7781
}
7882

83+
if (name === `square`) {
84+
return (
85+
<Svg width={size} height={size} viewBox="0 0 24 24">
86+
<Path d={PATHS[name]} fill={color} />
87+
</Svg>
88+
)
89+
}
90+
7991
return (
8092
<Svg width={size} height={size} viewBox="0 0 24 24">
8193
<Path

0 commit comments

Comments
 (0)