Skip to content

Commit 2e4b4f6

Browse files
committed
Merge origin/main into worktree-dropdown-width
2 parents ab79364 + 68fb7f4 commit 2e4b4f6

26 files changed

Lines changed: 1332 additions & 118 deletions

‎.github/workflows/mobile-eas-preview.yml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,19 @@ jobs:
7878
working-directory: apps/mobile
7979
env:
8080
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
81-
run: eas env:pull preview --non-interactive
81+
run: |
82+
eas env:pull preview --non-interactive
83+
# EAS Update disables dotenv loading. Keep the downloaded native config
84+
# in its process environment so Android build and OTA fingerprints match.
85+
node --input-type=module <<'NODE'
86+
import { appendFileSync, readFileSync } from "node:fs";
87+
import { parseEnv } from "node:util";
88+
const env = parseEnv(readFileSync(".env.local", "utf8"));
89+
const googleServicesFile = env.T3CODE_ANDROID_GOOGLE_SERVICES_FILE;
90+
if (googleServicesFile) {
91+
appendFileSync(process.env.GITHUB_ENV, `T3CODE_ANDROID_GOOGLE_SERVICES_FILE=${googleServicesFile}\n`);
92+
}
93+
NODE
8294
8395
- name: Deploy with fingerprint check
8496
if: steps.expo-token.outputs.present == 'true'

‎.github/workflows/mobile-showcase-screenshots.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ jobs:
7676
echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
7777
"$vp_pnpm_bin/pnpm" --version
7878
79+
- name: Install AXe
80+
# Locks the simulator and answers the notification prompt for the
81+
# agent-activity scene.
82+
# Homebrew refuses third-party tap formulae until they are trusted;
83+
# older releases have no trust command and install them as is.
84+
run: |
85+
brew tap cameroncooke/axe
86+
if brew commands | grep -qx trust; then brew trust --formula cameroncooke/axe/axe; fi
87+
brew install cameroncooke/axe/axe
88+
axe --version
89+
7990
- name: Capture iOS showcase
8091
run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}"
8192

