Show workspace names in History titles
This commit is contained in:
@@ -17,7 +17,7 @@ import { useIsCompactFormFactor } from "@/constants/layout";
|
|||||||
import { formatTimeAgo } from "@/utils/time";
|
import { formatTimeAgo } from "@/utils/time";
|
||||||
import { type AggregatedAgent } from "@/hooks/use-aggregated-agents";
|
import { type AggregatedAgent } from "@/hooks/use-aggregated-agents";
|
||||||
import { useSessionStore } from "@/stores/session-store";
|
import { useSessionStore } from "@/stores/session-store";
|
||||||
import { Archive } from "lucide-react-native";
|
import { Archive, ChevronRight } from "lucide-react-native";
|
||||||
import { getProviderIcon } from "@/components/provider-icons";
|
import { getProviderIcon } from "@/components/provider-icons";
|
||||||
import { navigateToAgent } from "@/utils/navigate-to-agent";
|
import { navigateToAgent } from "@/utils/navigate-to-agent";
|
||||||
import { useArchiveAgent } from "@/hooks/use-archive-agent";
|
import { useArchiveAgent } from "@/hooks/use-archive-agent";
|
||||||
@@ -125,6 +125,33 @@ function SessionBadge({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function WorkspaceTitlePrefix({
|
||||||
|
visible,
|
||||||
|
workspaceName,
|
||||||
|
testID,
|
||||||
|
iconSize,
|
||||||
|
color,
|
||||||
|
}: {
|
||||||
|
visible: boolean;
|
||||||
|
workspaceName: string;
|
||||||
|
testID: string;
|
||||||
|
iconSize: number;
|
||||||
|
color: string;
|
||||||
|
}) {
|
||||||
|
if (!visible) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Text style={styles.workspaceTitleText} numberOfLines={1} testID={testID}>
|
||||||
|
{workspaceName}
|
||||||
|
</Text>
|
||||||
|
<ChevronRight size={iconSize} color={color} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function SessionRow({
|
function SessionRow({
|
||||||
agent,
|
agent,
|
||||||
isMobile,
|
isMobile,
|
||||||
@@ -183,6 +210,13 @@ function SessionRow({
|
|||||||
>
|
>
|
||||||
<View style={styles.rowContent}>
|
<View style={styles.rowContent}>
|
||||||
<View style={styles.rowTitleRow}>
|
<View style={styles.rowTitleRow}>
|
||||||
|
<WorkspaceTitlePrefix
|
||||||
|
visible={!isMobile && Boolean(workspaceName)}
|
||||||
|
workspaceName={workspaceName}
|
||||||
|
testID={`agent-row-workspace-${agent.serverId}-${agent.id}`}
|
||||||
|
iconSize={theme.iconSize.xs}
|
||||||
|
color={theme.colors.foregroundMuted}
|
||||||
|
/>
|
||||||
<View style={styles.providerIconWrap}>
|
<View style={styles.providerIconWrap}>
|
||||||
<ProviderIcon size={theme.iconSize.sm} color={theme.colors.foregroundMuted} />
|
<ProviderIcon size={theme.iconSize.sm} color={theme.colors.foregroundMuted} />
|
||||||
</View>
|
</View>
|
||||||
@@ -248,13 +282,6 @@ function SessionRow({
|
|||||||
>
|
>
|
||||||
{branch}
|
{branch}
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
|
||||||
style={styles.columnMeta}
|
|
||||||
numberOfLines={1}
|
|
||||||
testID={`agent-row-workspace-${agent.serverId}-${agent.id}`}
|
|
||||||
>
|
|
||||||
{workspaceName}
|
|
||||||
</Text>
|
|
||||||
<Text style={styles.columnMetaFixed} numberOfLines={1}>
|
<Text style={styles.columnMetaFixed} numberOfLines={1}>
|
||||||
{timeAgo}
|
{timeAgo}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -548,6 +575,12 @@ const styles = StyleSheet.create((theme) => ({
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
},
|
},
|
||||||
|
workspaceTitleText: {
|
||||||
|
flexShrink: 0,
|
||||||
|
maxWidth: 220,
|
||||||
|
fontSize: theme.fontSize.sm,
|
||||||
|
color: theme.colors.foregroundMuted,
|
||||||
|
},
|
||||||
rowMetaRow: {
|
rowMetaRow: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
|
|||||||
Reference in New Issue
Block a user