From 8261910c376d2a320fe49a28c576e86f4ccb39aa Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Thu, 25 Dec 2025 12:07:29 +0700 Subject: [PATCH] Set document title on agent screen for web MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a useEffect that sets the browser tab title to the agent's title (or "Agent" as fallback) when viewing an agent. Only runs on web platform. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- packages/app/src/app/agent/[serverId]/[agentId].tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/app/src/app/agent/[serverId]/[agentId].tsx b/packages/app/src/app/agent/[serverId]/[agentId].tsx index c300f3068..237d1ed1b 100644 --- a/packages/app/src/app/agent/[serverId]/[agentId].tsx +++ b/packages/app/src/app/agent/[serverId]/[agentId].tsx @@ -8,6 +8,7 @@ import { useWindowDimensions, LayoutChangeEvent, ScrollView, + Platform, } from "react-native"; import { useLocalSearchParams, useRouter } from "expo-router"; import { useFocusEffect } from "@react-navigation/native"; @@ -357,6 +358,14 @@ function AgentScreenContent({ serverId, agentId, onBack }: AgentScreenContentPro initializeAgent({ agentId: resolvedAgentId }); }, [resolvedAgentId, initializeAgent, isInitializingFromMap]); + useEffect(() => { + if (Platform.OS !== "web") { + return; + } + const title = agent?.title || "Agent"; + document.title = title; + }, [agent?.title]); + const recalculateMenuPosition = useCallback( (onMeasured?: () => void) => { requestAnimationFrame(() => {