Update files

This commit is contained in:
Mohamed Boudra
2026-01-24 22:05:44 +07:00
parent 0d9d95c340
commit 6503d3b408
5 changed files with 96 additions and 46 deletions
@@ -57,6 +57,8 @@ import {
import { extractAgentModel } from "@/utils/extract-agent-model";
import { startPerfMonitor } from "@/utils/perf-monitor";
import { shortenPath } from "@/utils/shorten-path";
import { deriveBranchLabel, deriveProjectPath } from "@/utils/agent-display-info";
import { useCheckoutStatusQuery } from "@/hooks/use-checkout-status-query";
import {
DropdownMenu,
DropdownMenuContent,
@@ -406,6 +408,13 @@ function AgentScreenContent({
? branchError ?? "Unavailable"
: branchLabel ?? "Unknown";
// Checkout status for header subtitle
const checkoutStatusQuery = useCheckoutStatusQuery({
serverId,
agentId: resolvedAgentId ?? "",
});
const checkout = checkoutStatusQuery.status;
useEffect(() => {
if (!resolvedAgentId) {
setFocusedAgentId(null);
@@ -490,6 +499,20 @@ function AgentScreenContent({
const effectiveAgent = agent ?? placeholderAgent;
// Header subtitle: project path + branch (matching agent list row format)
const headerProjectPath = effectiveAgent
? deriveProjectPath(effectiveAgent.cwd, checkout)
: null;
const headerBranchLabel = deriveBranchLabel(checkout);
const headerSubtitle = useMemo(() => {
if (!headerProjectPath) return undefined;
const path = shortenPath(headerProjectPath);
if (headerBranchLabel) {
return `${path} · ${headerBranchLabel}`;
}
return path;
}, [headerProjectPath, headerBranchLabel]);
useEffect(() => {
if (!isPendingCreateForRoute || !pendingCreate) {
return;
@@ -596,6 +619,7 @@ function AgentScreenContent({
{/* Header */}
<MenuHeader
title={effectiveAgent.title || "Agent"}
subtitle={headerSubtitle}
rightContent={
<View style={styles.headerRightContent}>
<Pressable onPress={toggleFileExplorer} style={styles.menuButton}>