Skip to content

Commit 653ae2b

Browse files
mcintyre94claude
andcommitted
Apply relativeToCwd to tool step preview content and file path inputs
previewContent in ToolStepRow (the 2-line result snippet shown below the label) was rendering raw paths from tool output. file_path inputs for Read, Write and Edit in ToolInputDetailView were also showing full paths. Apply relativeToCwd consistently in both places. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2a1a8fd commit 653ae2b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Wisp/Views/SpriteDetail/Chat/ToolInputDetailView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ struct ToolInputDetailView: View {
4444
Text(label)
4545
.font(.caption2)
4646
.foregroundStyle(.secondary)
47-
Text(input["file_path"]?.stringValue ?? "")
47+
Text((input["file_path"]?.stringValue ?? "").relativeToCwd(workingDirectory))
4848
.font(.system(.caption, design: .monospaced))
4949
.textSelection(.enabled)
5050
}
5151
}
5252

5353
private var writeInput: some View {
5454
VStack(alignment: .leading, spacing: 4) {
55-
Text(input["file_path"]?.stringValue ?? "")
55+
Text((input["file_path"]?.stringValue ?? "").relativeToCwd(workingDirectory))
5656
.font(.system(.caption, design: .monospaced))
5757
.foregroundStyle(.secondary)
5858

@@ -67,7 +67,7 @@ struct ToolInputDetailView: View {
6767

6868
private var editInput: some View {
6969
VStack(alignment: .leading, spacing: 4) {
70-
Text(input["file_path"]?.stringValue ?? "")
70+
Text((input["file_path"]?.stringValue ?? "").relativeToCwd(workingDirectory))
7171
.font(.system(.caption, design: .monospaced))
7272
.foregroundStyle(.secondary)
7373

Wisp/Views/SpriteDetail/Chat/ToolStepRow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct ToolStepRow: View {
3434
}
3535

3636
if let preview = card.result?.previewContent {
37-
Text(preview)
37+
Text(preview.relativeToCwd(workingDirectory))
3838
.font(.system(.caption2, design: .monospaced))
3939
.foregroundStyle(.tertiary)
4040
.lineLimit(2)

0 commit comments

Comments
 (0)