Skip to content

Commit 1a6bd61

Browse files
mcintyre94claude
andcommitted
Fix SF Symbol and add tests for addAttachedFile
- Use doc.on.clipboard instead of clipboard for the Paste menu item, which is the standard iOS paste icon (available since iOS 13) - Add ChatViewModelTests for addAttachedFile: verifies lastPathComponent extraction and that multiple calls each append correctly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2ef0938 commit 1a6bd61

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Wisp/Views/SpriteDetail/Chat/ChatAttachmentButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct ChatAttachmentButton: View {
3636
Button {
3737
onPasteFromClipboard()
3838
} label: {
39-
Label("Paste from Clipboard", systemImage: "clipboard")
39+
Label("Paste from Clipboard", systemImage: "doc.on.clipboard")
4040
}
4141
}
4242
} label: {

WispTests/ChatViewModelTests.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,31 @@ struct ChatViewModelTests {
829829
}
830830
}
831831

832+
// MARK: - addAttachedFile
833+
834+
@Test func addAttachedFile_appendsWithLastPathComponent() throws {
835+
let ctx = try makeModelContext()
836+
let (vm, _) = makeChatViewModel(modelContext: ctx)
837+
838+
vm.addAttachedFile(remotePath: "/home/sprite/project/photo_20260312_120000.png")
839+
840+
#expect(vm.attachedFiles.count == 1)
841+
#expect(vm.attachedFiles[0].name == "photo_20260312_120000.png")
842+
#expect(vm.attachedFiles[0].path == "/home/sprite/project/photo_20260312_120000.png")
843+
}
844+
845+
@Test func addAttachedFile_appendsMultiple() throws {
846+
let ctx = try makeModelContext()
847+
let (vm, _) = makeChatViewModel(modelContext: ctx)
848+
849+
vm.addAttachedFile(remotePath: "/home/sprite/project/file1.txt")
850+
vm.addAttachedFile(remotePath: "/home/sprite/project/file2.py")
851+
852+
#expect(vm.attachedFiles.count == 2)
853+
#expect(vm.attachedFiles[0].name == "file1.txt")
854+
#expect(vm.attachedFiles[1].name == "file2.py")
855+
}
856+
832857
@Test func stashDraft_leavesInputReadyForNextMessage() throws {
833858
let ctx = try makeModelContext()
834859
let (vm, _) = makeChatViewModel(modelContext: ctx)

0 commit comments

Comments
 (0)