uttrflow / uttrflow/uttrflow-swift

A copied file is recorded as its name in plain text, so choosing it from the panel pastes the name rather than the file

Open
#590 0 comments 0 reactions 0 assignees View on GitHub
area:clipboard enhancement needs-info P2
Dominant language
Swift
Stars
4
Forks
17
Avg merge
4h 27m
Merged PRs (30d)
286

Description

## What happens

The watcher reads exactly three flavours from the pasteboard: `.string`, `.html` and an `NSImage` (`Sources/UttrflowClipboard/ClipboardSource+System.swift:14-37`, `PasteboardWatcher.swift:97-138`). There is no read of `public.file-url` / `NSPasteboard.PasteboardType.fileURL`, and `ClipKind` has no case for a file (`Sources/UttrflowClipboard/Clip.swift:7-17`; `.filePath` is a typed path).

When files are copied in the macOS file manager, the pasteboard carries the file URLs, plus a plain-text flavour holding the file names. The watcher takes the text branch (`PasteboardWatcher.swift:118-138`). The clip becomes `report.pdf` as `.text`, the row shows the name, and Return pastes the word "report.pdf". The same happens for several files copied at once (a list of names), and for a file copied from any app that offers both flavours.

## Why it matters

People copy files as often as text. A history row that looks like the file but pastes its name is the kind of mistake that makes the history feel untrustworthy. The request list for this area names file clips explicitly.

## Decision needed

1. Should a file copy be recorded at all? If so, is it a new `ClipKind.file` holding the URLs (bookmarks, since files move), or a path-shaped text clip (`.filePath` with the full path, which at least pastes something useful)?
2. What does Return do with it: paste the file back as a file URL (so Mail and Finder take the file), or paste the path?
3. What happens when the file has since been moved or deleted? (Compare picture rows' "no longer on this Mac".)

## Acceptance criteria

- The chosen behaviour is written in `Docs/panel.md`.
- `ClipboardSource` gains a `fileURLs()` read, with the watcher's handling tested in `Tests/UttrflowClipboardTests/PasteboardWatcherTests.swift` using the existing fake source: a file copy with a name flavour is not recorded as ordinary text.
- If files are recorded, the panel row has an icon, an accessibility label and a missing-file state.

Contributor guide

Open the contributing guide

Research direction

Read Docs/panel.md, Sources/UttrflowClipboard/ClipboardSource+System.swift, PasteboardWatcher.swift, and Clip.swift, then inspect the fake source in Tests/UttrflowClipboardTests/PasteboardWatcherTests.swift. First resolve the file representation, paste behavior, and missing-file behavior described in the decision section. Done means the chosen behavior is documented, fileURL handling is tested, and the panel acceptance criteria are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.