refactor: simplify tool call display and path handling
- Remove displayName from tool calls, use name directly with icon - Add medium font weight for tool call badges - Strip workspace root from file paths at parsing level using Zod schema - Add accentBorder to tool call badges and git diff file blocks - Fix user message alignment and vertical spacing - Deduplicate stripCwdPrefix into tool-call-parsers.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
4f3b2317ab
commit
66881511b6
@@ -17,6 +17,7 @@ import { Pencil, Eye, SquareTerminal, Search, Wrench, X } from "lucide-react-nat
|
||||
import { DiffViewer } from "./diff-viewer";
|
||||
import {
|
||||
extractKeyValuePairs,
|
||||
stripCwdPrefix,
|
||||
type EditEntry,
|
||||
type ReadEntry,
|
||||
type CommandDetails,
|
||||
@@ -36,6 +37,7 @@ export interface ToolCallSheetData {
|
||||
parsedEditEntries?: EditEntry[];
|
||||
parsedReadEntries?: ReadEntry[];
|
||||
parsedCommandDetails?: CommandDetails | null;
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
interface ToolCallSheetContextValue {
|
||||
@@ -234,6 +236,7 @@ function ToolCallSheetContent({ data, onClose }: ToolCallSheetContentProps) {
|
||||
parsedEditEntries,
|
||||
parsedReadEntries,
|
||||
parsedCommandDetails,
|
||||
cwd,
|
||||
} = data;
|
||||
|
||||
const IconComponent = kind
|
||||
@@ -453,7 +456,7 @@ function ToolCallSheetContent({ data, onClose }: ToolCallSheetContentProps) {
|
||||
<Text style={styles.sectionTitle}>Diff</Text>
|
||||
{entry.filePath ? (
|
||||
<View style={styles.fileBadge}>
|
||||
<Text style={styles.fileBadgeText}>{entry.filePath}</Text>
|
||||
<Text style={styles.fileBadgeText}>{stripCwdPrefix(entry.filePath, cwd)}</Text>
|
||||
</View>
|
||||
) : null}
|
||||
<View style={styles.diffContainer}>
|
||||
@@ -478,7 +481,7 @@ function ToolCallSheetContent({ data, onClose }: ToolCallSheetContentProps) {
|
||||
<Text style={styles.sectionTitle}>Read Result</Text>
|
||||
{entry.filePath ? (
|
||||
<View style={styles.fileBadge}>
|
||||
<Text style={styles.fileBadgeText}>{entry.filePath}</Text>
|
||||
<Text style={styles.fileBadgeText}>{stripCwdPrefix(entry.filePath, cwd)}</Text>
|
||||
</View>
|
||||
) : null}
|
||||
<ScrollView
|
||||
|
||||
Reference in New Issue
Block a user