refactor: rename plan to tasks and extract task entries from tool calls
This commit is contained in:
@@ -149,7 +149,7 @@ function PlanItem({ update, timestamp }: { update: SessionUpdate; timestamp: Dat
|
||||
<View style={stylesheet.planHeaderLeft}>
|
||||
<Text style={stylesheet.timestamp}>{formatTimestamp(timestamp)}</Text>
|
||||
<Text style={stylesheet.planTitle}>
|
||||
📋 Plan ({update.entries.length} tasks)
|
||||
📋 Tasks ({update.entries.length})
|
||||
</Text>
|
||||
</View>
|
||||
<Text style={stylesheet.expandIcon}>{isExpanded ? '▼' : '▶'}</Text>
|
||||
@@ -217,7 +217,7 @@ export function AgentActivityItem({ item }: AgentActivityItemProps) {
|
||||
const activity = item as AgentActivity;
|
||||
const update = activity.update;
|
||||
|
||||
// Plan
|
||||
// Tasks
|
||||
if (update.kind === 'plan') {
|
||||
return <PlanItem update={update} timestamp={activity.timestamp} />;
|
||||
}
|
||||
|
||||
@@ -757,7 +757,10 @@ function PermissionRequestCard({
|
||||
const { theme } = useUnistyles();
|
||||
|
||||
const { request } = permission;
|
||||
const title = request.title ?? request.name ?? "Permission Required";
|
||||
const isPlanRequest = request.kind === "plan";
|
||||
const title = isPlanRequest
|
||||
? "Plan"
|
||||
: request.title ?? request.name ?? "Permission Required";
|
||||
const description = request.description ?? "";
|
||||
|
||||
const planMarkdown = useMemo(() => {
|
||||
@@ -778,10 +781,12 @@ function PermissionRequestCard({
|
||||
return undefined;
|
||||
}, [request]);
|
||||
|
||||
const toolCallDisplay = useMemo(
|
||||
() => parseToolCallDisplay(request.name ?? "unknown", request.input, null),
|
||||
[request.name, request.input]
|
||||
);
|
||||
const toolCallDisplay = useMemo(() => {
|
||||
if (isPlanRequest) {
|
||||
return null;
|
||||
}
|
||||
return parseToolCallDisplay(request.name ?? "unknown", request.input, null);
|
||||
}, [isPlanRequest, request.name, request.input]);
|
||||
|
||||
const markdownStyles = useMemo(() => createMarkdownStyles(theme), [theme]);
|
||||
|
||||
@@ -978,7 +983,7 @@ function PermissionRequestCard({
|
||||
{ color: theme.colors.foregroundMuted },
|
||||
]}
|
||||
>
|
||||
Proposed Plan
|
||||
{isPlanRequest ? "Plan" : "Proposed Plan"}
|
||||
</Text>
|
||||
<View
|
||||
style={[
|
||||
@@ -996,7 +1001,9 @@ function PermissionRequestCard({
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
<ToolCallDetailsContent display={toolCallDisplay} maxHeight={200} />
|
||||
{!isPlanRequest && toolCallDisplay ? (
|
||||
<ToolCallDetailsContent display={toolCallDisplay} maxHeight={200} />
|
||||
) : null}
|
||||
|
||||
<Text
|
||||
style={[
|
||||
|
||||
@@ -877,7 +877,7 @@ interface TodoListCardProps {
|
||||
disableOuterSpacing?: boolean;
|
||||
}
|
||||
|
||||
function formatPlanTimestamp(timestamp: number): string {
|
||||
function formatTasksTimestamp(timestamp: number): string {
|
||||
try {
|
||||
return new Intl.DateTimeFormat("en-US", {
|
||||
hour: "numeric",
|
||||
@@ -997,7 +997,7 @@ export const TodoListCard = memo(function TodoListCard({
|
||||
);
|
||||
|
||||
const timestampLabel = useMemo(
|
||||
() => formatPlanTimestamp(timestamp),
|
||||
() => formatTasksTimestamp(timestamp),
|
||||
[timestamp]
|
||||
);
|
||||
|
||||
@@ -1013,7 +1013,7 @@ export const TodoListCard = memo(function TodoListCard({
|
||||
<View style={todoListCardStylesheet.card}>
|
||||
<View style={todoListCardStylesheet.header}>
|
||||
<View style={todoListCardStylesheet.headerMeta}>
|
||||
<Text style={todoListCardStylesheet.title}>Plan</Text>
|
||||
<Text style={todoListCardStylesheet.title}>Tasks</Text>
|
||||
<Text style={todoListCardStylesheet.timestamp}>
|
||||
{timestampLabel}
|
||||
</Text>
|
||||
@@ -1032,7 +1032,7 @@ export const TodoListCard = memo(function TodoListCard({
|
||||
<View style={todoListCardStylesheet.list}>
|
||||
{items.length === 0 ? (
|
||||
<Text style={todoListCardStylesheet.emptyText}>
|
||||
No todo items shared yet.
|
||||
No tasks shared yet.
|
||||
</Text>
|
||||
) : (
|
||||
items.map((item, idx) => (
|
||||
|
||||
Reference in New Issue
Block a user