‎apps/mobile/modules/t3-agent-notifications/android/src/main/java/expo/modules/t3agentnotifications/AgentNotifications.kt‎

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,7 @@ object AgentNotifications {
138138
// Match iOS foreground presentation. Consume suppressed alerts as well,
139139
// so a delivery retry cannot surface them after the app backgrounds.
140140
if (!ProcessLifecycleOwner.get().lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
141-
val title = data["alert_title"].orEmpty().take(120)
142-
// Grouped alerts list up to five 120-character thread titles.
143-
val body = data["alert_body"].orEmpty().take(608)
144-
val id = alertId.hashCode()
145-
val notification = base(context, ALERT_CHANNEL)
146-
.setContentTitle(title).setContentText(body)
147-
.setStyle(NotificationCompat.BigTextStyle().bigText(body))
148-
.setAutoCancel(true)
149-
.setContentIntent(contentIntent(context, scheme, data["alert_path"], id))
150-
.build()
151-
manager(context).notify(ALERT_TAG, id, notification)
141+
postAlert(context, scheme, data, alertId)
152142
}
153143
prefs.edit().remove("seenAlerts").putString(
154144
"seenAlertsOrdered",
@@ -157,6 +147,36 @@ object AgentNotifications {
157147
}
158148
}
159149

150+
private fun postAlert(
151+
context: Context,
152+
scheme: String,
153+
data: Map<String, String>,
154+
alertId: String
155+
) {
156+
val title = data["alert_title"].orEmpty().take(120)
157+
// Grouped alerts list up to five 120-character thread titles.
158+
val body = data["alert_body"].orEmpty().take(608)
159+
val id = alertId.hashCode()
160+
val notification = base(context, ALERT_CHANNEL)
161+
.setContentTitle(title).setContentText(body)
162+
.setStyle(NotificationCompat.BigTextStyle().bigText(body))
163+
.setAutoCancel(true)
164+
.setContentIntent(contentIntent(context, scheme, data["alert_path"], id))
165+
.build()
166+
manager(context).notify(ALERT_TAG, id, notification)
167+
}
168+
169+
/**
170+
* Renders a relay-shaped payload without the registration, freshness and
171+
* foreground checks, for the showcase capture's staged notifications.
172+
*/
173+
@Synchronized
174+
fun showcase(context: Context, scheme: String, data: Map<String, String>) {
175+
channels(context)
176+
data["alert_id"]?.let { postAlert(context, scheme, data, it) }
177+
showActivity(context, scheme, data, data["active"] == "true", RUNNING_LIFETIME_MS)
178+
}
179+
160180
private fun updateActivity(
161181
context: Context,
162182
prefs: SharedPreferences,

‎apps/mobile/modules/t3-agent-notifications/android/src/main/java/expo/modules/t3agentnotifications/T3AgentNotificationsModule.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class T3AgentNotificationsModule : Module() {
2626
appContext.reactContext?.let { AgentNotifications.clear(it) }
2727
}
2828

29+
Function("showShowcaseActivity") { scheme: String, data: Map<String, String> ->
30+
appContext.reactContext?.let { AgentNotifications.showcase(it, scheme, data) }
31+
}
32+
2933
Function("openLiveUpdateSettings") {
3034
val context = appContext.reactContext
3135
if (context == null || Build.VERSION.SDK_INT < 36) {

‎apps/mobile/src/Stack.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import { SettingsAppearanceRouteScreen } from "./features/settings/SettingsAppea
7171
import { SettingsClientStorageRouteScreen } from "./features/settings/SettingsClientStorageRouteScreen";
7272
import { SettingsDiagnosticsRouteScreen } from "./features/diagnostics/SettingsDiagnosticsRouteScreen";
7373
import { SettingsAuthRouteScreen } from "./features/settings/SettingsAuthRouteScreen";
74+
import { SettingsEnvironmentDetailRouteScreen } from "./features/settings/SettingsEnvironmentDetailRouteScreen";
7475
import { SettingsEnvironmentsRouteScreen } from "./features/settings/SettingsEnvironmentsRouteScreen";
7576
import {
7677
SettingsEnvironmentAgentBehaviorRouteScreen,
@@ -193,6 +194,11 @@ const SettingsContentStack = createNativeStackNavigator({
193194
title: "Environments",
194195
},
195196
}),
197+
SettingsEnvironmentDetail: createNativeStackScreen({
198+
screen: SettingsEnvironmentDetailRouteScreen,
199+
linking: "environments/:environmentId",
200+
options: { title: "Environment" },
201+
}),
196202
SettingsEnvironmentNewThreads: createNativeStackScreen({
197203
screen: SettingsEnvironmentNewThreadsRouteScreen,
198204
linking: "new-threads",

‎apps/mobile/src/features/agent-awareness/androidNotifications.ts‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ interface AndroidAgentNotifications {
66
configure(deviceId: string, userId: string, scheme: string, ongoingEnabled: boolean): void;
77
clear(): void;
88
openLiveUpdateSettings?(): boolean;
9+
showShowcaseActivity?(scheme: string, data: Record<string, string>): void;
910
}
1011

1112
const native =
@@ -17,18 +18,24 @@ export function supportsAndroidAgentNotifications(): boolean {
1718
return typeof native?.configure === "function" && typeof native?.clear === "function";
1819
}
1920

21+
function appScheme(): string {
22+
const scheme = Constants.expoConfig?.scheme;
23+
return (Array.isArray(scheme) ? scheme[0] : scheme) ?? "t3code";
24+
}
25+
2026
export function configureAndroidAgentNotifications(
2127
deviceId: string,
2228
userId: string,
2329
ongoingEnabled: boolean,
2430
): void {
25-
const scheme = Constants.expoConfig?.scheme;
26-
native?.configure?.(
27-
deviceId,
28-
userId,
29-
(Array.isArray(scheme) ? scheme[0] : scheme) ?? "t3code",
30-
ongoingEnabled,
31-
);
31+
native?.configure?.(deviceId, userId, appScheme(), ongoingEnabled);
32+
}
33+
34+
/** Posts a staged relay payload for the showcase capture; false when unsupported. */
35+
export function showAndroidShowcaseAgentActivity(data: Record<string, string>): boolean {
36+
if (!native?.showShowcaseActivity) return false;
37+
native.showShowcaseActivity(appScheme(), data);
38+
return true;
3239
}
3340

3441
export function clearAndroidAgentNotifications(): void {

‎apps/mobile/src/features/connection/CloudEnvironmentRows.tsx‎

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { type RelayEnvironmentView, useConnectionController } from "./useConnect
3535

3636
interface CloudEnvironmentRowsProps {
3737
readonly connectedCloudEnvironments: ReadonlyArray<ConnectedEnvironmentSummary>;
38+
readonly onOpenEnvironment?: (environmentId: EnvironmentId) => void;
3839
readonly onSetEnvironmentEnabled: (environmentId: EnvironmentId, enabled: boolean) => void;
3940
/** Long-press on a saved row. The callback owns the confirm. */
4041
readonly onRemoveEnvironment: (environmentId: EnvironmentId) => void;
@@ -124,41 +125,45 @@ function CloudEnvironmentRowsContent(
124125
) : null}
125126

126127
{hasCloudRows ? (
127-
<View collapsable={false} className="overflow-hidden rounded-[24px] bg-card">
128-
{props.connectedCloudEnvironments.map((environment, index) => (
128+
<View collapsable={false} className="overflow-hidden rounded-[24px] bg-grouped-card">
129+
{props.connectedCloudEnvironments.map((environment) => (
129130
<ConnectedCloudEnvironmentRow
130131
key={environment.environmentId}
131132
environment={environment}
132133
descriptor={discoveredDescriptors.get(environment.environmentId)}
133-
borderTop={index !== 0}
134134
onSetEnabled={(enabled) =>
135135
props.onSetEnvironmentEnabled(environment.environmentId, enabled)
136136
}
137137
onRemove={() => props.onRemoveEnvironment(environment.environmentId)}
138+
onOpen={
139+
props.onOpenEnvironment
140+
? () => props.onOpenEnvironment?.(environment.environmentId)
141+
: undefined
142+
}
138143
errorExpanded={expandedErrorId === environment.environmentId}
139144
onToggleError={() => handleToggleCloudError(environment.environmentId)}
140145
/>
141146
))}
142-
{availableCloudEnvironments.map((environment, index) => (
147+
{availableCloudEnvironments.map((environment) => (
143148
<CloudEnvironmentRow
144149
key={environment.environment.environmentId}
145150
environment={environment}
146-
borderTop={props.connectedCloudEnvironments.length > 0 || index !== 0}
151+
showChevron={props.onOpenEnvironment !== undefined}
147152
onConnect={() => handleConnectCloudEnvironment(environment)}
148153
errorExpanded={expandedErrorId === environment.environment.environmentId}
149154
onToggleError={() => handleToggleCloudError(environment.environment.environmentId)}
150155
/>
151156
))}
152157
</View>
153158
) : controller.relayDiscovery.isRefreshing ? (
154-
<View collapsable={false} className="items-center gap-3 rounded-[24px] bg-card p-6">
159+
<View collapsable={false} className="items-center gap-3 rounded-[24px] bg-grouped-card p-6">
155160
<ActivityIndicator colorClassName={"accent-icon"} />
156161
<Text className="text-center text-sm leading-normal text-foreground-muted">
157162
Loading linked cloud environments.
158163
</Text>
159164
</View>
160165
) : controller.relayDiscovery.error ? null : (
161-
<View collapsable={false} className="rounded-[24px] bg-card p-5">
166+
<View collapsable={false} className="rounded-[24px] bg-grouped-card p-5">
162167
<Text className="text-sm leading-normal text-foreground-muted">
163168
No additional linked cloud environments.
164169
</Text>
@@ -170,7 +175,7 @@ function CloudEnvironmentRowsContent(
170175
{discoveryAvailable &&
171176
controller.relayDiscovery.error &&
172177
!controller.relayDiscovery.isRefreshing ? (
173-
<View collapsable={false} className="gap-3 rounded-[24px] bg-card p-5">
178+
<View collapsable={false} className="gap-3 rounded-[24px] bg-grouped-card p-5">
174179
<Text className="text-base font-t3-bold text-foreground">
175180
Could not load T3 Connect environments
176181
</Text>
@@ -202,10 +207,10 @@ function ConnectedCloudEnvironmentRow(props: {
202207
readonly environment: ConnectedEnvironmentSummary;
203208
/** Discovery's view of the server, for the glyph before the first connection. */
204209
readonly descriptor: ExecutionEnvironmentDescriptor | undefined;
205-
readonly borderTop: boolean;
206210
readonly errorExpanded: boolean;
207211
readonly onSetEnabled: (enabled: boolean) => void;
208212
readonly onRemove: () => void;
213+
readonly onOpen?: (() => void) | undefined;
209214
readonly onToggleError: () => void;
210215
}) {
211216
const serverConfig = useAtomValue(
@@ -222,10 +227,13 @@ function ConnectedCloudEnvironmentRow(props: {
222227
return (
223228
<Pressable
224229
accessibilityHint="Long press to remove from this device"
230+
accessibilityRole={props.onOpen ? "button" : undefined}
231+
accessibilityLabel={props.onOpen ? `Manage ${props.environment.environmentLabel}` : undefined}
232+
onPress={props.onOpen}
225233
onLongPress={props.onRemove}
226234
>
227235
<CloudEnvironmentRowShell
228-
borderTop={props.borderTop}
236+
opensDetails={props.onOpen !== undefined}
229237
connectionError={enabled || unsupported ? props.environment.connectionError : null}
230238
connectionErrorTraceId={enabled ? props.environment.connectionErrorTraceId : null}
231239
connectionState={enabled || unsupported ? props.environment.connectionState : "available"}
@@ -246,7 +254,7 @@ function ConnectedCloudEnvironmentRow(props: {
246254

247255
function CloudEnvironmentRow(props: {
248256
readonly environment: RelayEnvironmentView;
249-
readonly borderTop: boolean;
257+
readonly showChevron: boolean;
250258
readonly errorExpanded: boolean;
251259
readonly onConnect: () => void;
252260
readonly onToggleError: () => void;
@@ -260,7 +268,7 @@ function CloudEnvironmentRow(props: {
260268

261269
return (
262270
<CloudEnvironmentRowShell
263-
borderTop={props.borderTop}
271+
showChevron={props.showChevron}
264272
connectionError={presentation.connectionError}
265273
connectionErrorTraceId={presentation.connectionErrorTraceId}
266274
connectionState={presentation.connectionState}
@@ -285,7 +293,8 @@ function CloudEnvironmentRow(props: {
285293
}
286294

287295
function CloudEnvironmentRowShell(props: {
288-
readonly borderTop: boolean;
296+
readonly showChevron?: boolean;
297+
readonly opensDetails?: boolean;
289298
readonly connectionError: string | null;
290299
readonly connectionErrorTraceId: string | null;
291300
readonly connectionState: EnvironmentConnectionPhase;
@@ -340,13 +349,7 @@ function CloudEnvironmentRowShell(props: {
340349
[measuredErrorText, props.connectionError],
341350
);
342351
return (
343-
<View
344-
collapsable={false}
345-
className={cn(
346-
"flex-row items-center gap-3 bg-card px-4 py-3.5",
347-
props.borderTop && "border-t border-border",
348-
)}
349-
>
352+
<View collapsable={false} className="flex-row items-center gap-3 bg-grouped-card px-4 py-3.5">
350353
<View className="min-w-0 flex-1 gap-0.5">
351354
<View className="min-w-0 flex-row items-center gap-2">
352355
<ConnectionStatusDot state={props.connectionState} pulse={shouldPulse} size={7} />
@@ -409,10 +412,16 @@ function CloudEnvironmentRowShell(props: {
409412
</StatusContainer>
410413
</View>
411414
<ThemedSwitch
415+
style={{ alignSelf: "center" }}
412416
disabled={props.disabled}
413417
onValueChange={props.onValueChange}
414418
value={props.value}
415419
/>
420+
{props.opensDetails || props.showChevron ? (
421+
<View style={{ opacity: props.opensDetails ? 1 : 0.4 }}>
422+
<SymbolView name="chevron.right" size={12} tintColorClassName="accent-icon-subtle" />
423+
</View>
424+
) : null}
416425
</View>
417426
);
418427
}

‎apps/mobile/src/features/connection/ConnectionEnvironmentRow.tsx‎

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function connectionStatusLabel(environment: ConnectedEnvironmentSummary): string
3535
export function ConnectionEnvironmentRow(props: {
3636
readonly environment: ConnectedEnvironmentSummary;
3737
readonly expanded: boolean;
38+
readonly opensDetails?: boolean;
3839
readonly onToggle: () => void;
3940
readonly onReconnect: (environmentId: EnvironmentId) => void;
4041
readonly onRemove: (environmentId: EnvironmentId) => void;
@@ -76,19 +77,22 @@ export function ConnectionEnvironmentRow(props: {
7677
}, [label, url, props]);
7778

7879
return (
79-
<Animated.View layout={LinearTransition.duration(250)} className="bg-card">
80+
<Animated.View layout={LinearTransition.duration(250)} className="bg-grouped-card">
8081
<Pressable
8182
className="flex-row items-center gap-3 px-4 py-3.5 active:opacity-70"
83+
accessibilityRole="button"
84+
accessibilityLabel={
85+
props.opensDetails ? `Manage ${props.environment.environmentLabel}` : undefined
86+
}
8287
onPress={props.onToggle}
8388
>
84-
<ConnectionStatusDot
85-
state={enabled || unsupported ? props.environment.connectionState : "available"}
86-
pulse={isRetrying}
87-
size={8}
88-
/>
89-
9089
<View className="flex-1 gap-0.5">
9190
<View className="flex-row items-center gap-1.5">
91+
<ConnectionStatusDot
92+
state={enabled || unsupported ? props.environment.connectionState : "available"}
93+
pulse={isRetrying}
94+
size={8}
95+
/>
9296
<EnvironmentMachineSymbol
9397
kind={resolveEnvironmentMachineKind(serverConfig)}
9498
size={14}
@@ -101,9 +105,11 @@ export function ConnectionEnvironmentRow(props: {
101105
{props.environment.environmentLabel}
102106
</Text>
103107
</View>
104-
<Text className="text-xs text-foreground-muted" numberOfLines={1}>
105-
{props.environment.displayUrl}
106-
</Text>
108+
{!props.environment.isRelayManaged && props.environment.displayUrl.trim() ? (
109+
<Text className="text-xs text-foreground-muted" numberOfLines={1}>
110+
{props.environment.displayUrl}
111+
</Text>
112+
) : null}
107113
{statusLabel ? (
108114
<Text
109115
className={cn(
@@ -126,12 +132,13 @@ export function ConnectionEnvironmentRow(props: {
126132
</View>
127133

128134
<ThemedSwitch
135+
style={{ alignSelf: "center" }}
129136
disabled={unsupported}
130137
onValueChange={(next) => props.onSetEnabled(props.environment.environmentId, next)}
131138
value={enabled}
132139
/>
133140
<SymbolView
134-
name="chevron.down"
141+
name={props.opensDetails ? "chevron.right" : "chevron.down"}
135142
size={12}
136143
tintColorClassName="accent-icon-subtle"
137144
type="monochrome"

0 commit comments

Comments
 (0)